![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
散列表
ethannotlazy
这个作者很懒,什么都没留下…
展开
-
1149 Dangerous Goods Packaging (25point(s))
When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂) must not be packed with flammable liquid (易燃液体), or it原创 2020-07-23 08:55:21 · 108 阅读 · 0 评论 -
1047 Student List for Course (25分)
直接用string会超时,于是用C风格字符串记录姓名,注意要用char *name = new char[5]来动态创建新的字符数组。#include<string>#include<algorithm>#include<vector>#include<map>#include<iostream>using namespa...原创 2020-03-20 17:39:51 · 76 阅读 · 0 评论 -
1145 Hashing - Average Search Time (25分)
注意:判断素数的方法继续循环条件为i * i <= num。平方探测法的增量d取值范围为0 <= d <= tableSize。通过计算样例得知,无论探测的位置是否为空,都算一次探测。#include<cstdio>int tableSize, inputNum, keyNum;int table[10100] = { 0 };bool isPri...原创 2020-02-08 11:46:16 · 122 阅读 · 0 评论 -
1039 Course List for Student (25分)
#include<cstdio>#include<vector>#include<cstring>#include<set>using namespace std;int queryNum, courseNum;set<int> take[26 * 26 * 26 * 10];int getPos(char *name)...原创 2020-01-09 16:25:54 · 108 阅读 · 0 评论