随笔分类 -  PTA甲级

摘要:A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a progra 阅读全文
posted @ 2019-12-08 15:23 57one 阅读(227) 评论(0) 推荐(0)
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1 阅读全文
posted @ 2019-12-08 14:56 57one 阅读(356) 评论(0) 推荐(0)
摘要:A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open 阅读全文
posted @ 2019-12-08 10:39 57one 阅读(269) 评论(0) 推荐(0)
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test 阅读全文
posted @ 2019-12-01 23:10 57one 阅读(119) 评论(0) 推荐(0)
摘要: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, wher 阅读全文
posted @ 2019-12-01 21:37 57one 阅读(143) 评论(0) 推荐(0)
摘要:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run sim 阅读全文
posted @ 2019-12-01 20:52 57one 阅读(112) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-12-01 18:21 57one 阅读(146) 评论(0) 推荐(0)
摘要:1023 Have Fun with Numbers (20 分) Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication 阅读全文
posted @ 2019-11-26 18:12 57one 阅读(140) 评论(0) 推荐(0)
摘要:1022 Digital Library (30 分) A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, pub 阅读全文
posted @ 2019-11-26 16:52 57one 阅读(151) 评论(0) 推荐(0)
摘要:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the 阅读全文
posted @ 2019-11-25 20:50 57one 阅读(138) 评论(0) 推荐(0)
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou 阅读全文
posted @ 2019-11-25 17:17 57one 阅读(173) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-11-24 23:01 57one 阅读(126) 评论(0) 推荐(0)
摘要:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any s 阅读全文
posted @ 2019-11-24 16:19 57one 阅读(684) 评论(0) 推荐(0)
摘要: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 c 阅读全文
posted @ 2019-11-24 13:47 57one 阅读(257) 评论(0) 推荐(0)
摘要:A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, dependi 阅读全文
posted @ 2019-11-23 16:42 57one 阅读(144) 评论(0) 推荐(0)
摘要: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 re 阅读全文
posted @ 2019-11-23 14:55 57one 阅读(223) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-11-23 14:19 57one 阅读(523) 评论(0) 推荐(0)
摘要: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 c 阅读全文
posted @ 2019-11-23 13:23 57one 阅读(209) 评论(0) 推荐(0)
摘要:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mat 阅读全文
posted @ 2019-11-23 11:24 57one 阅读(143) 评论(0) 推荐(0)
摘要: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 ba 阅读全文
posted @ 2019-11-15 16:11 57one 阅读(116) 评论(0) 推荐(0)