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 |
1427
|
Codeforces Global Round 11 |
FINISHED |
False |
10800 |
134924963 |
Oct. 10, 2020, 2:50 p.m. |
Problems
B'You have to paint with shades of grey the tiles of an n x n wall. The wall has n rows of tiles, each with n tiles. The tiles on the boundary of the wall (i.e., on the first row, last row, first column and last column) are already painted and you shall not change their color. All the other tiles are not painted. Some of the tiles are broken, you shall not paint those tiles. It is guaranteed that the tiles on the boundary are not broken. You shall paint all the non-broken tiles that are not already painted. When you paint a tile you can choose from 10^9 shades of grey, indexed from 1 to 10^9 . You can paint multiple tiles with the same shade. Formally, painting the wall is equivalent to assigning a shade (an integer between 1 and 10^9 ) to each non-broken tile that is not already painted. The contrast between two tiles is the absolute value of the difference between the shades of the two tiles. The total contrast of the wall is the sum of the contrast of all the pairs of adjacent non-broken tiles (two tiles are adjacent if they share a side). Compute the minimum possible total contrast of the wall. The first line contains n ( 3 <= n <= 200 ) xe2 x80 x93 the number of rows and columns. Then n lines, each containing n integers, follow. The i -th of these lines describe the i -th row of tiles. It contains the n integers a_{ij} ( -1 <= a_{ij} <= 10^9) . The value of a_{ij} described the tile on the i -th row and j -th column: Print a single integer xe2 x80 x93 the minimum possible total contrast of the wall. Explanation of the first testcase: The initial configuration of the tiles is (tiles to paint are denoted by ?): Explanation of the second testcase: Since all tiles are either painted or broken, there is nothing to do. The total contrast is 396 . Explanation of the third testcase: The initial configuration of the tiles is (tiles to paint are denoted by ?)'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
95172946 |
gisp_zjz |
G |
Oct. 11, 2020, 5:03 a.m. |
OK |
GNU C++11 |
TESTS |
129 |
686 |
1331200 |
|
3300 |
95161809 |
BSBandme |
G |
Oct. 10, 2020, 10:37 p.m. |
OK |
GNU C++14 |
TESTS |
129 |
811 |
5222400 |
|
3300 |
95146718 |
lumibons |
G |
Oct. 10, 2020, 5:48 p.m. |
OK |
GNU C++14 |
TESTS |
129 |
2916 |
7372800 |
|
3300 |
95152700 |
sh1194 |
G |
Oct. 10, 2020, 7:08 p.m. |
OK |
GNU C++14 |
TESTS |
129 |
2948 |
151347200 |
|
3300 |
95141066 |
apiadu |
G |
Oct. 10, 2020, 5:19 p.m. |
OK |
GNU C++14 |
TESTS |
129 |
2979 |
151347200 |
|
3300 |
95148543 |
snuke |
G |
Oct. 10, 2020, 6:19 p.m. |
OK |
GNU C++17 |
TESTS |
129 |
1731 |
5427200 |
|
3300 |
95148949 |
Noam527 |
G |
Oct. 10, 2020, 6:22 p.m. |
OK |
GNU C++17 |
TESTS |
129 |
2449 |
7270400 |
|
3300 |
95145388 |
Swistakk |
G |
Oct. 10, 2020, 5:42 p.m. |
OK |
GNU C++17 |
TESTS |
129 |
2932 |
12697600 |
|
3300 |
95148986 |
Radewoosh |
G |
Oct. 10, 2020, 6:22 p.m. |
OK |
GNU C++17 |
TESTS |
129 |
2947 |
9830400 |
|
3300 |
95143355 |
ecnerwala |
G |
Oct. 10, 2020, 5:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
763 |
4403200 |
|
3300 |
95156412 |
dario2994 |
G |
Oct. 10, 2020, 8:14 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
858 |
6041600 |
|
3300 |
95141745 |
maroonrk |
G |
Oct. 10, 2020, 5:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
889 |
6246400 |
|
3300 |
95152852 |
yosupo |
G |
Oct. 10, 2020, 7:10 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
1123 |
10956800 |
|
3300 |
95139913 |
Um_nik |
G |
Oct. 10, 2020, 5:12 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
1309 |
18022400 |
|
3300 |
95159253 |
neal |
G |
Oct. 10, 2020, 9:20 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
1481 |
7884800 |
|
3300 |
95157969 |
Benq |
G |
Oct. 10, 2020, 8:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
1778 |
8601600 |
|
3300 |
95158902 |
neal |
G |
Oct. 10, 2020, 9:10 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
1996 |
4403200 |
|
3300 |
95145386 |
kefaa2 |
G |
Oct. 10, 2020, 5:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
1996 |
15974400 |
|
3300 |
95136358 |
yosupo |
G |
Oct. 10, 2020, 4:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
129 |
2043 |
11059200 |
|
3300 |
95150829 |
qwerty787788 |
G |
Oct. 10, 2020, 6:42 p.m. |
OK |
Java 8 |
TESTS |
129 |
2916 |
7884800 |
|
3300 |
remove filters
Back to search problems