Codeforces Beta Round 39

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
40 Codeforces Beta Round 39 FINISHED False 7200 487432823 Nov. 5, 2010, 4 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 169 ) D Interesting Sequence PROGRAMMING math 2600

Berland scientists noticed long ago that the world around them depends on Berland population. Due to persistent research in this area the scientists managed to find out that the Berland chronology starts from the moment when the first two people came to that land (it is considered to have happened in the first year). After one Berland year after the start of the chronology the population had already equaled 13 people (the second year). However, tracing the population number during the following years was an ultimately difficult task, still it was found out that if d i — the number of people in Berland in the year of i , then either d i = 12 d i - 2 , or d i = 13 d i - 1 - 12 d i - 2 . Of course no one knows how many people are living in Berland at the moment, but now we can tell if there could possibly be a year in which the country population equaled A . That's what we ask you to determine. Also, if possible, you have to find out in which years it could be (from the beginning of Berland chronology). Let's suppose that it could be in the years of a 1 , a 2 , ..., a k . Then you have to define how many residents could be in the country during those years apart from the A variant. Look at the examples for further explanation. The first line contains integer A ( 1 ≤ A < 10 300 ). It is guaranteed that the number doesn't contain leading zeros. On the first output line print YES , if there could be a year in which the total population of the country equaled A , otherwise print NO . If the answer is YES , then you also have to print number k — the number of years in which the population could equal A . On the next line you have to output precisely k space-separated numbers — a 1 , a 2 , ..., a k . Those numbers have to be output in the increasing order. On the next line you should output number p — how many variants of the number of people could be in the years of a 1 , a 2 , ..., a k , apart from the A variant. On each of the next p lines you have to print one

Tutorials

Codeforces Beta Round #39 (Разбор задач)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
179344 tourist D Nov. 5, 2010, 5:09 p.m. OK Delphi TESTS 74 1080 55910400 2600
179538 vepifanov D Nov. 5, 2010, 5:23 p.m. OK GNU C++ TESTS 74 160 151244800 2600
179456 ivan.popelyshev D Nov. 5, 2010, 5:18 p.m. OK Java 6 TESTS 74 110 43520000 2600
179064 Petr D Nov. 5, 2010, 4:55 p.m. OK Java 6 TESTS 74 140 43417600 2600
179930 dzhulgakov D Nov. 5, 2010, 5:48 p.m. OK Java 6 TESTS 74 190 43417600 2600
179445 winger D Nov. 5, 2010, 5:17 p.m. OK Java 6 TESTS 74 190 43417600 2600
179935 SpookyCookie D Nov. 5, 2010, 5:48 p.m. OK Java 6 TESTS 74 770 74649600 2600
179893 Anton_Lunyov D Nov. 5, 2010, 5:45 p.m. OK MS C++ TESTS 74 190 2048000 2600

remove filters

Back to search problems