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 |
---|---|---|---|---|---|---|
1592 | Codeforces Round 746 (Div. 2) | FINISHED | False | 7200 | 98551499 | Oct. 3, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 910 ) | F1 | Alice and Recoloring 1 | PROGRAMMING | greedy |
B"The difference between the versions is in the costs of operations. Solution for one version won't work for another! Alice has a grid of size n x m , initially all its cells are colored white. The cell on the intersection of i -th row and j -th column is denoted as (i, j) . Alice can do the following operations with this grid: Choose any subrectangle containing cell (1, 1) , and flip the colors of all its cells. (Flipping means changing its color from white to black or from black to white). This operation costs 1 coin. Choose any subrectangle containing cell (n, 1) , and flip the colors of all its cells. This operation costs 2 coins. Choose any subrectangle containing cell (1, m) , and flip the colors of all its cells. This operation costs 4 coins. Choose any subrectangle containing cell (n, m) , and flip the colors of all its cells. This operation costs 3 coins. As a reminder, subrectangle is a set of all cells (x, y) with x_1 <= x <= x_2 , y_1 <= y <= y_2 for some 1 <= x_1 <= x_2 <= n , 1 <= y_1 <= y_2 <= m . Alice wants to obtain her favorite coloring with these operations. What's the smallest number of coins that she would have to spend? It can be shown that it's always possible to transform the initial grid into any other. The first line of the input contains 2 integers n, m ( 1 <= n, m <= 500 ) -- the dimensions of the grid. The i -th of the next n lines contains a string s_i of length m , consisting of letters W and B. The j -th character of string s_i is W if the cell (i, j) is colored white in the favorite coloring of Alice, and B if it's colored black. Output the smallest number of coins Alice would have to spend to achieve her favorite coloring. In the first sample, it's optimal to just apply the fourth operation once to the rectangle containing cells (2, 2), (2, 3), (3, 2), (3,"... |
95583 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
130745267 | leapfrog | F1 | Oct. 3, 2021, 11:57 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 4300800 | ||
130746886 | yyyz04 | F1 | Oct. 4, 2021, 1:18 a.m. | OK | GNU C++14 | TESTS | 67 | 31 | 4403200 | ||
130749773 | AC-hunter | F1 | Oct. 4, 2021, 2:22 a.m. | OK | GNU C++14 | TESTS | 67 | 31 | 4505600 | ||
130744244 | SuperJ6 | F1 | Oct. 3, 2021, 11:08 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 4710400 | ||
130745081 | stoorz | F1 | Oct. 3, 2021, 11:48 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 5017600 | ||
130728182 | SuperCGK | F1 | Oct. 3, 2021, 5:44 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 5324800 | ||
130752018 | BaoJiaoPisu | F1 | Oct. 4, 2021, 3:04 a.m. | OK | GNU C++14 | TESTS | 67 | 31 | 5836800 | ||
130758831 | _xyj | F1 | Oct. 4, 2021, 5:03 a.m. | OK | GNU C++14 | TESTS | 67 | 31 | 6041600 | ||
130714549 | SkyCrystal | F1 | Oct. 3, 2021, 4:12 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 7065600 | ||
130742136 | IDontNeedFriends | F1 | Oct. 3, 2021, 9:51 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 7987200 | ||
130745122 | fxhd | F1 | Oct. 3, 2021, 11:51 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 3993600 | ||
130745107 | kurtsaeed | F1 | Oct. 3, 2021, 11:50 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 4096000 | ||
130736315 | n0sk1ll | F1 | Oct. 3, 2021, 7:37 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 4300800 | ||
130754343 | Ivan_123 | F1 | Oct. 4, 2021, 3:47 a.m. | OK | GNU C++17 | TESTS | 67 | 31 | 5017600 | ||
130752008 | sky123 | F1 | Oct. 4, 2021, 3:04 a.m. | OK | GNU C++17 | TESTS | 67 | 31 | 5017600 | ||
130743255 | cuiaoxiang | F1 | Oct. 3, 2021, 10:29 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 5324800 | ||
130761075 | KDVinit | F1 | Oct. 4, 2021, 5:38 a.m. | OK | GNU C++17 | TESTS | 67 | 31 | 5734400 | ||
130715202 | Linqi05 | F1 | Oct. 3, 2021, 4:14 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 6041600 | ||
130748298 | Alan233 | F1 | Oct. 4, 2021, 1:55 a.m. | OK | GNU C++17 | TESTS | 67 | 46 | 4812800 | ||
130718247 | dreamoon_love_AA | F1 | Oct. 3, 2021, 4:23 p.m. | OK | GNU C++17 | TESTS | 67 | 46 | 9011200 | ||
130743388 | neal | F1 | Oct. 3, 2021, 10:34 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 4812800 | ||
130729226 | rgnerdplayer | F1 | Oct. 3, 2021, 5:54 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 5427200 | ||
130752163 | czhang2718 | F1 | Oct. 4, 2021, 3:06 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 4812800 | ||
130749856 | devout | F1 | Oct. 4, 2021, 2:24 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 5120000 | ||
130721567 | risujiroh | F1 | Oct. 3, 2021, 4:32 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 5529600 | ||
130720255 | nigus | F1 | Oct. 3, 2021, 4:29 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 5632000 | ||
130747209 | froggyzhang | F1 | Oct. 4, 2021, 1:27 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 6348800 | ||
130717527 | fastmath | F1 | Oct. 3, 2021, 4:21 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 6348800 | ||
130742455 | AlanSkarica | F1 | Oct. 3, 2021, 10:01 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 6553600 | ||
130747522 | ToToMI | F1 | Oct. 4, 2021, 1:35 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 6656000 | ||
130724418 | tabr | F1 | Oct. 3, 2021, 5:08 p.m. | OK | Kotlin 1.5 | TESTS | 67 | 218 | 25702400 | ||
130716710 | Tlatoani | F1 | Oct. 3, 2021, 4:19 p.m. | OK | Kotlin 1.5 | TESTS | 67 | 249 | 25702400 |
Back to search problems