散列
shishiness
这个作者很懒,什么都没留下…
展开
-
pat 甲级 A1039 Course List for Student (25分)
1039 Course List for Student (25分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.Input原创 2020-07-24 15:42:35 · 52 阅读 · 0 评论 -
pat 甲级 Hash散列 A1048 Find Coins (25分)
#include<cstdio>int hash[10010];int main(){ int n,m,a; scanf("%d %d",&n,&m); for(int i=0;i<n;i++) { scanf("%d",&a); hash[a]++; } for(int i=0;i<10010;i++) { if(hash[i]&&hash[m-i]) { if(i==m-i&&ha.原创 2020-08-27 20:07:20 · 92 阅读 · 0 评论 -
pat 甲级 A1120 Friend Numbers (20分)
1120 Friend Numbers (20分)Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are friend numbers since 1+2+3 = 5+1 = 6, and 6 is their friend ID. Given some numbers原创 2020-07-22 10:52:53 · 85 阅读 · 0 评论 -
pat 甲级 散列 A1121 Damn Single (25分)
1121 Damn Single (25分)"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input Specification:Each input file contains one test case. F原创 2020-07-22 10:32:46 · 69 阅读 · 0 评论 -
pat 甲级 散列 A1092 To Buy or Not to Buy (20分)
1092 To Buy or Not to Buy (20分)Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell the strings in who...原创 2020-08-25 23:04:20 · 94 阅读 · 0 评论 -
pat 甲级 散列 A1144 The Missing Number (20分)
1144 The Missing Number (20分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (原创 2020-08-25 23:04:04 · 102 阅读 · 0 评论 -
pat 甲级 散列 A1149 Dangerous Goods Packaging (25分)
1149 Dangerous Goods Packaging (25分)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 packe原创 2020-08-25 23:03:49 · 119 阅读 · 1 评论