
PAT 甲
文章平均质量分 77
九大于七
look at the stars,look how they shine for you
展开
-
1087 All Roads Lead to Rome (30分)
Problem:https://pintia.cn/problem-sets/994805342720868352/problems/994805379664297984tags:dij最短路 map映射 大杂烩Mean:给出n个城市,m条边,起始城市X,终点城市ROM,求起点到终点的最小花费,花费相同要最大快乐,快乐相同要最少步数(平均值最大).同时求最小花费有几种走法Solution输入是城市,所以map(idx) 把城市名和编号映射一下.同时再反向映射(redx) 这样用..原创 2020-07-22 21:31:15 · 498 阅读 · 0 评论 -
1116. Come on! Let's C (20)
1116. Come on! Let's C (20)时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, Yue"Let's C" is a popular and fun programmin原创 2017-12-30 11:29:33 · 178 阅读 · 0 评论 -
1117. Eddington Number(25)
1117. Eddington Number(25)时间限制250 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueBritish astronomer Eddington liked to ride原创 2017-12-30 15:55:21 · 171 阅读 · 0 评论 -
1112. Stucked Keyboard (20)
1112. Stucked Keyboard (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueOn a broken keyboard, some of the keys ar原创 2018-01-07 13:30:49 · 207 阅读 · 0 评论 -
1113. Integer Set Partition (25)
1113. Integer Set Partition (25)时间限制150 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a set of N (> 1) positive inte原创 2018-01-08 16:05:22 · 238 阅读 · 0 评论 -
1151 LCA in a Binary Tree (30 分)
1、题面:https://pintia.cn/problem-sets/994805342720868352/problems/10384301300118978562、题意:给出树的中序、前序,然后询问u,v的lca3、正解:1、不建树,直接递归查找 https://blog.youkuaiyun.com/liuchuo/article/details/825608632、建树,并查...原创 2018-11-26 16:01:37 · 505 阅读 · 1 评论 -
1145 Hashing - Average Search Time (25 分)
1、题面:https://pintia.cn/problem-sets/994805342720868352/problems/9948053432367677442、题意:S,n,m,给定表长,n个数插入,m个数查询s要转为大于它的最小素数3、正解:模拟,需要知道概念4、错误:查询的时候遇到==0也要break,==0说明插入时候没有遇到过,之后的就不要查了5...原创 2018-11-26 16:04:59 · 348 阅读 · 0 评论 -
1138 Postorder Traversal (25 分)
1、题面:https://pintia.cn/problem-sets/994805342720868352/problems/9948053450780672002、题意:给出数的前序、中序求后序输出的第一个值3、正解: 4、错误:没考虑到纯右子树的情况5、思维:这应该是最简洁的思路了,骄傲(‾◡◝)一开始发现,只要找到pre[0]在第i个,然后直接输...原创 2018-11-26 16:09:10 · 590 阅读 · 3 评论 -
1130 Infix Expression (25 分)
1130 Infix Expression (25 分)Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Sp...原创 2018-11-28 19:31:11 · 221 阅读 · 0 评论 -
1127 ZigZagging on a Tree (30 分)
题目地址:https://pintia.cn/problem-sets/994805342720868352/problems/994805349394006016题意:给出树的中序后序,要求以蛇皮走位(Z字形)输出层序解法:总体思路很简单.建树,然后找到正常的层序,遍历的时候按奇偶左右遍历坑点:1.题目N<30,开始还在想为什么值这么小,用数组交了一发,发现有段错误.感觉应该会有全...原创 2019-09-04 15:58:31 · 738 阅读 · 0 评论 -
1119. Pre- and Post-order Traversals (30)
友情提示:这题非常值得自己思考独立做出来,请反复确认后再往下拉1119. Pre- and Post-order Traversals (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Special作者CHEN, Yu原创 2018-01-03 18:48:55 · 175 阅读 · 0 评论 -
1122. Hamiltonian Cycle (25)
1122. Hamiltonian Cycle (25)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe "Hamilton cycle problem" is to find原创 2017-12-26 16:12:32 · 240 阅读 · 0 评论 -
1118. Birds in Forest (25)
1118. Birds in Forest (25)时间限制150 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSome scientists took pictures of thousands原创 2017-12-31 14:32:22 · 132 阅读 · 0 评论 -
1134. Vertex Cover (25)
1134. Vertex Cover (25)时间限制600 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA vertex cover of a graph is a set of vertice原创 2017-11-11 15:46:46 · 211 阅读 · 0 评论 -
1130. Infix Expression (25)
1130. Infix Expression (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a syntax tree (binary), you are sup原创 2017-11-18 17:39:46 · 238 阅读 · 0 评论 -
1128. N Queens Puzzle (20)
1128. N Queens Puzzle (20)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe "eight queens puzzle" is the problem o原创 2017-11-15 17:45:57 · 219 阅读 · 0 评论 -
1129. Recommendation System (25)
1129. Recommendation System (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueRecommendation system predicts the p原创 2017-11-16 12:15:27 · 306 阅读 · 0 评论 -
1126. Eulerian Path (25)
1126. Eulerian Path (25)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIn graph theory, an Eulerian path is a path原创 2017-12-20 20:19:27 · 191 阅读 · 0 评论 -
1124. Raffle for Weibo Followers (20)
1124. Raffle for Weibo Followers (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueJohn got a full mark on PAT. He原创 2017-12-04 14:51:40 · 156 阅读 · 0 评论 -
1125. Chain the Ropes (25)
1125. Chain the Ropes (25)时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven some segments of rope, you are suppo原创 2017-12-05 19:11:53 · 161 阅读 · 0 评论 -
1127. ZigZagging on a Tree (30)
1127. ZigZagging on a Tree (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose that all the keys in a binary原创 2017-12-22 15:07:08 · 339 阅读 · 0 评论 -
1121. Damn Single (25)
1121. Damn Single (25)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, Yue"Damn Single (单身狗)" is the Chinese nickname fo原创 2017-12-25 18:19:59 · 203 阅读 · 0 评论 -
1133. Splitting A Linked List (25)
1133. Splitting A Linked List (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a singly linked list, you ar原创 2017-11-08 19:29:44 · 468 阅读 · 1 评论