PAT
hg_zhh0427
一个普通人
展开
-
1001. A+B Format (20)
A+B Format (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Calculate a + b and output the sum in standard format – that is, the digits must be separated into groups o原创 2017-03-23 19:11:44 · 239 阅读 · 0 评论 -
1007. Maximum Subsequence Sum (25)
Maximum Subsequence Sum (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be {原创 2017-06-15 21:54:42 · 203 阅读 · 0 评论 -
1012. The Best Rank (25)
时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Pr原创 2017-06-29 11:15:45 · 165 阅读 · 0 评论 -
1008. Elevator (20)
时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers deno原创 2017-06-21 09:55:25 · 156 阅读 · 0 评论 -
1015. Reversible Primes (20)
Reversible Primes (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A reversible prime in any number system is a prime whose “reverse” in that number system is also a原创 2017-06-30 20:35:28 · 215 阅读 · 0 评论 -
1005. Spell It Right (20)
Spell It Right (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output ever原创 2017-06-11 11:48:10 · 150 阅读 · 0 评论 -
1009. Product of Polynomials (25)
Product of Polynomials (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:E原创 2017-06-22 22:32:06 · 146 阅读 · 0 评论 -
1011. World Cup Betting (20)
World Cup Betting (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite原创 2017-06-22 23:28:28 · 184 阅读 · 0 评论 -
1006. Sign In and Sign Out (25)
Sign In and Sign Out (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue At the beginning of every day, the first person who signs in the computer room will unlock the do原创 2017-06-12 17:44:33 · 223 阅读 · 0 评论 -
1019. General Palindromic Number (20)
General Palindromic Number (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A number that will be the same when it is written forwards or backwards is known as a Pali原创 2017-07-13 19:49:43 · 151 阅读 · 0 评论 -
1022. Digital Library (30)
时间限制 1000 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, pub原创 2017-07-14 22:01:26 · 197 阅读 · 0 评论 -
1023. Have Fun with Numbers (20)
Have Fun with Numbers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9原创 2017-07-16 18:42:09 · 155 阅读 · 0 评论 -
1036. Boys vs Girls (25)
1036. Boys vs Girls (25) 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. Input Speci原创 2017-07-20 10:14:27 · 237 阅读 · 0 评论 -
1037. Magic Coupon (25)
1037. Magic Coupon (25) The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times t原创 2017-07-20 10:58:55 · 247 阅读 · 0 评论 -
1027. Colors in Mars (20)
Colors in Mars (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue People in Mars represent the colors in their computers in a similar way as the Earth people. That is,原创 2017-07-17 10:11:58 · 164 阅读 · 0 评论 -
1028. List Sorting (25)
List Sorting (25)Excel can sort records according to any column. Now you are supposed to imitate this function.InputEach input file contains one test case. For each case, the first line contains two i原创 2017-07-17 11:08:16 · 143 阅读 · 0 评论 -
1085. Perfect Sequence (25)
判题程序 Standard <div class='key'> 作者</div><div class='value'> CAO, Peng<br></div> Given a sequence of positive integers and another positive integer p. The sequence原创 2017-07-29 21:09:40 · 154 阅读 · 0 评论 -
1038. Recover the Smallest Number (30)
Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given {32, 321, 3214, 0229, 87}, we can recover many numbers such like 32-321-3214-0229-87原创 2017-07-20 21:54:42 · 229 阅读 · 0 评论 -
1039. Course List for Student (25)
Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes f原创 2017-07-20 23:19:14 · 242 阅读 · 0 评论 -
1040. Longest Symmetric String (25)
Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given “Is PAT&TAP symmetric?”, the longest symmetric sub-string is “s PAT&TAP s”, hence you must原创 2017-07-20 23:42:12 · 225 阅读 · 0 评论 -
1041. Be Unique (20)
Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1, 104]. The first one who bets on原创 2017-07-21 09:33:57 · 322 阅读 · 0 评论 -
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 gambler原创 2017-07-21 10:34:47 · 265 阅读 · 0 评论 -
1029. Median (25)
Median (25)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 12, and the median of S2={9, 10, 15, 16, 17}原创 2017-07-18 09:43:18 · 148 阅读 · 0 评论 -
1031. Hello World for U (20)
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 d e l l r lowo That is, the原创 2017-07-18 11:58:25 · 188 阅读 · 0 评论 -
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原创 2017-07-21 21:51:08 · 202 阅读 · 0 评论 -
1045. Favorite Color Stripe (30)
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts原创 2017-07-21 21:07:26 · 273 阅读 · 0 评论 -
1047. Student List for Course (25)
Zhejiang University has 40000 students and provides 2500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Spec原创 2017-07-21 22:46:56 · 206 阅读 · 0 评论 -
1048. Find Coins (25)
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However原创 2017-07-22 10:08:41 · 192 阅读 · 0 评论 -
1032. Sharing (25)
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example原创 2017-07-18 22:31:00 · 232 阅读 · 0 评论 -
1050. String Subtraction (20)
Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1 - S2 for any given strings. However,原创 2017-07-22 23:49:43 · 146 阅读 · 0 评论 -
1051. Pop Sequence (25)
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of th原创 2017-07-23 09:31:51 · 226 阅读 · 0 评论 -
1092. To Buy or Not to Buy (20)
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only se原创 2017-07-31 21:05:25 · 163 阅读 · 0 评论 -
1093. Count PAT's (25)
The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now g原创 2017-07-31 21:14:32 · 249 阅读 · 0 评论 -
1054. The Dominant Color (20)
Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the d原创 2017-07-23 14:40:15 · 260 阅读 · 0 评论 -
1117. Eddington Number(25)
British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an “Eddington number”, E – that is, the maximum integer E such that it is for E d原创 2017-08-07 20:28:41 · 149 阅读 · 0 评论 -
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 so fuck off.Now it’s your turn to prove原创 2017-08-02 22:38:55 · 240 阅读 · 0 评论 -
1101. Quick Sort (25)快排
There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its le原创 2017-08-02 21:43:54 · 247 阅读 · 0 评论 -
1099. Build A Binary Search Tree (30)建立二叉搜索树
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node’s key.The right subtre原创 2017-08-01 22:05:53 · 242 阅读 · 0 评论 -
1097. Deduplication on a Linked List (25)
Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value or a原创 2017-08-01 20:22:48 · 263 阅读 · 0 评论 -
1094. The Largest Generation (25)广搜
A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Input S原创 2017-07-31 22:25:42 · 257 阅读 · 0 评论