Codeforces Round 178 (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
294 Codeforces Round 178 (Div. 2) FINISHED False 7200 411057023 April 7, 2013, 3:30 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 378 ) D Shaass and Painter Robot PROGRAMMING brute force implementation number theory 2700

Shaass thinks a kitchen with all white floor tiles is so boring. His kitchen floor is made of n · m square tiles forming a n × m rectangle. Therefore he's decided to color some of the tiles in black so that the floor looks like a checkerboard, which is no two side-adjacent tiles should have the same color. Shaass wants to use a painter robot to color the tiles. In the beginning the robot is standing in a border tile ( x s , y s ) facing a diagonal direction (i.e. upper-left, upper-right, down-left or down-right). As the robot walks in the kitchen he paints every tile he passes even if it's painted before. Painting each tile consumes one unit of black paint. If at any moment the robot hits a wall of the kitchen he changes his direction according the reflection rules. Note that a tile gets painted when the robot enters the tile from another tile, in other words changing direction in the same tile doesn't lead to any painting. The first tile the robot is standing on, is also painted. The robot stops painting the first moment the floor is checkered. Given the dimensions of the kitchen and the position of the robot, find out the amount of paint the robot consumes before it stops painting the floor. Let's consider an examples depicted below. If the robot starts at tile number 1 (the tile (1, 1) ) of the left grid heading to down-right it'll pass tiles 1354236 and consumes 7 units of black paint on his way until he stops at tile number 6. But if it starts at tile number 1 in the right grid heading to down-right it will get stuck in a loop painting tiles 1, 2, and 3. The first line of the input contains two integers n and m , (2 ≤ n , m ≤ 10 5 ) . The second line contains two integers x s and y s (1 ≤ x s ≤ n , 1 ≤ y s ≤ m ) and the direction robot is facing initially. Direction is one of the strings: " UL " (upper-left direction), " UR " (upper-right), " DL " (down-left) or " DR " (down-right). Note, that record ( x s , y s ) denotes the tile that is located at t

Tutorials

Codeforces Round #178 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3488815 vlad107 D April 7, 2013, 5:11 p.m. OK Delphi TESTS 68 15 14131200 2700
27733142 Krosh D June 12, 2017, 7:31 a.m. OK FPC TESTS 68 60 1638400 2700
27733068 vjudge5 D June 12, 2017, 7:27 a.m. OK FPC TESTS 68 62 1638400 2700
41416228 vjudge5 D Aug. 10, 2018, 3:01 a.m. OK FPC TESTS 68 62 3686400 2700
41416217 Liah D Aug. 10, 2018, 3:01 a.m. OK FPC TESTS 68 62 3686400 2700
57590976 luogu_bot2 D July 23, 2019, 12:16 p.m. OK FPC TESTS 68 92 3686400 2700
3487996 kawatea D April 7, 2013, 4:51 p.m. OK GNU C TESTS 68 31 7987200 2700
3649147 rng_58 D April 28, 2013, 5:30 p.m. OK GNU C++ TESTS 68 15 0 2700
3558042 Alien.kz D April 17, 2013, 7:53 p.m. OK GNU C++ TESTS 68 15 409600 2700
3498445 Ekaing D April 10, 2013, 5:32 a.m. OK GNU C++ TESTS 68 15 409600 2700
3661952 lys1280023 D May 3, 2013, 4:52 a.m. OK GNU C++ TESTS 68 15 1228800 2700
3600181 phidnight D April 22, 2013, 9:37 a.m. OK GNU C++ TESTS 68 15 1536000 2700
3819284 nemomojie D June 3, 2013, 4:11 p.m. OK GNU C++ TESTS 68 15 1638400 2700
3672464 krijgertje D May 5, 2013, 12:13 p.m. OK GNU C++ TESTS 68 15 1638400 2700
3545758 HoangNguyen D April 15, 2013, 4:38 p.m. OK GNU C++ TESTS 68 15 1638400 2700
3493936 KonanMentor D April 8, 2013, 4:05 p.m. OK GNU C++ TESTS 68 15 2048000 2700
3495253 doraemon D April 9, 2013, 5:44 a.m. OK GNU C++ TESTS 68 15 2662400 2700
3500749 MinakoKojima D April 10, 2013, 6:59 p.m. OK GNU C++0x TESTS 68 15 1638400 2700
9057347 pwecar D Dec. 9, 2014, 10:38 a.m. OK GNU C++0x TESTS 68 124 8192000 2700
8244393 jiry_2 D Oct. 16, 2014, 8:49 a.m. OK GNU C++0x TESTS 68 154 9216000 2700
8930717 zshi D Dec. 2, 2014, 10:48 a.m. OK GNU C++0x TESTS 68 186 6656000 2700
9329468 equation314 D Dec. 31, 2014, 3:10 a.m. OK GNU C++0x TESTS 68 218 8192000 2700
3493052 BryantMark D April 8, 2013, 12:14 p.m. OK GNU C++0x TESTS 68 343 15974400 2700
3495964 2011330300713 D April 9, 2013, 10:55 a.m. OK GNU C++0x TESTS 68 359 18636800 2700
34355199 Mr_leon D Jan. 20, 2018, 2:04 p.m. OK GNU C++11 TESTS 68 30 2457600 2700
35120675 vjudge5 D Feb. 10, 2018, 10:38 a.m. OK GNU C++11 TESTS 68 30 2662400 2700
17130464 freebsdx D April 2, 2016, 1:02 p.m. OK GNU C++11 TESTS 68 30 2662400 2700
54500400 WOSHIGEPACHONG2 D May 22, 2019, 8:26 p.m. OK GNU C++11 TESTS 68 62 1433600 2700
51762214 xielinhan D March 23, 2019, 2:14 p.m. OK GNU C++11 TESTS 68 62 1433600 2700
56698014 vjudge5 D July 8, 2019, 7:55 a.m. OK GNU C++11 TESTS 68 62 2969600 2700
56697993 RainAir D July 8, 2019, 7:54 a.m. OK GNU C++11 TESTS 68 62 2969600 2700
34463697 HokyeeJau D Jan. 23, 2018, 12:52 a.m. OK GNU C++11 TESTS 68 62 3686400 2700
56866524 YSChengzi D July 12, 2019, 3:28 a.m. OK GNU C++11 TESTS 68 62 6553600 2700
23733155 McGinn D Jan. 12, 2017, 8:04 a.m. OK GNU C++11 TESTS 68 62 15155200 2700
27732566 Feeey D June 12, 2017, 6:52 a.m. OK GNU C++14 TESTS 68 30 1536000 2700
41389126 vjudge3 D Aug. 9, 2018, 7:33 a.m. OK GNU C++14 TESTS 68 62 3174400 2700
34345531 llmxby D Jan. 20, 2018, 8:55 a.m. OK GNU C++14 TESTS 68 62 5120000 2700
34540093 ZhihuiLiu D Jan. 25, 2018, 8:21 a.m. OK GNU C++14 TESTS 68 122 10854400 2700
34533883 vjudge1 D Jan. 25, 2018, 2:41 a.m. OK GNU C++14 TESTS 68 122 10854400 2700
36932692 artur.socha D April 3, 2018, 7:49 p.m. OK GNU C++14 TESTS 68 124 9932800 2700
36918871 artur.socha D April 3, 2018, 4:55 p.m. OK GNU C++14 TESTS 68 124 9932800 2700
39287134 sjmartin D June 16, 2018, 12:16 p.m. OK GNU C++14 TESTS 68 154 8192000 2700
23354430 jasonvictoryan D Dec. 27, 2016, 7:36 a.m. OK GNU C++14 TESTS 68 156 8499200 2700
35114951 vjudge2 D Feb. 10, 2018, 7:20 a.m. OK GNU C++14 TESTS 68 186 8499200 2700
64562557 hjk1030 D Nov. 9, 2019, 6:34 a.m. OK GNU C++17 TESTS 68 124 9523200 2700
35650119 WooDeND D Feb. 24, 2018, 3:11 p.m. OK GNU C++17 TESTS 68 156 10854400 2700
52589838 ruo D April 11, 2019, 4:36 a.m. OK GNU C++17 TESTS 68 218 9420800 2700
3489856 uwi D April 7, 2013, 5:45 p.m. OK Java 6 TESTS 68 93 2252800 2700
4922388 DiegoAE D Oct. 28, 2013, 5:25 p.m. OK Java 6 TESTS 68 156 2457600 2700
3503521 zxybazh D April 11, 2013, 12:23 p.m. OK Java 6 TESTS 68 625 22630400 2700
3693579 SergeyLazarev D May 8, 2013, 9:54 a.m. OK Java 7 TESTS 68 93 0 2700
3493837 dusty.and.rusty D April 8, 2013, 3:34 p.m. OK Java 7 TESTS 68 93 0 2700
3493669 dusty.and.rusty D April 8, 2013, 2:45 p.m. OK Java 7 TESTS 68 93 0 2700
3493647 dusty.and.rusty D April 8, 2013, 2:34 p.m. OK Java 7 TESTS 68 93 0 2700
3490480 mmaxio D April 7, 2013, 6:55 p.m. OK Java 7 TESTS 68 202 0 2700
3488758 antonkov D April 7, 2013, 5:09 p.m. OK Java 7 TESTS 68 312 16588800 2700
3533774 Payman D April 14, 2013, 10:37 a.m. OK Java 7 TESTS 68 343 102400 2700
3492274 problem-solved D April 8, 2013, 9:29 a.m. OK Java 7 TESTS 68 453 35737600 2700
3493073 problem-solved D April 8, 2013, 12:19 p.m. OK Java 7 TESTS 68 468 43724800 2700
3491692 rotoZOOM D April 8, 2013, 5:56 a.m. OK MS C++ TESTS 68 15 1638400 2700
3491074 zhongdi D April 8, 2013, 12:17 a.m. OK MS C++ TESTS 68 15 7987200 2700
3499403 ssiq D April 10, 2013, 12:01 p.m. OK MS C++ TESTS 68 31 4096000 2700
40989995 ReaLNero1 D July 30, 2018, 11:29 p.m. OK MS C++ TESTS 68 92 7987200 2700
6439157 Elun D April 22, 2014, 9:14 a.m. OK MS C++ TESTS 68 124 6451200 2700
41392662 yz6205 D Aug. 9, 2018, 9:13 a.m. OK MS C++ TESTS 68 156 6758400 2700
41392689 vjudge3 D Aug. 9, 2018, 9:14 a.m. OK MS C++ TESTS 68 186 6758400 2700
4489743 iso9001 D Sept. 17, 2013, 5:49 p.m. OK MS C++ TESTS 68 218 8089600 2700
3551989 hgame D April 16, 2013, 11:13 a.m. OK MS C++ TESTS 68 390 18636800 2700
41395369 vjudge1 D Aug. 9, 2018, 10:49 a.m. OK MS C++ TESTS 68 468 9932800 2700
3494920 Darooha D April 9, 2013, 1:40 a.m. OK Ocaml TESTS 68 1014 30515200 2700
3490565 kesarevs D April 7, 2013, 7:14 p.m. OK Python 2 TESTS 68 1093 20172800 2700
3490534 pifych D April 7, 2013, 7:07 p.m. OK Python 2 TESTS 68 1125 20172800 2700

remove filters

Back to search problems