PAT
文章平均质量分 84
John Art
这个作者很懒,什么都没留下…
展开
-
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 · 879 阅读 · 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 · 590 阅读 · 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 · 800 阅读 · 0 评论 -
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 · 348 阅读 · 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 · 759 阅读 · 1 评论 -
PAT甲级(Advanced Level) Practice 1013 Battle Over Cities
100。原创 2024-03-15 19:25:55 · 915 阅读 · 2 评论 -
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 · 1089 阅读 · 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 · 1113 阅读 · 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 · 739 阅读 · 0 评论 -
PAT甲级(Advanced Level) Practice 1009 Product of Polynomials
and。原创 2024-03-14 17:55:08 · 410 阅读 · 0 评论 -
PAT甲级(Advanced Level) Practice 1008 Elevator
3 2 3 141。原创 2024-03-14 17:44:34 · 396 阅读 · 0 评论 -
PAT甲级(Advanced Level) Practice 1007 Maximum Subsequence Sum
10 1 4。原创 2024-03-14 15:56:41 · 911 阅读 · 0 评论 -
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 · 391 阅读 · 0 评论 -
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 · 405 阅读 · 0 评论 -
PAT甲级(Advanced Level) Practice 1004 Counting Leaves
10 1in a line.家族等级通常由一棵血统树来呈现。您的任务是统计那些没有子女的家庭成员。每个输入文件包含一个测试用例。每个案例以一行开始,其中包含 0原创 2024-03-14 10:46:35 · 859 阅读 · 0 评论 -
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 · 941 阅读 · 0 评论 -
PAT甲级(Advanced Level) Practice 1002 A+B for Polynomials
and。原创 2024-03-13 20:16:50 · 468 阅读 · 0 评论 -
PAT甲级(Advanced Level) Practice 1001 A+B Format
≤ a, b ≤计算 a+b 并以标准格式输出总和,即数字必须以三个为一组用逗号分隔(除非数字少于四位)。输入规范:每个输入文件包含一个测试用例。每个案例包含一对整数 a 和 b,其中≤ a, b ≤, 数字之间用空格隔开。输出规范:对于每个测试用例,应在一行中输出 a 和 b 的总和,和必须以标准格式书写。原创 2024-03-13 19:52:28 · 350 阅读 · 0 评论