PAT日志
doublefloatint
这个作者很懒,什么都没留下…
展开
-
1001 A+B Format (20 分)
AC练习1001 A+B Format (20 分)题目链接:1001 A+B Format前几天准备开始敲代码练习,找了最后一套题做,做了一个简单的一道难的,1153还是做不出来……超时+不知道错哪。虽然通过这两道题回忆起了C++的语法,但是还是决定从简单的开始,不然敲得我脑壳疼肩膀疼。那么就从1001开始吧,哈哈哈,一看就是以前得出题风格,很简单,但是还有几个我很容易出错的点。给别人提...原创 2019-10-16 19:43:22 · 218 阅读 · 0 评论 -
PAT日志 1111
顽强的小白1111 Online Map (30 分)Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the ...原创 2019-03-03 13:54:44 · 157 阅读 · 0 评论 -
PAT日志 1154
顽强的小白1154 Vertex Coloring (25 分)A proper vertex coloring is a labeling of the graph’s vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at m...原创 2019-03-05 16:41:52 · 127 阅读 · 0 评论 -
PAT日志 1080
顽强的小白1080 Graduate Admission (30 分)It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could writ...原创 2019-02-26 12:35:25 · 208 阅读 · 0 评论 -
PAT日志 1152
顽强的小白1152 Google Recruitment (20 分)In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a U...原创 2019-03-05 14:03:16 · 137 阅读 · 0 评论 -
PAT日志 1028
顽强的小白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...原创 2019-02-20 15:47:21 · 105 阅读 · 0 评论 -
PAT日志 1013
顽强的小白1013 Battle Over Cities (25 分)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 close...原创 2019-03-01 18:16:08 · 83 阅读 · 0 评论 -
PAT日志 1025
顽强的小白1025 PAT Ranking (25 分)Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in sever...原创 2019-02-20 15:28:04 · 87 阅读 · 0 评论 -
PAT日志 1016
顽强的小白1016 Phone Bills (25 分)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 da...原创 2019-02-20 11:25:44 · 142 阅读 · 0 评论 -
PAT日志 1053
顽强的小白1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the wei...原创 2019-03-01 10:01:09 · 151 阅读 · 0 评论 -
PAT日志 1083
顽强的小白1083 List Grades (25 分)Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those studen...原创 2019-02-24 17:37:19 · 79 阅读 · 0 评论 -
PAT日志 1095
顽强的小白1095 Cars on Campus (30 分)Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with a...原创 2019-02-26 15:09:57 · 178 阅读 · 0 评论 -
PAT日志 1108
顽强的小白1108 Finding Average (20 分)The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not...原创 2019-03-02 13:41:42 · 194 阅读 · 0 评论 -
PAT日志 1147 Heaps
顽强的小白1147 Heaps (30 分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either gre...原创 2019-03-14 23:54:02 · 219 阅读 · 0 评论 -
PAT日志 1146
顽强的小白1146 Topological Order (25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are...原创 2019-03-14 21:29:55 · 209 阅读 · 0 评论 -
PAT日志 1145
顽强的小白1145 Hashing - Average Search Time (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integ...原创 2019-03-14 21:06:18 · 235 阅读 · 0 评论 -
PAT日志 1144
顽强的小白1144 The Missing Number (20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case...原创 2019-03-14 17:19:11 · 132 阅读 · 0 评论 -
PAT日志 1155
顽强的小白1155 Heap Paths (30 分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is eithe...原创 2019-03-04 18:12:20 · 161 阅读 · 0 评论 -
PAT日志 1098
顽强的小白1098 Insertion or Heap Sort (25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort ...原创 2019-03-04 13:46:44 · 129 阅读 · 0 评论 -
PAT日志 1136
顽强的小白1136 A Delayed Palindrome (20 分)Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0≤ai<10 for all i and ak>0. Then N is palin...原创 2019-03-03 16:57:53 · 145 阅读 · 0 评论 -
PAT日志 1103
顽强的小白1103 Integer Factorization (30 分)The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the...原创 2019-02-27 10:58:06 · 183 阅读 · 0 评论 -
PAT日志 1075
顽强的小白1075 PAT Judge (25 分)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.Input Specif...原创 2019-02-24 17:18:46 · 134 阅读 · 0 评论 -
PAT日志 1079
顽强的小白1079 Total Sales of Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.St...原创 2019-02-28 14:30:41 · 154 阅读 · 0 评论 -
PAT日志 1036
顽强的小白1036 Boys vs Girls (25 分)is 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.Specification:ach i...原创 2019-02-15 14:45:06 · 128 阅读 · 0 评论 -
PAT日志 1006
顽强的小白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 t...原创 2019-02-15 14:13:21 · 196 阅读 · 0 评论 -
PAT日志 1011
顽强的小白1011 World Cup Betting (20 分)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...原创 2019-02-15 13:42:06 · 257 阅读 · 0 评论 -
PAT日志 1009
顽强的小白1009 Product of 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...原创 2019-02-15 13:04:14 · 164 阅读 · 0 评论 -
PAT日志 1046
顽强的小白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 ...原创 2019-01-31 19:01:24 · 216 阅读 · 0 评论 -
PAT日志 1042
发布文章博文管理我的博客退出 Trash Temp PAT日志 1002 PAT日志 1001 PAT日志 1003 PAT日志 1042顽强的小白1042 Shuffling Machine (20 分)Shuffling is a procedure used to randomize a ...原创 2019-01-31 18:16:46 · 191 阅读 · 0 评论 -
PAT日志 1003
顽强的小白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 ...原创 2019-01-06 20:24:56 · 196 阅读 · 1 评论 -
PAT日志 1002
顽强的小白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...原创 2019-01-06 10:59:17 · 166 阅读 · 0 评论 -
PAT日志 1031
顽强的小白1031 Hello World for U (20 分)Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll ...原创 2019-02-15 15:24:08 · 116 阅读 · 0 评论 -
PAT日志 1019
顽强的小白1019 General Palindromic Number (20 分)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. Al...原创 2019-02-15 15:50:26 · 185 阅读 · 0 评论 -
PAT日志 1005
顽强的小白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 f...原创 2019-02-17 14:12:02 · 195 阅读 · 0 评论 -
PAT日志 1102
顽强的小白1102 Invert a Binary Tree (25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard...原创 2019-02-28 13:47:29 · 91 阅读 · 0 评论 -
PAT日志 1086
顽强的小白1086 Tree Traversals Again (25 分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys num...原创 2019-02-28 13:02:02 · 131 阅读 · 0 评论 -
PAT日志 1055
顽强的小白1055 The World’s Richest (25 分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this ...原创 2019-02-23 18:19:11 · 154 阅读 · 0 评论 -
PAT日志 1012
顽强的小白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...原创 2019-02-18 14:05:29 · 155 阅读 · 0 评论 -
PAT日志 1062
顽强的小白1062 Talent and Virtue (25 分)About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being...原创 2019-02-18 10:33:06 · 148 阅读 · 0 评论 -
PAT日志 1020
顽强的小白1020 Tree Traversals (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level o...原创 2019-02-27 16:50:07 · 156 阅读 · 0 评论