- 博客(19)
- 收藏
- 关注
原创 PAT甲级(Advanced Level) Practice 1018 Public Bike Management
最后,在另一个空格后,输出 Sp 条件调整为完美后,我们必须送回 PBMC 的自行车数量。我的方法是记录 dfs到的点(u)身边带着的车的数量 和 带出来的车的数量。到达新的点时,计算该点需要增加车的数量(可以是负数),如果是正数,则手上的车减少(不够就减则增加带出来的车数量);if(dist[i] == dist[j] + distance(i, j)), 则i在j的最短路路径上,并且i是j的前一个点。注意,如果该路径不是唯一的,则输出我们必须带回 PBMC 的自行车数量最少的路径。
2024-03-20 15:33:23
876
1
原创 PAT甲级(Advanced Level) Practice 1017 Queueing at Bank
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 in line behind the yellow line, until it is his/her turn to be served and there is a
2024-03-19 14:45:32
587
1
原创 PAT甲级(Advanced Level) Practice 1016 Phone Bills
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a customer starts connecting a long-distance call, the ti
2024-03-18 14:54:49
798
原创 PAT甲级(Advanced Level) Practice 1015 Reversible Primes
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime.Now given any two positive integers N (<105) and D (
2024-03-16 13:08:34
346
1
原创 PAT甲级(Advanced Level) Practice 1014 Waiting in Line
Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:Now given the processing time of each customer, you are supposed to
2024-03-16 12:32:25
756
1
原创 PAT甲级(Advanced Level) Practice 1012 The Best Rank
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: - C Programming Language, - Mathematics (Calculus or Linear Algrbra), and - English. At the mean time, we encourage students by emphasizin
2024-03-15 08:30:00
1088
1
原创 PAT甲级(Advanced Level) Practice 1011 World Cup Betting
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money
2024-03-15 08:00:00
1111
1
原创 PAT甲级(Advanced Level) Practice 1010 Radix
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is , if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integers N1 and N2, your task is to find the radix of one numbe
2024-03-14 18:12:52
737
原创 PAT甲级(Advanced Level) Practice 1006 Sign In and Sign Out
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you are supposed to find the ones who have unlocked and loc
2024-03-14 11:03:44
382
原创 PAT甲级(Advanced Level) Practice 1005 Spell It Right
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies one line which contains an N (≤).Output Spec
2024-03-14 10:56:44
391
原创 PAT甲级(Advanced Level) Practice 1004 Counting Leaves
10 1in a line.家族等级通常由一棵血统树来呈现。您的任务是统计那些没有子女的家庭成员。每个输入文件包含一个测试用例。每个案例以一行开始,其中包含 0
2024-03-14 10:46:35
856
原创 PAT甲级(Advanced Level) Practice 1003 Emergency
每个输入文件包含一个测试用例。每个测试用例的第一行包含 4 个正整数: N (≤ 500) - 城市数量(城市编号从 0 到 N-1),M - 道路数量,C1和C2 - 分别是您当前所在的城市和必须拯救的城市。接着是 M 行,每行描述一条道路,包含三个整数 C1, C2 和 L,它们分别是由一条道路连接的一对城市和该道路的长度。地图上标明了每个城市的救援队数量以及任何一对城市之间每条道路的长度。当其他城市向您发出紧急求救信号时,您的任务是带领您的队员以最快的速度赶赴现场,同时在途中召集尽可能多的救援人员。
2024-03-13 21:09:35
938
原创 PAT甲级(Advanced Level) Practice 1001 A+B Format
≤ a, b ≤计算 a+b 并以标准格式输出总和,即数字必须以三个为一组用逗号分隔(除非数字少于四位)。输入规范:每个输入文件包含一个测试用例。每个案例包含一对整数 a 和 b,其中≤ a, b ≤, 数字之间用空格隔开。输出规范:对于每个测试用例,应在一行中输出 a 和 b 的总和,和必须以标准格式书写。
2024-03-13 19:52:28
345
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人