Codeforces Round 518 (Div. 1) [Thanks, Mail.Ru!]

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
1067 Codeforces Round 518 (Div. 1) [Thanks, Mail.Ru!] FINISHED False 7200 191424299 Oct. 24, 2018, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 657 ) C Knights PROGRAMMING constructive algorithms 2800

B"Ivan places knights on infinite chessboard. Initially there are n knights. If there is free cell which is under attack of at least 4 knights then he places new knight in this cell. Ivan repeats this until there are no such free cells. One can prove that this process is finite. One can also prove that position in the end does not depend on the order in which new knights are placed. Ivan asked you to find initial placement of exactly n knights such that in the end there will be at least lfloor frac{n^{2}}{10} rfloor knights. The only line of input contains one integer n ( 1 <= n <= 10^{3} ) -- number of knights in the initial placement. Print n lines. Each line should contain 2 numbers x_{i} and y_{i} ( -10^{9} <= x_{i}, , , y_{i} <= 10^{9} ) -- coordinates of i -th knight. For all i ne j , (x_{i}, , , y_{i}) ne (x_{j}, , , y_{j}) should hold. In other words, all knights should be in different cells. It is guaranteed that the solution exists. Let's look at second example: Green zeroes are initial knights. Cell (3, , , 3) is under attack of 4 knights in cells (1, , , 2) , (2, , , 1) , (4, , , 1) and (5, , , 2) , therefore Ivan will place a knight in this cell. Cell (4, , , 5) is initially attacked by only 3 knights in cells (2, , , 6) , (5, , , 7) and (6, , , 6) . But new knight in cell (3, , , 3) also attacks cell (4, , , 5) , now it is attacked by 4 knights and Ivan will place another knight in this cell. There are no more free cells which are attacked by 4 or more knights, so the process stops. There are 9 knights in the end, which is not less than lfloor frac{7^{2}}{10} rfloor = 4 . "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57868116 lopare C July 27, 2019, 10:57 p.m. OK GNU C++11 TESTS 45 30 0 2800
46295595 fwat C Nov. 28, 2018, 2 a.m. OK GNU C++11 TESTS 45 30 0 2800
45584525 dogET C Nov. 12, 2018, 7:30 a.m. OK GNU C++11 TESTS 45 30 0 2800
69701533 WZYYN C Jan. 29, 2020, 12:58 a.m. OK GNU C++11 TESTS 45 31 0 2800
69077796 geneanlyz C Jan. 19, 2020, 4:39 a.m. OK GNU C++11 TESTS 45 31 0 2800
63651062 Nazrin C Oct. 28, 2019, 11:24 a.m. OK GNU C++11 TESTS 45 31 0 2800
58250146 DP_liver C Aug. 4, 2019, 7:27 a.m. OK GNU C++11 TESTS 45 31 0 2800
54507386 WOSHIGEPACHONG2 C May 23, 2019, 5:01 a.m. OK GNU C++11 TESTS 45 31 0 2800
54217492 SoiMae C May 15, 2019, 11:37 p.m. OK GNU C++11 TESTS 45 31 0 2800
54217490 SoiMae C May 15, 2019, 11:37 p.m. OK GNU C++11 TESTS 45 31 0 2800
45161652 luogu_bot2 C Nov. 1, 2018, 9:24 a.m. OK GNU C++14 TESTS 45 15 0 2800
44901149 BohdanPastuschak C Oct. 26, 2018, 9:09 a.m. OK GNU C++14 TESTS 45 15 0 2800
44834355 rareone0602 C Oct. 25, 2018, 10:05 a.m. OK GNU C++14 TESTS 45 15 0 2800
44819508 neal C Oct. 25, 2018, 12:41 a.m. OK GNU C++14 TESTS 45 15 0 2800
50714311 CN_zwang2002 C March 3, 2019, 7:28 a.m. OK GNU C++14 TESTS 45 30 0 2800
48576981 brecurse C Jan. 19, 2019, 2:34 p.m. OK GNU C++14 TESTS 45 30 0 2800
47843415 TLE C Jan. 2, 2019, 1:24 p.m. OK GNU C++14 TESTS 45 30 0 2800
45567784 jslijin C Nov. 11, 2018, 3:39 p.m. OK GNU C++14 TESTS 45 30 0 2800
45121492 yswness C Oct. 31, 2018, 4:59 a.m. OK GNU C++14 TESTS 45 30 0 2800
45077829 FduLiuXufei C Oct. 30, 2018, 3:05 a.m. OK GNU C++14 TESTS 45 30 0 2800
44830269 dreamoon_love_AA C Oct. 25, 2018, 8:08 a.m. OK GNU C++17 TESTS 45 15 204800 2800
44827192 MaxZubec C Oct. 25, 2018, 6:44 a.m. OK GNU C++17 TESTS 45 15 307200 2800
44815586 jklepec C Oct. 24, 2018, 9:12 p.m. OK GNU C++17 TESTS 45 15 307200 2800
47856172 aki167yuuki C Jan. 2, 2019, 10:31 p.m. OK GNU C++17 TESTS 45 30 0 2800
46296551 vjudge3 C Nov. 28, 2018, 3:27 a.m. OK GNU C++17 TESTS 45 30 0 2800
44822562 Trisolaris C Oct. 25, 2018, 3:37 a.m. OK GNU C++17 TESTS 45 30 0 2800
44814015 ggoh C Oct. 24, 2018, 8:31 p.m. OK GNU C++17 TESTS 45 30 0 2800
50498332 sigma425 C Feb. 25, 2019, 4:06 p.m. OK GNU C++17 TESTS 45 30 102400 2800
45455350 Arturgo C Nov. 8, 2018, 6:41 p.m. OK GNU C++17 TESTS 45 30 204800 2800
45064619 Xylofo C Oct. 29, 2018, 4:27 p.m. OK GNU C++17 TESTS 45 30 204800 2800
68340789 Harpae C Jan. 7, 2020, 3:24 a.m. OK Java 8 TESTS 45 109 0 2800
55393898 dalt C June 10, 2019, 10:57 a.m. OK Java 8 TESTS 45 124 0 2800
45586922 2156863 C Nov. 12, 2018, 9:27 a.m. OK Java 8 TESTS 45 124 0 2800
44844882 AkshajK C Oct. 25, 2018, 2:07 p.m. OK Java 8 TESTS 45 124 0 2800
44794822 uwi C Oct. 24, 2018, 5:18 p.m. OK Java 8 TESTS 45 124 0 2800
44820425 pajenegod C Oct. 25, 2018, 1:45 a.m. OK PyPy 2 TESTS 45 124 0 2800
44876047 KrukovAA C Oct. 25, 2018, 5:07 p.m. OK PyPy 3 TESTS 45 124 1024000 2800
52472098 Dmitriy.Belichenko C April 7, 2019, 7:15 p.m. OK PyPy 3 TESTS 45 140 1024000 2800
52472079 Dmitriy.Belichenko C April 7, 2019, 7:14 p.m. OK PyPy 3 TESTS 45 140 1024000 2800
45031578 leehosu01 C Oct. 29, 2018, 4:32 a.m. OK PyPy 3 TESTS 45 140 1024000 2800
44810120 xh286286 C Oct. 24, 2018, 6:29 p.m. OK PyPy 3 TESTS 45 187 1843200 2800
68611263 user202729_ C Jan. 11, 2020, 3:47 p.m. OK PyPy 3 TESTS 45 187 2560000 2800
52472088 Clone3 C April 7, 2019, 7:15 p.m. OK Python 3 TESTS 45 109 0 2800
44905245 JSZX11556 C Oct. 26, 2018, 11:09 a.m. OK Python 3 TESTS 45 109 307200 2800
44816115 Vosatorp C Oct. 24, 2018, 9:29 p.m. OK Python 3 TESTS 45 124 0 2800
44806523 Boterphile C Oct. 24, 2018, 6:10 p.m. OK Python 3 TESTS 45 124 0 2800
45470217 cycleke C Nov. 9, 2018, 9:06 a.m. OK Python 3 TESTS 45 124 102400 2800
48091134 Dmitriy.Belichenko C Jan. 8, 2019, 1:53 p.m. OK Python 3 TESTS 45 124 409600 2800
46987943 whatshisbucket C Dec. 13, 2018, 10:28 p.m. OK Python 3 TESTS 45 155 102400 2800

remove filters

Back to search problems