
PAT
任老爸张
无他,唯手熟尔
展开
-
2020.12.5 冬季PAT甲级考试 总结
最近都没有好好写博客,因为一方面冬天心情总是很低沉,另一方面到考试周了,又忙于计网 等等的大作业和外加上PAT考试我一直在复习之前写的代码,也就没有管理博客今天刚考完PAT不到30分钟,就做到电脑旁,写下总结先说题目,第一题 斐波那契数列的运用与跳出循环这道题还是很简单就有思路的,但是我写的很久也没有bug free,第一我当时着急,想着直接循环到上限就跳出循环,不去考虑跳出条件,我感觉应该是可以的,但当时遇到了bug,就觉得可能是这个的原因,换了写法,关于 大于目标数的时候怎么跳出..原创 2020-12-05 17:09:43 · 3352 阅读 · 7 评论 -
PAT: 城市间紧急救援(dijkstra)
7-25 城市间紧急救援 (300分)作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。输入格式:输入第一行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市的编号为0 ~ (N−1);M是快速道路的条数;S是出发地的城市编号;D是目原创 2020-10-20 21:10:11 · 292 阅读 · 0 评论 -
PAT: 倒数第N个字符串
给定一个完全由小写英文字母组成的字符串等差递增序列,该序列中的每个字符串的长度固定为 L,从 L 个 a 开始,以 1 为步长递增。例如当 L 为 3 时,序列为 { aaa, aab, aac, …, aaz, aba, abb, …, abz, …, zzz }。这个序列的倒数第27个字符串就是 zyz。对于任意给定的 L,本题要求你给出对应序列倒数第 N 个字符串。输入格式:输入在一行中给出两个正整数 L(2 ≤ L ≤ 6)和 N(≤105 )。输出格式:在一行中输出对应序列倒数第原创 2020-10-17 16:52:46 · 164 阅读 · 0 评论 -
PAT:1007 Maximum Subsequence Sum (25分)
Given a sequence of K integers { N1 , N2 , …, NK }. A continuous subsequence is defined to be { Ni , Ni+1 , …, Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elemen原创 2020-10-09 18:49:26 · 76 阅读 · 0 评论 -
PAT:1004 Counting Leaves (30分)(dfs遍历)
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing 0<N<100, the number of nodes原创 2020-10-09 18:30:44 · 167 阅读 · 0 评论 -
PAT:1003 Emergency (25分)(dijkstra)
1003Emergency(25分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pai..原创 2020-10-03 13:25:58 · 134 阅读 · 0 评论 -
PAT:1001 A+B Format (20分)
Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input file contains one test case. Each case contains a pair of i原创 2020-10-03 11:31:45 · 1019 阅读 · 0 评论 -
7.25号线上PAT考试总结
这次考试虽然是线上考,但是监考力度还是很严格的,想要作弊是不可能的这次考试题目并不难,难点题目更加的实际了,是解决实际问题,不会直接给出很直接的问题,理解题目是一点还有就是对于英语水平,万万没想当我会死在英语上,只把1 3做出来了,4也没认真看,一直在想第2题,无奈实在搞不懂题目的意思只能下次再战了。...原创 2020-07-27 09:11:07 · 1041 阅读 · 1 评论 -
PAT:1019 General Palindromic Number (20分)(进制转换)
A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers.Although palindromic numbers are most often considere.原创 2020-06-12 15:50:04 · 136 阅读 · 0 评论 -
PAT:1013 Battle Over Cities (25分)(DFS)
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of the c原创 2020-06-10 17:08:38 · 111 阅读 · 0 评论 -
PAT:1012 The Best Rank (25分)(自定义排序+排序变量)
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), andE- English. At the mean time, we encourage students by emphasi...原创 2020-06-10 16:45:57 · 150 阅读 · 0 评论 -
PAT:1010 Radix (25分)(逻辑)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integersN1andN2, your task is to find the radix of ...原创 2020-06-10 12:36:37 · 130 阅读 · 0 评论 -
PAT:1008 Elevator (20分)
The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to..原创 2020-06-09 09:39:36 · 106 阅读 · 0 评论 -
PAT:1006 Sign In and Sign Out (25分)
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原创 2020-06-08 15:36:37 · 122 阅读 · 0 评论 -
PAT:1004 Counting Leaves (30分)(DFS)
1004 Counting Leaves (30分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing 0<N&原创 2020-06-08 15:24:57 · 110 阅读 · 0 评论 -
PAT:1005 Spell It Right (20分)(string转换)
1005 Spell It Right (20分)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 c原创 2020-06-08 15:22:06 · 95 阅读 · 0 评论 -
PAT:1003 Emergency (25分)(dijkstra+维护数组)
1003 Emergency (25分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair原创 2020-06-08 10:44:48 · 137 阅读 · 0 评论 -
PAT:1002 A+B for Polynomials (25分)(数组)
1002 A+B for Polynomials (25分)This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:K N原创 2020-06-07 18:57:39 · 149 阅读 · 0 评论 -
PAT 1001 A+B Format (20分)(转化字符串)第三次重刷PAT甲级题
7月底就要考试了,四月份就立下雄心壮志要刷上甲级题5遍,如今到现在也才准备刚开始第三遍,丢人呐,最近也在刷力扣,那么就两个一起刷吧,希望七月底能有一个好成绩不过现在PAT在线上考试了,不知道这次的含金量会降低不,1001 A+B Format (20分)Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (un原创 2020-06-07 18:54:35 · 141 阅读 · 0 评论