PAT
海底鱿鱼
这个作者很懒,什么都没留下…
展开
-
PAT A1104测试点2错误修正方法
1104 Sum of Number Segments (20分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4)原创 2020-10-14 11:20:06 · 460 阅读 · 0 评论 -
使用sort进行排序(1028 List Sorting (25分))
题目描述Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two integers N (≤105) and C, where N is the number of r原创 2020-09-22 19:40:33 · 154 阅读 · 0 评论 -
VS2017无法直接使用scanf()函数
题目描述给定区间` [−231 ,231 ] 内的 3 个整数 A、B 和 C,请判断 A+B 是否大于 C。输入格式:输入第 1 行给出正整数 T (≤10),是测试用例的个数。随后给出 T 组测试用例,每组占一行,顺序给出 A、B 和 C。整数间以空格分隔。输出格式:对每组测试用例,在一行中输出 Case #X: true 如果 A+B>C,否则输出 Case #X: false,其中 X 是测试用例的编号(从 1 开始)。输入样例:41 2 32 3 42147原创 2020-09-16 12:52:16 · 386 阅读 · 0 评论 -
1065 A+B and C (64bit) (20分)
题目描述Given three integers A, B and C in [−263 ,263], you are supposed to tell whether A+B>C.Input Specification: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 co原创 2020-09-09 12:58:46 · 91 阅读 · 0 评论 -
一元多项式求导
题目描述设计函数求一元多项式的导数。输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过 1000 的整数)。数字间以空格分隔。输出格式:以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多项式”的指数和系数都是 0,但是表示为 0 0。思路开一个数组a[],存放对应指数的系数,如a[e]即表示指数为e的项的系数。然后使用while…EOF的格式读入系数和指数。可划分为“输入”、“运算”和“输出”三步。注意点1、求导时,原创 2020-09-09 12:20:28 · 2826 阅读 · 1 评论 -
1046 Shortest Distance (20分)
1046 Shortest Distance (20分)题目描述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.Input Specification:Each input file contains one test case. For e原创 2020-09-08 16:24:08 · 111 阅读 · 0 评论 -
1042 Shuffling Machine (20分)
@[TOC](1042 Shuffling Machine (20分))题目描述Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid “inside jobs” where employees collaborate with gamblers by performin原创 2020-09-08 10:47:55 · 122 阅读 · 0 评论