05 2020 档案

摘要://整数的散列//m个数在n个数中是否出现过的散列 #include<cstdio> using namespace std; int const Maxn = 100010; bool hashTable[Maxn] = {false}; int main(){ int n,m,x;//x表示出现 阅读全文
posted @ 2020-05-19 21:05 王杰森 阅读(132) 评论(0) 推荐(0)
摘要:1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm>//这是sort函数所在的库 4 using namespace std; 5 struct Student{ 6 char id[15]; //id 7 int score 阅读全文
posted @ 2020-05-19 20:33 王杰森 阅读(132) 评论(0) 推荐(0)
摘要:选择排序,时间复杂度 O(n^2), 下面要注意c语言传参入数组传入的是地址!,所以用sizeof求数组大小的时候,在自定义函数中求出来的sizeof(arr)就是指针的大小,为4;64位系统的话是8; 所以要在main函数中传入自定义方法给数组大小 1 #include <stdio.h> 2 # 阅读全文
posted @ 2020-05-14 14:43 王杰森 阅读(189) 评论(0) 推荐(0)
摘要://B1032 挖掘机技术哪家强 1 #include <stdio.h> 2 const int maxn = 100001; 3 int school[maxn] = {0};//定义大型数组要在main函数外部,避免消耗系统栈 4 int main(){ 5 int n; 6 int schI 阅读全文
posted @ 2020-05-09 17:10 王杰森 阅读(143) 评论(0) 推荐(0)