
STL
_Gray
这个作者很懒,什么都没留下…
展开
-
1120 Friend Numbers (20 分)
Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are friend numbers since 1+2+3 = 5+1 = 6, and 6 is their ...原创 2019-01-18 01:07:58 · 101 阅读 · 0 评论 -
1059 Prime Factors (25 分)
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1k1×p2k2×⋯×pmkm. Input Specification: Each input file co...原创 2019-01-29 00:12:33 · 111 阅读 · 0 评论 -
1132 Cut Integer (20 分)
Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting...原创 2019-01-23 01:14:25 · 126 阅读 · 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...原创 2019-01-27 09:49:26 · 230 阅读 · 0 评论 -
1129 Recommendation System (25 分)
Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user's preference by the number of time...原创 2019-01-20 22:14:18 · 216 阅读 · 0 评论 -
1140 Look-and-say Sequence (20 分)
Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)st number is a kind of description of the nth n...原创 2019-01-25 04:41:46 · 312 阅读 · 0 评论 -
1137 Final Grading (25 分)
For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain no less than 200 points from...原创 2019-01-24 18:38:49 · 174 阅读 · 0 评论 -
1124 Raffle for Weibo Followers (20 分)
John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, and give...原创 2019-01-19 05:15:24 · 210 阅读 · 0 评论 -
1122 Hamiltonian Cycle (25 分)
The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle". In this problem, you are supposed to tell if a given cycle ...原创 2019-01-18 20:20:03 · 149 阅读 · 0 评论 -
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 palindromic if and only if ai=ak−i for...原创 2019-01-23 22:40:19 · 141 阅读 · 0 评论 -
1121 Damn Single (25 分)
"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input Specification: Each inpu...原创 2019-01-18 01:23:42 · 167 阅读 · 0 评论 -
1071 Speech Patterns (25 分)
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker...原创 2019-02-04 18:41:58 · 137 阅读 · 0 评论