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 |
---|---|---|---|---|---|---|
( 775 ) | F2 | Alice and Recoloring 2 | PROGRAMMING | flows graph matchings 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 3 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 2 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 |
---|---|---|---|---|---|---|---|---|---|---|---|
130747284 | OguriCap | F2 | Oct. 4, 2021, 1:29 a.m. | OK | GNU C++14 | TESTS | 67 | 31 | 5632000 | ||
130720879 | dlalswp25 | F2 | Oct. 3, 2021, 4:31 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 6451200 | ||
130747423 | xwp | F2 | Oct. 4, 2021, 1:32 a.m. | OK | GNU C++14 | TESTS | 67 | 31 | 53964800 | ||
130745654 | leapfrog | F2 | Oct. 4, 2021, 12:14 a.m. | OK | GNU C++14 | TESTS | 67 | 46 | 4300800 | ||
130750486 | yyyz04 | F2 | Oct. 4, 2021, 2:35 a.m. | OK | GNU C++14 | TESTS | 67 | 46 | 4710400 | ||
130745570 | stoorz | F2 | Oct. 4, 2021, 12:11 a.m. | OK | GNU C++14 | TESTS | 67 | 46 | 11264000 | ||
130720967 | DPprince | F2 | Oct. 3, 2021, 4:31 p.m. | OK | GNU C++14 | TESTS | 67 | 46 | 20992000 | ||
130744751 | nabilajlan | F2 | Oct. 3, 2021, 11:33 p.m. | OK | GNU C++14 | TESTS | 67 | 77 | 10854400 | ||
130719848 | heroes_tonight | F2 | Oct. 3, 2021, 4:28 p.m. | OK | GNU C++14 | TESTS | 67 | 77 | 10854400 | ||
130761083 | xiaoziyao | F2 | Oct. 4, 2021, 5:38 a.m. | OK | GNU C++14 | TESTS | 67 | 78 | 6860800 | ||
130728565 | lmnopqrst | F2 | Oct. 3, 2021, 5:47 p.m. | OK | GNU C++17 | TESTS | 67 | 30 | 4403200 | ||
130745744 | fxhd | F2 | Oct. 4, 2021, 12:17 a.m. | OK | GNU C++17 | TESTS | 67 | 31 | 4300800 | ||
130735660 | Sandeep0786 | F2 | Oct. 3, 2021, 7:25 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 4608000 | ||
130727927 | lmnopqrst | F2 | Oct. 3, 2021, 5:41 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 4710400 | ||
130735373 | atodo | F2 | Oct. 3, 2021, 7:20 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 4915200 | ||
130719923 | dXqwq | F2 | Oct. 3, 2021, 4:28 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 5222400 | ||
130718447 | hank55663 | F2 | Oct. 3, 2021, 4:24 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 6451200 | ||
130720300 | Linqi05 | F2 | Oct. 3, 2021, 4:29 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 6758400 | ||
130754296 | Ivan_123 | F2 | Oct. 4, 2021, 3:46 a.m. | OK | GNU C++17 | TESTS | 67 | 31 | 15257600 | ||
130754246 | sky123 | F2 | Oct. 4, 2021, 3:45 a.m. | OK | GNU C++17 | TESTS | 67 | 31 | 15257600 | ||
130743389 | neal | F2 | Oct. 3, 2021, 10:34 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 5120000 | ||
130751371 | ButterCake | F2 | Oct. 4, 2021, 2:52 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 5632000 | ||
130747938 | ToToMI | F2 | Oct. 4, 2021, 1:47 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 6963200 | ||
130730194 | fastmath | F2 | Oct. 3, 2021, 6:06 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 6963200 | ||
130721142 | haruki_K | F2 | Oct. 3, 2021, 4:31 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 7168000 | ||
130747181 | wasa855 | F2 | Oct. 4, 2021, 1:26 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 31 | 68812800 | ||
130759828 | huangxiaohua | F2 | Oct. 4, 2021, 5:20 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 46 | 5120000 | ||
130719704 | neal | F2 | Oct. 3, 2021, 4:27 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 46 | 5120000 | ||
130751627 | ButterCake | F2 | Oct. 4, 2021, 2:57 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 46 | 5632000 | ||
130752857 | chen_zida | F2 | Oct. 4, 2021, 3:19 a.m. | OK | GNU C++17 (64) | TESTS | 67 | 46 | 6860800 |
Back to search problems