Codeforces Round 191 (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
327 Codeforces Round 191 (Div. 2) FINISHED False 7200 403464623 July 4, 2013, 12:30 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2490 ) D Block Tower PROGRAMMING constructive algorithms dfs and similar graphs 2000

After too much playing on paper, Iahub has switched to computer games. The game he plays is called "Block Towers". It is played in a rectangular grid with n rows and m columns (it contains n × m cells). The goal of the game is to build your own city. Some cells in the grid are big holes, where Iahub can't build any building. The rest of cells are empty. In some empty cell Iahub can build exactly one tower of two following types: Blue towers. Each has population limit equal to 100 . Red towers. Each has population limit equal to 200 . However, it can be built in some cell only if in that moment at least one of the neighbouring cells has a Blue Tower. Two cells are neighbours is they share a side. Iahub is also allowed to destroy a building from any cell. He can do this operation as much as he wants. After destroying a building, the other buildings are not influenced, and the destroyed cell becomes empty (so Iahub can build a tower in this cell if needed, see the second example for such a case). Iahub can convince as many population as he wants to come into his city. So he needs to configure his city to allow maximum population possible. Therefore he should find a sequence of operations that builds the city in an optimal way, so that total population limit is as large as possible. He says he's the best at this game, but he doesn't have the optimal solution. Write a program that calculates the optimal one, to show him that he's not as good as he thinks. The first line of the input contains two integers n and m ( 1 ≤ n , m ≤ 500 ). Each of the next n lines contains m characters, describing the grid. The j -th character in the i -th line is ' . ' if you're allowed to build at the cell with coordinates ( i , j ) a tower (empty cell) or ' # ' if there is a big hole there. Print an integer k in the first line (0 ≤ k ≤ 10 6 ) — the number of operations Iahub should perform to obtain optimal result. Each of the following k lines must contain a single operation in th

Tutorials

Codeforces Round #191 — Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
36216622 vjudge5 D March 12, 2018, 7:08 a.m. OK GNU C TESTS 40 466 27136000 2000
38385244 Scut82 D May 18, 2018, 12:40 a.m. OK GNU C++ TESTS 40 278 26419200 2000
31917460 wustcyl D Oct. 31, 2017, 10:29 a.m. OK GNU C++ TESTS 40 374 14438400 2000
36226761 vjudge5 D March 12, 2018, 2:18 p.m. OK GNU C++ TESTS 40 434 22630400 2000
31868573 vjudge1 D Oct. 29, 2017, 1:51 p.m. OK GNU C++ TESTS 40 436 14438400 2000
31868344 wustcyh D Oct. 29, 2017, 1:43 p.m. OK GNU C++ TESTS 40 466 9932800 2000
36284754 vjudge4 D March 14, 2018, 6:41 p.m. OK GNU C++ TESTS 40 466 12492800 2000
31866721 vjudge5 D Oct. 29, 2017, 12:40 p.m. OK GNU C++ TESTS 40 466 14438400 2000
36199446 vjudge4 D March 11, 2018, 12:34 p.m. OK GNU C++ TESTS 40 466 16486400 2000
36190204 vjudge4 D March 11, 2018, 7:23 a.m. OK GNU C++ TESTS 40 466 16486400 2000
35512818 Hacheylight D Feb. 20, 2018, 6:22 a.m. OK GNU C++ TESTS 40 466 18329600 2000
34482668 RccHD D Jan. 23, 2018, 12:57 p.m. OK GNU C++11 TESTS 40 154 16076800 2000
41005225 ReaLNero1 D July 31, 2018, 9:18 a.m. OK GNU C++11 TESTS 40 186 15155200 2000
40900731 luogu_bot2 D July 29, 2018, 1:36 a.m. OK GNU C++11 TESTS 40 216 35430400 2000
51600450 MosoM D March 21, 2019, 3:12 a.m. OK GNU C++11 TESTS 40 342 14438400 2000
50815280 WA_A_PLAYER D March 5, 2019, 11:12 a.m. OK GNU C++11 TESTS 40 342 27955200 2000
37279000 Trung.Ore D April 13, 2018, 8:48 a.m. OK GNU C++11 TESTS 40 372 41472000 2000
58001937 wyy2004 D July 30, 2019, 2:55 p.m. OK GNU C++11 TESTS 40 374 15360000 2000
51600734 vjudge5 D March 21, 2019, 3:28 a.m. OK GNU C++11 TESTS 40 374 18432000 2000
51600727 MosoM D March 21, 2019, 3:28 a.m. OK GNU C++11 TESTS 40 374 18432000 2000
31184821 The-Legend D Oct. 10, 2017, 8:52 a.m. OK GNU C++11 TESTS 40 374 23449600 2000
65687930 xreal D Nov. 25, 2019, 2:11 a.m. OK GNU C++14 TESTS 40 310 36659200 2000
45342600 Fischer D Nov. 5, 2018, 10:32 p.m. OK GNU C++14 TESTS 40 312 16281600 2000
36197516 Vivan_hy D March 11, 2018, 11:37 a.m. OK GNU C++14 TESTS 40 340 19148800 2000
40916302 vjudge3 D July 29, 2018, 11:57 a.m. OK GNU C++14 TESTS 40 342 13312000 2000
35098231 kill_em_all D Feb. 9, 2018, 4:25 p.m. OK GNU C++14 TESTS 40 342 19353600 2000
31867469 vjudge1 D Oct. 29, 2017, 1:07 p.m. OK GNU C++14 TESTS 40 342 24064000 2000
29917556 paulzrm D Aug. 30, 2017, 12:51 p.m. OK GNU C++14 TESTS 40 342 34201600 2000
28791211 4c5948 D July 23, 2017, 4 a.m. OK GNU C++14 TESTS 40 372 6553600 2000
43091867 mohaned_ashraf D Sept. 19, 2018, 7:22 p.m. OK GNU C++14 TESTS 40 372 21299200 2000
60018657 Scut82 D Sept. 4, 2019, 12:36 p.m. OK GNU C++14 TESTS 40 372 23347200 2000
55553106 chongryong D June 14, 2019, 8:23 a.m. OK GNU C++17 TESTS 40 156 22323200 2000
54335077 vjudge2 D May 18, 2019, 7:44 a.m. OK GNU C++17 TESTS 40 310 25292800 2000
56056329 mohnnad D June 26, 2019, 12:16 a.m. OK GNU C++17 TESTS 40 310 25600000 2000
37879498 ExpMango D May 4, 2018, 9:51 a.m. OK GNU C++17 TESTS 40 310 29696000 2000
53975167 Againstmoon D May 11, 2019, 3:18 a.m. OK GNU C++17 TESTS 40 310 89702400 2000
62624236 jahangard D Oct. 15, 2019, 1:38 p.m. OK GNU C++17 TESTS 40 340 31232000 2000
37879392 ExpMango D May 4, 2018, 9:45 a.m. OK GNU C++17 TESTS 40 342 14848000 2000
59091272 vjudge4 D Aug. 19, 2019, 12:49 p.m. OK GNU C++17 TESTS 40 342 15872000 2000
54334200 vjudge1 D May 18, 2019, 7:20 a.m. OK GNU C++17 TESTS 40 342 15872000 2000
54240000 vjudge5 D May 16, 2019, 12:32 p.m. OK GNU C++17 TESTS 40 342 15872000 2000
58550837 Dukkha D Aug. 10, 2019, 7:45 p.m. OK Java 8 TESTS 40 622 12492800 2000
31387181 Hoda_Hisham D Oct. 16, 2017, 9:52 a.m. OK Java 8 TESTS 40 1340 182374400 2000
29351956 Minaa D Aug. 11, 2017, 11:50 a.m. OK Java 8 TESTS 40 1434 220774400 2000
26886208 og.kostya D May 5, 2017, 5:38 p.m. OK MS C# TESTS 40 934 35737600 2000
66041327 vjudge5 D Nov. 30, 2019, 1:37 p.m. OK MS C++ TESTS 40 434 21299200 2000
54345772 vjudge5 D May 18, 2019, 12:22 p.m. OK MS C++ TESTS 40 498 29798400 2000
22308596 Andreasyan D Nov. 18, 2016, 2:42 p.m. OK MS C++ TESTS 40 810 33075200 2000
63238389 vjudge4 D Oct. 23, 2019, 12:51 p.m. OK MS C++ 2017 TESTS 40 498 23142400 2000
63238213 vjudge4 D Oct. 23, 2019, 12:49 p.m. OK MS C++ 2017 TESTS 40 498 23142400 2000
56806967 ibrahimitani2000 D July 10, 2019, 2:18 p.m. OK MS C++ 2017 TESTS 40 560 18534400 2000
22713809 GShot D Dec. 5, 2016, 2:40 p.m. OK PyPy 3 TESTS 40 1870 69734400 2000

remove filters

Back to search problems