PAT
文章平均质量分 77
《算法笔记》PAT平台编程题随笔记录
Layznana
这个作者很懒,什么都没留下…
展开
-
A1075 PAT Judge
问题描述 The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT. 输入格式 Each input file contains one test case. For each case, the first line contains 3 positi原创 2021-09-04 21:04:57 · 56 阅读 · 0 评论 -
A1016 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,原创 2021-09-04 10:28:00 · 79 阅读 · 0 评论 -
A1012 The Best Rank
问题描述 To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, we encourage students by em原创 2021-09-03 10:58:11 · 91 阅读 · 0 评论 -
B1015 德才论
问题描述 宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。” 现给出一批考生的德才分数,请根据司马光的理论给出录取排名。 输入格式 输入第一行给出 3 个正整数,分别为:N( ≤ 105 ),即考生总数;L( ≥ 60 ),为录取最低分数线,即德分和才分均不低于 L 的考生才有资格被考虑录取;H(< 100),为优先录取线——德分和才分均不低于此线的被定义为“才原创 2021-09-02 09:49:21 · 117 阅读 · 0 评论 -
A1082 Read Number in Chinese
问题描述 Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu. Note: zer原创 2021-08-25 22:44:12 · 71 阅读 · 0 评论 -
A1077 Kuchiguse
问题描述 The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exaggerated artistically i原创 2021-08-24 19:44:13 · 60 阅读 · 0 评论 -
A1035 Password
问题描述 To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase).原创 2021-08-20 21:40:33 · 86 阅读 · 0 评论 -
B1024 科学计数法
问题描述 科学计数法是科学家用来表示很大或很小的数字的一种方便的方法,其满足正则表达式 [±][1-9].[0-9]+E[±][0-9]+,即数字的整数部分只有 1 位,小数部分至少有 1 位,该数字及其指数部分的正负号即使对正数也必定明确给出。 现以科学计数法的格式给出实数 A,请编写程序按普通数字表示法输出 A,并保证所有有效位都被保留。 输入格式 每个输入包含 1 个测试用例,即一个以科学计数法表示的实数 A。该数字的存储长度不超过 9999 字节,且其指数的绝对值不超过 9999。 输出格式 对每个原创 2021-08-20 21:19:43 · 81 阅读 · 0 评论 -
B1014 福尔摩斯的约会
问题描述 大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm。大侦探很快就明白了,字条上奇怪的乱码实际上就是约会的时间星期四 14:04,因为前面两字符串中第 1 对相同的大写英文字母(大小写有区分)是第 4 个字母 D,代表星期四;第 2 对相同的字符是 E ,那是第 5 个英文字母,代表一天里的第 14 个钟头(于是一天的 0 点到 23 点由数字 0 到 9、以及大写字原创 2021-08-19 21:05:05 · 89 阅读 · 0 评论 -
Day of Week
问题描述 We now use the Gregorian style of dating in Russia. The leap years are years with number divisible by 4 but not divisible by 100, or divisible by 400. For example, years 2004, 2180 and 2400 are leap. Years 2004, 2181 and 2300 are not leap. Your task i原创 2021-08-15 17:44:38 · 84 阅读 · 0 评论 -
A+B for Polynomials
问题描述 Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: 输入样例 Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial原创 2021-08-11 15:44:25 · 141 阅读 · 0 评论 -
A+B and C(64bit)
问题描述 Given three integers A, B and C in [263,263], you are supposed to tell whether A+B>C. 输入格式 The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each consists of a single line containing three integ原创 2021-08-10 17:00:01 · 74 阅读 · 0 评论 -
数组元素循环右移
问题描述 一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由(A0,A1,A2,…,AN-1)变换为(AN-M,…,AN-1,A0,A1,…,AN-M-1)(最后M个数循环移至最前面的M个位置)。如果需要考虑程序移动数据的次数尽量少,要如何设计移动的方法? 输入格式 每个输入包含一个测试用例,第1行输入N(1≤N≤100)和M(≥0);第2行输入N个整数,之间用空格分隔。 输出格式 在一行中输出循环右移M位以后的整数序列,之间用空格分原创 2021-08-09 11:06:02 · 823 阅读 · 0 评论 -
一元多项式求导
问题描述 设计函数求一元多项式的导数。(xn(n为整数)的一阶导数为nxn-1) 输入格式 以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过 1000 的整数)。数字间以空格分隔。 输出格式 以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多项式”的指数和系数都是 0,但是表示为 0 0. 输入样例 3 4 -5 2 6 1 -2 0 (结尾无空行) 输出样例 12 3 -10 1 6 0 (结尾无空行) C语言代码 #include<st原创 2021-08-10 20:42:48 · 803 阅读 · 0 评论 -
Colors in Mars
问题描述 People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The原创 2021-08-17 21:03:26 · 49 阅读 · 0 评论 -
Boys VS Girls
问题描述 This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. 输入格式 Each input file contains one test case. Each case contains a positive integer N, followed by N line原创 2021-08-12 21:11:52 · 148 阅读 · 0 评论 -
Shortest Distance
问题描述 The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits. 输入原创 2021-08-09 22:12:34 · 109 阅读 · 0 评论 -
成绩排名问题
问题描述 读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。 输入格式 每个测试输入包含 1 个测试用例,格式为 第 1 行:正整数 n 第 2 行:第 1 个学生的姓名 学号 成绩 第 3 行:第 2 个学生的姓名 学号 成绩 … … … 第 n+1 行:第 n 个学生的姓名 学号 成绩 其中姓名和学号均为不超过 10 个字符的字符串,成绩为 0 到 100 之间的一个整数,这里保证在一组测试用例中没有两个学生的成绩是相同的。 输出格式 对每个测试用例输出 2 行原创 2021-08-11 20:18:06 · 223 阅读 · 0 评论