
PAT甲级
柠檬ya
不要慌,不要慌,太阳下了有月光
展开
-
PAT----1049 Counting Ones (30分)
1049 Counting Ones (30分)The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being...原创 2019-12-09 15:48:04 · 141 阅读 · 0 评论 -
PAT甲级----1038 Recover the Smallest Number (30分)
1038 Recover the Smallest Number (30分)Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover ...原创 2019-12-09 10:30:28 · 162 阅读 · 0 评论 -
PAT甲级1017 Queueing at Bank (25 分)
1017 Queueing at Bank (25 分)Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait...原创 2019-11-21 17:15:21 · 164 阅读 · 0 评论 -
受欢迎的牛(强连通分量+压缩点)
受欢迎的牛(popular)Description原题来自:USACO 2003 Fall每一头牛的愿望就是变成一头最受欢迎的牛。现在有 N 头牛,给你 M 对整数 (A,B),表示牛 A 认为牛 B 受欢迎。这种关系是具有传递性的,如果 A 认为 B 受欢迎,B 认为 C 受欢迎,那么牛 A 也认为牛 C 受欢迎。你的任务是求出有多少头牛被除自己之外的所有牛认为是受欢迎的。Input第...原创 2019-10-30 21:46:42 · 240 阅读 · 0 评论 -
1030 Travel Plan (30 分)
1030 Travel Plan (30 分)A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to de...原创 2019-10-25 21:07:00 · 126 阅读 · 0 评论 -
PAT甲级1146 Topological Order (25 分)
1146 Topological Order (25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are suppo...原创 2019-10-09 10:44:05 · 881 阅读 · 0 评论