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 |
---|---|---|---|---|---|---|
1611 | Codeforces Round 756 (Div. 3) | FINISHED | False | 8100 | 99415463 | Nov. 25, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 660 ) | G | Robot and Candies | PROGRAMMING | data structures greedy | 2500 |
B"Polycarp has a rectangular field of n x m cells (the size of the n cdot m field does not exceed 10^6 cells, m ge 2 ), in each cell of which there can be candy. There are n rows and m columns in the field. Let's denote a cell with coordinates x vertically and y horizontally by (x, y) . Then the top-left cell will be denoted as (1, 1) , and the bottom-right cell will be denoted as (n, m) . If there is candy in the cell, then the cell is marked with the symbol '1', otherwise -- with the symbol '0'. Polycarp made a Robot that can collect candy. The Robot can move from (x, y) either to (x+1, y+1) , or to (x+1, y-1) . If the Robot is in a cell that contains candy, it takes it. While there is at least one candy on the field, the following procedure is executed: Find the minimum number of times Polycarp needs to put the Robot on the topmost row of the field in order to collect all the candies. It is guaranteed that Polycarp can always collect all the candies. The first line of input data contains an integer t ( 1 <= t <= 10^4 ) -- the number of input data sets in the test. Before each input data, there is a blank line in the test. Next is a line that contains integers n and m ( 2 <= m , 2 <= n cdot m <= 10^6 ) -- field sizes. This is followed by n lines, i -th of which describes the i -th line of the field. Each of them is a string of size m characters: the symbol '1' corresponds to a cell with candy, the symbol '0' -- an empty cell. It is guaranteed that the sum of n cdot m values for all input data sets in the test does not exceed 10^6 . Print t lines, each line should contain the answer to the corresponding set of input data: the minimum number of times Polycarpus needs to put the Robot on the topmost row of the field in order to collect all the candies. In the first set Polycarp may not put the"... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
136951473 | ix35 | G | Nov. 26, 2021, 12:40 a.m. | OK | GNU C++14 | TESTS | 38 | 93 | 9011200 | 2500 | |
136981754 | ezlmr | G | Nov. 26, 2021, 9:25 a.m. | OK | GNU C++14 | TESTS | 38 | 140 | 24268800 | 2500 | |
136977515 | SF-Manman | G | Nov. 26, 2021, 8:32 a.m. | OK | GNU C++14 | TESTS | 38 | 140 | 32256000 | 2500 | |
136980536 | BigFaceDog | G | Nov. 26, 2021, 9:09 a.m. | OK | GNU C++14 | TESTS | 38 | 155 | 36147200 | 2500 | |
136966997 | zn_com | G | Nov. 26, 2021, 6:18 a.m. | OK | GNU C++14 | TESTS | 38 | 156 | 33280000 | 2500 | |
137079201 | ezlmr | G | Nov. 27, 2021, 2:24 a.m. | OK | GNU C++14 | TESTS | 38 | 171 | 32256000 | 2500 | |
136951209 | XiEn1847 | G | Nov. 26, 2021, 12:29 a.m. | OK | GNU C++14 | TESTS | 38 | 202 | 32256000 | 2500 | |
137077655 | GaryH | G | Nov. 27, 2021, 1:39 a.m. | OK | GNU C++14 | TESTS | 38 | 342 | 118476800 | 2500 | |
136989174 | shengtongtong | G | Nov. 26, 2021, 11:07 a.m. | OK | GNU C++14 | TESTS | 38 | 358 | 31027200 | 2500 | |
136967518 | littlelittlehorse | G | Nov. 26, 2021, 6:25 a.m. | OK | GNU C++14 | TESTS | 38 | 358 | 31027200 | 2500 | |
136957809 | Bakti-Tuymehan-abai-2025 | G | Nov. 26, 2021, 3:32 a.m. | OK | GNU C++17 | TESTS | 38 | 46 | 5017600 | 2500 | |
136957330 | Bakti-Tuymehan-abai-2025 | G | Nov. 26, 2021, 3:22 a.m. | OK | GNU C++17 | TESTS | 38 | 46 | 5017600 | 2500 | |
136966572 | panyaoyu | G | Nov. 26, 2021, 6:12 a.m. | OK | GNU C++17 | TESTS | 38 | 109 | 14848000 | 2500 | |
137084370 | NirvanaYlsq | G | Nov. 27, 2021, 4:17 a.m. | OK | GNU C++17 | TESTS | 38 | 109 | 38297600 | 2500 | |
137042579 | dede_smile | G | Nov. 26, 2021, 1:58 p.m. | OK | GNU C++17 | TESTS | 38 | 109 | 44339200 | 2500 | |
136954331 | YaoBIG | G | Nov. 26, 2021, 2:13 a.m. | OK | GNU C++17 | TESTS | 38 | 124 | 21708800 | 2500 | |
136949705 | peti1234 | G | Nov. 25, 2021, 11:10 p.m. | OK | GNU C++17 | TESTS | 38 | 155 | 36249600 | 2500 | |
136967285 | zech | G | Nov. 26, 2021, 6:22 a.m. | OK | GNU C++17 | TESTS | 38 | 156 | 21811200 | 2500 | |
137060213 | Martin53 | G | Nov. 26, 2021, 5:26 p.m. | OK | GNU C++17 | TESTS | 38 | 171 | 16281600 | 2500 | |
136984558 | simulatedsakura | G | Nov. 26, 2021, 10:03 a.m. | OK | GNU C++17 | TESTS | 38 | 187 | 38297600 | 2500 | |
136936913 | emthrm | G | Nov. 25, 2021, 6:12 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 78 | 25702400 | 2500 | |
136968348 | noimi | G | Nov. 26, 2021, 6:35 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 93 | 15155200 | 2500 | |
136950813 | neko_nyaaaaaaaaaaaaaaaaa | G | Nov. 26, 2021, 12:10 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 109 | 21094400 | 2500 | |
136937891 | evenny | G | Nov. 25, 2021, 6:26 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 139 | 56217600 | 2500 | |
136986887 | IAKWF | G | Nov. 26, 2021, 10:37 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 139 | 69529600 | 2500 | |
136979320 | burnoutag | G | Nov. 26, 2021, 8:54 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 140 | 45158400 | 2500 | |
136945683 | nohaxjustsoflo | G | Nov. 25, 2021, 8:47 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 155 | 44236800 | 2500 | |
136972895 | numzero | G | Nov. 26, 2021, 7:33 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 155 | 69222400 | 2500 | |
136969660 | Morishita | G | Nov. 26, 2021, 6:52 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 155 | 72294400 | 2500 | |
137062431 | YesPy | G | Nov. 26, 2021, 5:58 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 171 | 56320000 | 2500 | |
137081350 | yuanyuan2048 | G | Nov. 27, 2021, 3:12 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 62 | 38195200 | 2500 | |
136971695 | t3a | G | Nov. 26, 2021, 7:17 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 78 | 17715200 | 2500 | |
136937645 | Meul | G | Nov. 25, 2021, 6:23 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 78 | 36147200 | 2500 | |
136949725 | kaiboy | G | Nov. 25, 2021, 11:11 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 93 | 29081600 | 2500 | |
136942692 | Bench0310 | G | Nov. 25, 2021, 7:43 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 109 | 13516800 | 2500 | |
137053900 | chctxdy68 | G | Nov. 26, 2021, 3:59 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 109 | 30515200 | 2500 | |
136958437 | minlevel_spyofgame | G | Nov. 26, 2021, 3:46 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 109 | 30515200 | 2500 | |
136987064 | achvanov | G | Nov. 26, 2021, 10:39 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 139 | 44236800 | 2500 | |
136982422 | hat | G | Nov. 26, 2021, 9:33 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 140 | 45260800 | 2500 | |
136951332 | wygzgyw | G | Nov. 26, 2021, 12:34 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 343 | 28979200 | 2500 | |
136964568 | dzhi | G | Nov. 26, 2021, 5:43 a.m. | OK | Java 11 | TESTS | 38 | 732 | 61132800 | 2500 | |
136963874 | dzhi | G | Nov. 26, 2021, 5:33 a.m. | OK | Java 11 | TESTS | 38 | 920 | 61644800 | 2500 | |
137074737 | NatInTheHat | G | Nov. 26, 2021, 11:21 p.m. | OK | Java 8 | TESTS | 38 | 1715 | 258969600 | 2500 | |
136973270 | SPD_9X2 | G | Nov. 26, 2021, 7:38 a.m. | OK | PyPy 3 | TESTS | 38 | 717 | 80896000 | 2500 | |
137082294 | FlakeLCR | G | Nov. 27, 2021, 3:32 a.m. | OK | PyPy 3-64 | TESTS | 38 | 858 | 218419200 | 2500 |
Back to search problems