腾龙之巅
腾龙之巅
全部文章
分类
排序(3)
约数(3)
读书笔记(1)
题解(1)
归档
标签
去牛客网
登录
/
注册
腾龙之巅的博客
全部文章
(共8篇)
特殊排序
#include<cstdio> #include<algorithm> using namespace std; int main() { int n; int sort_org=-1001; while(scanf("%d",&...
2021-01-06
0
468
排序
直接插入排序 核心思想:将待插入元素一个个插入初始已有序的过程,而且插入的位置遵循使插入后仍然保持有序的原则,具体的做法一般是:从后往前枚举已有序部分来确定插入的位置。 代码实现 int str[maxn],n;//n为元素个数,数组下标为1~n void insertSortL(){ ...
2021-01-04
0
395
排序
选择排序核心思想:总共需要进行n趟操作(1<=i<=n),每趟操作选出待排序部分[i,n]中最小的元素,令其与A[i]进行交换。时间复杂度为O(n^2) #include <stdio.h> int main() { int n,t,i,j,k; int a...
2021-01-04
0
459
哈希
http://codeup.cn/problem.php?cid=100000582&pid=0知识点:哈希(hash)即散列#include<cstdio>#include<cstring>const int maxn=1000;int main(){ int...
2020-11-26
0
0
求最小公约数(c)
#include<stdio.h> long long gcd(long long a,long long b) { if(b==0) { &...
2020-10-18
0
468
最大公约数与最小公倍数之间的问题(c)
#include<stdio.h> int gcd(int a,int b) { if(b==0) {  ...
2020-10-18
0
463
求最大公约数与最小公倍数(c)
#include<stdio.h> int gcd(int a,int b)//求最大大公约数 { if(b==0) { &n...
2020-10-17
0
455
输入n,求1到n之间的所有数的约数个数之和(c)!
#include<stdio.h> int main() { int n,i,sum=0; scanf("%d",&n); &n...
2020-10-17
0
692