Codeforces Round 342 (Div. 2)

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
625 Codeforces Round 342 (Div. 2) FINISHED False 7200 321569722 Feb. 7, 2016, 9:05 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 419 ) E Frog Fights PROGRAMMING data structures greedy 2900

Ostap Bender recently visited frog farm and was inspired to create his own frog game. Number of frogs are places on a cyclic gameboard, divided into m cells. Cells are numbered from 1 to m , but the board is cyclic, so cell number 1 goes right after the cell number m in the direction of movement. i -th frog during its turn can jump for a i cells. Frogs move in turns, game starts with a move by frog 1 . On its turn i -th frog moves a i cells forward, knocking out all the frogs on its way. If there is a frog in the last cell of the path of the i -th frog, that frog is also knocked out. After this the value a i is decreased by the number of frogs that were knocked out during this turn. If a i is zero or goes negative, then i -th frog doesn't make moves anymore. After frog number 1 finishes its turn, frog number 2 starts to move, then frog number 3 and so on. After the frog number n makes its move, frog 1 starts to move again, then frog 2 and so on this process goes forever. If some frog was already knocked out from the board, we consider that it skips all its moves. Help Ostap to identify, what frogs will stay on the board at the end of a game? First line of the input contains two integers n and m ( 1 ≤ n ≤ 100000, 1 ≤ m ≤ 10 9 , n ≤ m ) — number of frogs and gameboard size, respectively. Following n lines contains frogs descriptions — two integers p i and a i ( 1 ≤ p i , a i ≤ m ) — the number of cell occupied by i -th frog initially and initial jump length. All p i are guaranteed to be distinct. In the first line output number of frogs on the final gameboard. In the second line output their numbers in any order. In the first sample first frog jumps 1 cell and finishes in cell number 3 . Second frog jumps for 3 cells and finishes on cell number 3 , knocking out frog number 1 . Current jump length for frog number 2 is now 2 . Third frog jumps to cell 2 , then second frog jumps to cell 5 . Third frog in turn finishes in cell 5 and removes frog 2 from the gameb

Tutorials

Codeforces Round #342 (Div. 2) : editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
15895525 Owen_he E Feb. 8, 2016, 12:36 p.m. OK GNU C++ TESTS 102 77 6656000 2900
15895314 qambaraliyev_shaxzod E Feb. 8, 2016, 12:21 p.m. OK GNU C++ TESTS 102 78 6041600 2900
15946894 130705009 E Feb. 10, 2016, 7:30 p.m. OK GNU C++ TESTS 102 78 6656000 2900
15946433 mrjackson E Feb. 10, 2016, 7:02 p.m. OK GNU C++ TESTS 102 78 6656000 2900
15930680 Datka E Feb. 10, 2016, 2:42 p.m. OK GNU C++ TESTS 102 78 6656000 2900
15915953 Down_and_Up E Feb. 9, 2016, 2:34 p.m. OK GNU C++ TESTS 102 78 6656000 2900
15895583 Owen_he E Feb. 8, 2016, 12:41 p.m. OK GNU C++ TESTS 102 78 6656000 2900
15892458 Minology E Feb. 8, 2016, 8:17 a.m. OK GNU C++ TESTS 102 78 6860800 2900
15892154 ArGuTe E Feb. 8, 2016, 7:47 a.m. OK GNU C++ TESTS 102 78 6860800 2900
40985195 ReaLNero1 E July 30, 2018, 7:48 p.m. OK GNU C++ TESTS 102 93 6860800 2900
59856708 nealchen E Sept. 1, 2019, 1:49 p.m. OK GNU C++11 TESTS 102 77 6963200 2900
16532387 Egor.Lifar E March 5, 2016, 11:33 a.m. OK GNU C++11 TESTS 102 78 5632000 2900
59856781 nealchen E Sept. 1, 2019, 1:51 p.m. OK GNU C++11 TESTS 102 78 6963200 2900
16823486 freebsdx E March 19, 2016, 4:26 p.m. OK GNU C++11 TESTS 102 78 8704000 2900
16308895 krijgertje E Feb. 24, 2016, 12:55 p.m. OK GNU C++11 TESTS 102 93 5222400 2900
15930111 HAPUMAH E Feb. 10, 2016, 2:09 p.m. OK GNU C++11 TESTS 102 93 6656000 2900
15930090 JambMambo E Feb. 10, 2016, 2:07 p.m. OK GNU C++11 TESTS 102 93 6656000 2900
16026569 Fry_guest E Feb. 15, 2016, 3:23 a.m. OK GNU C++11 TESTS 102 108 4812800 2900
15875014 rnsiehemt E Feb. 7, 2016, 12:20 p.m. OK GNU C++11 TESTS 102 124 8601600 2900
57616504 Nihilism E July 24, 2019, 1:52 a.m. OK GNU C++11 TESTS 102 140 5222400 2900
30328725 NiroBC E Sept. 14, 2017, 12:54 p.m. OK GNU C++14 TESTS 102 156 4812800 2900
35893292 ______i______ E March 3, 2018, 3:47 p.m. OK GNU C++14 TESTS 102 171 8089600 2900
35885561 ______M______ E March 3, 2018, 1:30 p.m. OK GNU C++14 TESTS 102 171 8089600 2900
57613772 vjudge1 E July 23, 2019, 11:25 p.m. OK GNU C++14 TESTS 102 187 5427200 2900
38553565 qiqi20021026 E May 23, 2018, 6:57 a.m. OK GNU C++14 TESTS 102 187 7577600 2900
65905313 nysanier E Nov. 28, 2019, 10:39 a.m. OK GNU C++14 TESTS 102 202 5427200 2900
38553598 qiqi20021026 E May 23, 2018, 6:58 a.m. OK GNU C++14 TESTS 102 217 7577600 2900
36322271 3015218054 E March 16, 2018, 10:04 a.m. OK GNU C++14 TESTS 102 234 30822400 2900
36322089 3015218054 E March 16, 2018, 9:56 a.m. OK GNU C++14 TESTS 102 234 30822400 2900
49619015 hychyc E Feb. 8, 2019, 8:10 a.m. OK GNU C++14 TESTS 102 249 5427200 2900
57615538 chengyufeng E July 24, 2019, 1:17 a.m. OK GNU C++17 TESTS 102 218 5427200 2900
57596794 Duanyll E July 23, 2019, 2:14 p.m. OK GNU C++17 TESTS 102 218 5427200 2900
57615098 vjudge1 E July 24, 2019, 12:57 a.m. OK GNU C++17 TESTS 102 233 8294400 2900
57596828 vjudge1 E July 23, 2019, 2:15 p.m. OK GNU C++17 TESTS 102 234 5427200 2900
57618472 vjudge1 E July 24, 2019, 3:02 a.m. OK GNU C++17 TESTS 102 234 8294400 2900
69602024 ruo E Jan. 27, 2020, 8:06 a.m. OK GNU C++17 TESTS 102 249 6553600 2900
57582471 KING_LRL E July 23, 2019, 9:21 a.m. OK GNU C++17 TESTS 102 249 8294400 2900
57582714 vjudge4 E July 23, 2019, 9:26 a.m. OK GNU C++17 TESTS 102 280 8294400 2900
57957536 Benq E July 29, 2019, 7:35 p.m. OK GNU C++17 TESTS 102 405 9011200 2900
17278785 DukeOfYork E April 11, 2016, 1:54 p.m. OK Java 7 TESTS 102 498 7270400 2900
15913295 nitegazer E Feb. 9, 2016, 1:10 p.m. OK Java 7 TESTS 102 545 102400 2900
15913042 nitegazer E Feb. 9, 2016, 12:59 p.m. OK Java 7 TESTS 102 560 102400 2900
36346944 tri E March 17, 2018, 8:08 a.m. OK Java 8 TESTS 102 436 32972800 2900
15973497 linh.nh E Feb. 12, 2016, 3:42 p.m. OK Java 8 TESTS 102 499 0 2900
31431512 I_love_Tvoya_Mamasha E Oct. 16, 2017, 7:29 p.m. OK Java 8 TESTS 102 592 25702400 2900
21951429 rrepeat E Oct. 31, 2016, 9:36 p.m. OK Java 8 TESTS 102 623 3174400 2900
21886163 rrepeat E Oct. 30, 2016, 4:26 a.m. OK Java 8 TESTS 102 655 15667200 2900
21890203 rrepeat E Oct. 30, 2016, 10:16 a.m. OK Java 8 TESTS 102 670 15564800 2900
21891113 rrepeat E Oct. 30, 2016, 11:21 a.m. OK Java 8 TESTS 102 685 10240000 2900
21891238 rrepeat E Oct. 30, 2016, 11:28 a.m. OK Java 8 TESTS 102 686 10240000 2900
21891016 rrepeat E Oct. 30, 2016, 11:16 a.m. OK Java 8 TESTS 102 795 15564800 2900
15901537 og.kostya E Feb. 8, 2016, 7:33 p.m. OK MS C# TESTS 102 295 10752000 2900
15892233 azukun E Feb. 8, 2016, 7:57 a.m. OK MS C# TESTS 102 295 12083200 2900
16617462 ilya62 E March 9, 2016, 1:30 p.m. OK MS C++ TESTS 102 109 10444800 2900
15988552 Milanin E Feb. 13, 2016, 2:17 p.m. OK MS C++ TESTS 102 124 10444800 2900
15876524 ZeroShadow E Feb. 7, 2016, 1:19 p.m. OK MS C++ TESTS 102 421 14540800 2900

remove filters

Back to search problems