School Team Contest 3 (Winter Computer School 2010/11)

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
45 School Team Contest 3 (Winter Computer School 2010/11) FINISHED False 18000 486673180 Nov. 13, 2010, 11 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1220 ) G Prime Problem PROGRAMMING number theory 2300

In Berland prime numbers are fashionable — the respectable citizens dwell only on the floors with numbers that are prime numbers. The numismatists value particularly high the coins with prime nominal values. All the prime days are announced holidays! Yet even this is not enough to make the Berland people happy. On the main street of the capital stand n houses, numbered from 1 to n . The government decided to paint every house a color so that the sum of the numbers of the houses painted every color is a prime number. However it turned out that not all the citizens approve of this decision — many of them protest because they don't want many colored houses on the capital's main street. That's why it is decided to use the minimal possible number of colors. The houses don't have to be painted consecutively, but every one of n houses should be painted some color. The one-colored houses should not stand consecutively, any way of painting is acceptable. There are no more than 5 hours left before the start of painting, help the government find the way when the sum of house numbers for every color is a prime number and the number of used colors is minimal. The single input line contains an integer n ( 2 ≤ n ≤ 6000 ) — the number of houses on the main streets of the capital. Print the sequence of n numbers, where the i -th number stands for the number of color for house number i . Number the colors consecutively starting from 1. Any painting order is allowed. If there are several solutions to that problem, print any of them. If there's no such way of painting print the single number -1 .

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
192694 tourist G Nov. 13, 2010, 12:37 p.m. OK Delphi TESTS 50 30 819200 2300
193279 igor.lifar sankear G Nov. 13, 2010, 1:14 p.m. OK Delphi TESTS 50 30 921600 2300
194552 allocator kate1543 Sender G Nov. 13, 2010, 3:05 p.m. OK Delphi TESTS 50 880 20992000 2300
194508 ZumZoom taras.klaskovsky iRomchig G Nov. 13, 2010, 3:01 p.m. OK FPC TESTS 50 550 36864000 2300
193982 Sereja G Nov. 13, 2010, 2:05 p.m. OK FPC TESTS 50 940 36966400 2300
194502 zpl1 chensqi plokzfadai G Nov. 13, 2010, 3 p.m. OK GNU C TESTS 50 50 25702400 2300
194884 Farzam HRM G Nov. 13, 2010, 3:42 p.m. OK GNU C++ TESTS 50 30 1331200 2300
194973 random_2 G Nov. 13, 2010, 3:50 p.m. OK GNU C++ TESTS 50 50 1331200 2300
194887 Farzam HRM G Nov. 13, 2010, 3:42 p.m. OK GNU C++ TESTS 50 50 1331200 2300
193864 ll931110 G Nov. 13, 2010, 1:54 p.m. OK GNU C++ TESTS 50 110 3584000 2300
193523 PavelKunyavskiy slavik Babanin_Ivan G Nov. 13, 2010, 1:30 p.m. OK GNU C++ TESTS 50 420 81920000 2300
193215 havaliza G Nov. 13, 2010, 1:09 p.m. OK GNU C++ TESTS 50 730 21401600 2300
192944 AlTimin JOZHEG fadeevs G Nov. 13, 2010, 12:50 p.m. OK GNU C++ TESTS 50 770 51507200 2300

remove filters

Back to search problems