PAT 甲级 1041 Be Unique (20 分)(简单,一遍过)
摘要:1041 Be Unique (20 分) 1041 Be Unique (20 分) 1041 Be Unique (20 分) Being unique is so important to people on Mars that even their lottery is designed i
阅读全文
posted @
2019-08-31 11:15
蔡军帅
阅读(359)
推荐(0)
PAT 甲级 1040 Longest Symmetric String (25 分)(字符串最长对称字串,遍历)
摘要:1040 Longest Symmetric String (25 分) 1040 Longest Symmetric String (25 分) 1040 Longest Symmetric String (25 分) Given a string, you are supposed to out
阅读全文
posted @
2019-08-31 09:36
蔡军帅
阅读(327)
推荐(0)
PAT 甲级 1039 Course List for Student (25 分)(字符串哈希,优先队列,没想到是哈希)*
摘要:1039 Course List for Student (25 分) 1039 Course List for Student (25 分) 1039 Course List for Student (25 分) Zhejiang University has 40000 students and
阅读全文
posted @
2019-08-30 17:38
蔡军帅
阅读(291)
推荐(0)
PAT 甲级 1038 Recover the Smallest Number (30 分)(思维题,贪心)
摘要:1038 Recover the Smallest Number (30 分) 1038 Recover the Smallest Number (30 分) 1038 Recover the Smallest Number (30 分) Given a collection of number s
阅读全文
posted @
2019-08-29 16:59
蔡军帅
阅读(397)
推荐(1)
PAT 甲级 1037 Magic Coupon (25 分) (较简单,贪心)
摘要:1037 Magic Coupon (25 分) 1037 Magic Coupon (25 分) 1037 Magic Coupon (25 分) The magic shop in Mars is offering some magic coupons. Each coupon has an i
阅读全文
posted @
2019-08-29 16:16
蔡军帅
阅读(468)
推荐(0)
PAT 甲级 1036 Boys vs Girls (25 分)(简单题)
摘要:1036 Boys vs Girls (25 分) 1036 Boys vs Girls (25 分) 1036 Boys vs Girls (25 分) This time you are asked to tell the difference between the lowest grade
阅读全文
posted @
2019-08-27 20:42
蔡军帅
阅读(353)
推荐(0)
PAT 甲级 1035 Password (20 分)(简单题)
摘要:1035 Password (20 分) 1035 Password (20 分) 1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for the users.
阅读全文
posted @
2019-08-27 19:57
蔡军帅
阅读(407)
推荐(0)
PAT 甲级 1034 Head of a Gang (30 分)(bfs,map,强连通)
摘要:1034 Head of a Gang (30 分) 1034 Head of a Gang (30 分) 1034 Head of a Gang (30 分) One way that the police finds the head of a gang is to check people's
阅读全文
posted @
2019-08-27 16:48
蔡军帅
阅读(484)
推荐(0)
PAT 甲级 1033 To Fill or Not to Fill (25 分)(贪心,误以为动态规划,忽视了油量问题)*
摘要:1033 To Fill or Not to Fill (25 分) With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a ca
阅读全文
posted @
2019-08-26 19:41
蔡军帅
阅读(1052)
推荐(0)
PAT 甲级 1032 Sharing (25 分)(结构体模拟链表,结构体的赋值是深拷贝)
摘要:1032 Sharing (25 分) 1032 Sharing (25 分) 1032 Sharing (25 分) To store English words, one method is to use linked lists and store a word letter by lette
阅读全文
posted @
2019-08-23 14:21
蔡军帅
阅读(386)
推荐(0)
PAT 甲级 1031 Hello World for U (20 分)(一开始没看懂题意)
摘要:1031 Hello World for U (20 分) 1031 Hello World for U (20 分) 1031 Hello World for U (20 分) Given any string of N (≥) characters, you are asked to form
阅读全文
posted @
2019-08-23 13:32
蔡军帅
阅读(382)
推荐(0)
PAT 甲级 1030 Travel Plan (30 分)(dijstra,较简单,但要注意是从0到n-1)
摘要:1030 Travel Plan (30 分) 1030 Travel Plan (30 分) 1030 Travel Plan (30 分) A traveler's map gives the distances between cities along the highways, togeth
阅读全文
posted @
2019-08-19 21:00
蔡军帅
阅读(584)
推荐(0)
PAT 甲级 1029 Median (25 分)(思维题,找两个队列的中位数,没想到)*
摘要:1029 Median (25 分) 1029 Median (25 分) 1029 Median (25 分) Given an increasing sequence S of N integers, the median is the number at the middle position
阅读全文
posted @
2019-08-18 14:43
蔡军帅
阅读(400)
推荐(0)
PAT 甲级 1028 List Sorting (25 分)(排序,简单题)
摘要:1028 List Sorting (25 分) 1028 List Sorting (25 分) 1028 List Sorting (25 分) Excel can sort records according to any column. Now you are supposed to imi
阅读全文
posted @
2019-08-18 13:59
蔡军帅
阅读(388)
推荐(0)
PAT 甲级 1027 Colors in Mars (20 分)(简单,进制转换)
摘要:1027 Colors in Mars (20 分) 1027 Colors in Mars (20 分) 1027 Colors in Mars (20 分) People in Mars represent the colors in their computers in a similar w
阅读全文
posted @
2019-08-18 13:47
蔡军帅
阅读(177)
推荐(0)
PAT 甲级 1026 Table Tennis (30 分)(坑点很多,逻辑较复杂,做了1天)
摘要:1026 Table Tennis (30 分) A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if th
阅读全文
posted @
2019-08-18 13:31
蔡军帅
阅读(1109)
推荐(0)
PAT 甲级1025 PAT Ranking (25 分)(结构体排序,第一次超时了,一次sort即可小技巧优化)
摘要:题意: 给定一次PAT测试的成绩,要求输出考生的编号,总排名,考场编号以及考场排名。 分析: 题意很简单嘛,一开始上来就,一组组输入,一组组排序并记录组内排名,然后再来个总排序并算总排名,结果发现最后一个测试点超时。 发现自己一开始太傻太盲目,其实只要一次性全部输进来,记录好考场编号,一次排序就可以
阅读全文
posted @
2019-08-15 22:53
蔡军帅
阅读(477)
推荐(0)
PAT 甲级 1024 Palindromic Number (25 分)(大数加法,考虑这个数一开始是不是回文串)
摘要:1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分) A number that will be the same when it is written forward
阅读全文
posted @
2019-08-15 22:08
蔡军帅
阅读(522)
推荐(0)
PAT 甲级 1023 Have Fun with Numbers (20 分)(permutation是全排列题目没读懂)
摘要:1023 Have Fun with Numbers (20 分) 1023 Have Fun with Numbers (20 分) 1023 Have Fun with Numbers (20 分) 1023 Have Fun with Numbers (20 分) Notice that th
阅读全文
posted @
2019-08-15 09:39
蔡军帅
阅读(382)
推荐(0)
PAT 甲级 1022 Digital Library (30 分)(字符串读入getline,istringstream,测试点2时间坑点)
摘要:1022 Digital Library (30 分) 1022 Digital Library (30 分) 1022 Digital Library (30 分) A Digital Library contains millions of books, stored according to
阅读全文
posted @
2019-08-12 15:23
蔡军帅
阅读(440)
推荐(0)