Codeforces Round 810 (Div. 1)

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
1710 Codeforces Round 810 (Div. 1) FINISHED False 7200 78593063 July 24, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11100 ) A Color the Picture PROGRAMMING constructive algorithms greedy

B'A picture can be represented as an n x m grid ( n rows and m columns) so that each of the n cdot m cells is colored with one color. You have k pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most a_i cells with the i -th pigment. A picture is considered beautiful if each cell has at least 3 toroidal neighbors with the same color as itself. Two cells are considered toroidal neighbors if they toroidally share an edge. In other words, for some integers 1 <= q x_1,x_2 <= q n and 1 <= q y_1,y_2 <= q m , the cell in the x_1 -th row and y_1 -th column is a toroidal neighbor of the cell in the x_2 -th row and y_2 -th column if one of following two conditions holds: Notice that each cell has exactly 4 toroidal neighbors. For example, if n=3 and m=4 , the toroidal neighbors of the cell (1, 2) (the cell on the first row and second column) are: (3, 2) , (2, 2) , (1, 3) , (1, 1) . They are shown in gray on the image below: Is it possible to color all cells with the pigments provided and create a beautiful picture? Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 10^4 ). The description of the test cases follows. The first line of each test case contains three integers n , m , and k ( 3 <= q n,m <= q 10^9 , 1 <= q k <= q 10^5 ) -- the number of rows and columns of the picture and the number of pigments. The next line contains k integers a_1,a_2, ... , a_k ( 1 <= q a_i <= q 10^9 ) -- a_i is the maximum number of cells that can be colored with the i -th pigment. It is guaranteed that the sum of k over all test cases does not exceed 10^5 . For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (withou'...

Tutorials

Codeforces Round #810 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
165541574 Gassa A July 24, 2022, 2:42 p.m. OK D TESTS 17 46 6144000
165566041 hos.lyric A July 24, 2022, 3:31 p.m. OK D TESTS 17 61 13516800
165598791 rainboy A July 24, 2022, 6:59 p.m. OK GNU C11 TESTS 18 77 409600
165554911 chro4896 A July 24, 2022, 3:02 p.m. OK GNU C11 TESTS 17 93 819200
165555066 win10 A July 24, 2022, 3:02 p.m. OK GNU C++14 TESTS 17 15 2150400
165571998 A_normal_OIer A July 24, 2022, 3:48 p.m. OK GNU C++14 TESTS 17 31 0
165557540 IcMtr A July 24, 2022, 3:08 p.m. OK GNU C++14 TESTS 17 31 0
165557257 hydd A July 24, 2022, 3:07 p.m. OK GNU C++14 TESTS 17 31 409600
165581475 zzlzzlzzl A July 24, 2022, 4:18 p.m. OK GNU C++14 TESTS 17 31 1843200
165541922 Sol1 A July 24, 2022, 2:43 p.m. OK GNU C++14 TESTS 17 31 2867200
165543525 wangyian2022 A July 24, 2022, 2:44 p.m. OK GNU C++14 TESTS 17 31 2867200
165551068 Winterfrost A July 24, 2022, 2:54 p.m. OK GNU C++14 TESTS 17 31 3379200
165543816 20333333333 A July 24, 2022, 2:45 p.m. OK GNU C++14 TESTS 17 31 3686400
165552083 zmwang A July 24, 2022, 2:56 p.m. OK GNU C++14 TESTS 17 31 8089600
165549074 Bobocan A July 24, 2022, 2:51 p.m. OK GNU C++17 TESTS 17 30 512000
165545994 kk19212 A July 24, 2022, 2:47 p.m. OK GNU C++17 TESTS 17 30 2662400
165548434 OctaneC8H18 A July 24, 2022, 2:50 p.m. OK GNU C++17 TESTS 17 31 0
165545532 acwing_meow A July 24, 2022, 2:46 p.m. OK GNU C++17 TESTS 17 31 819200
165546050 123hei A July 24, 2022, 2:47 p.m. OK GNU C++17 TESTS 17 31 1638400
165553999 Citrus0.0 A July 24, 2022, 3 p.m. OK GNU C++17 TESTS 17 46 0
165552772 ooaa A July 24, 2022, 2:57 p.m. OK GNU C++17 TESTS 17 46 0
165549344 Mr.Krabs A July 24, 2022, 2:51 p.m. OK GNU C++17 TESTS 17 46 0
165606491 kevin A July 24, 2022, 8:58 p.m. OK GNU C++17 TESTS 18 46 0
165556320 horizon2 A July 24, 2022, 3:05 p.m. OK GNU C++17 TESTS 17 46 0
165546976 O_2 A July 24, 2022, 2:48 p.m. OK GNU C++17 (64) TESTS 17 15 409600
165569668 stevenkplus A July 24, 2022, 3:41 p.m. OK GNU C++17 (64) TESTS 17 30 409600
165539941 Swistakk A July 24, 2022, 2:41 p.m. OK GNU C++17 (64) TESTS 17 31 0
165607989 codelegend A July 24, 2022, 9:28 p.m. OK GNU C++17 (64) TESTS 18 31 0
165541209 Lawali A July 24, 2022, 2:42 p.m. OK GNU C++17 (64) TESTS 17 31 0
165550079 basic_string A July 24, 2022, 2:52 p.m. OK GNU C++17 (64) TESTS 17 31 409600
165549178 rniya A July 24, 2022, 2:51 p.m. OK GNU C++17 (64) TESTS 17 31 409600
165547635 Merlininice A July 24, 2022, 2:49 p.m. OK GNU C++17 (64) TESTS 17 31 409600
165552621 fgvjkshuifd A July 24, 2022, 2:57 p.m. OK GNU C++17 (64) TESTS 17 31 409600
165556020 antguz A July 24, 2022, 3:04 p.m. OK GNU C++17 (64) TESTS 17 31 409600
165550721 liouzhou_101 A July 24, 2022, 2:53 p.m. OK GNU C++20 (64) TESTS 17 15 3686400
165547861 swift-zym A July 24, 2022, 2:49 p.m. OK GNU C++20 (64) TESTS 17 31 0
165628073 marvenlee A July 25, 2022, 4:33 a.m. OK GNU C++20 (64) TESTS 18 31 0
165552251 I_LOVE_DASHA_KARPENKO A July 24, 2022, 2:56 p.m. OK GNU C++20 (64) TESTS 17 31 0
165551534 dannyboy20031204 A July 24, 2022, 2:55 p.m. OK GNU C++20 (64) TESTS 17 31 0
165551424 Raiden A July 24, 2022, 2:54 p.m. OK GNU C++20 (64) TESTS 17 31 0
165551405 Alfeh1 A July 24, 2022, 2:54 p.m. OK GNU C++20 (64) TESTS 17 31 0
165548193 tfg A July 24, 2022, 2:49 p.m. OK GNU C++20 (64) TESTS 17 31 0
165547767 SanguineChameleon A July 24, 2022, 2:49 p.m. OK GNU C++20 (64) TESTS 17 31 0
165545040 Rubikun A July 24, 2022, 2:46 p.m. OK GNU C++20 (64) TESTS 17 31 0
165553445 GoldenShadow A July 24, 2022, 2:58 p.m. OK Java 11 TESTS 17 233 0
165552303 profchi A July 24, 2022, 2:56 p.m. OK Java 11 TESTS 17 311 0
165550608 dusty.and.rusty A July 24, 2022, 2:53 p.m. OK Java 11 TESTS 17 327 4198400
165547952 DarLam A July 24, 2022, 2:49 p.m. OK Java 8 TESTS 17 155 2150400
165564481 AndreySiunov A July 24, 2022, 3:27 p.m. OK Java 8 TESTS 17 156 1843200
165548079 DylanSmith A July 24, 2022, 2:49 p.m. OK Java 8 TESTS 17 171 0
165591903 Sussykin A July 24, 2022, 5:47 p.m. OK Java 8 TESTS 17 202 1843200
165541977 Hakiobo A July 24, 2022, 2:43 p.m. OK Kotlin 1.4 TESTS 17 155 0
165556007 arvindf232 A July 24, 2022, 3:04 p.m. OK Kotlin 1.6 TESTS 17 233 0
165542859 Tlatoani A July 24, 2022, 2:44 p.m. OK Kotlin 1.6 TESTS 17 342 7577600
165550299 derpwaffle21 A July 24, 2022, 2:53 p.m. OK MS C++ 2017 TESTS 17 124 3993600
165555084 10_11_12 A July 24, 2022, 3:02 p.m. OK PyPy 2 TESTS 17 217 14643200
165550338 lddlinan A July 24, 2022, 2:53 p.m. OK PyPy 2 TESTS 17 514 139161600
165548316 NecroSean38 A July 24, 2022, 2:50 p.m. OK PyPy 3 TESTS 17 233 10137600
165544767 SPD_9X2 A July 24, 2022, 2:45 p.m. OK PyPy 3 TESTS 17 265 11059200
165550937 ruimina A July 24, 2022, 2:54 p.m. OK PyPy 3 TESTS 17 296 10342400
165545720 titia A July 24, 2022, 2:46 p.m. OK PyPy 3 TESTS 17 373 10956800
165591634 damin A July 24, 2022, 5:46 p.m. OK PyPy 3 TESTS 17 468 16486400
165559749 P_oldNik A July 24, 2022, 3:14 p.m. OK PyPy 3 TESTS 17 702 12083200
165547911 toam A July 24, 2022, 2:49 p.m. OK PyPy 3-64 TESTS 17 170 13414400
165547946 misorin A July 24, 2022, 2:49 p.m. OK PyPy 3-64 TESTS 17 187 19251200
165551606 eepsilon A July 24, 2022, 2:55 p.m. OK PyPy 3-64 TESTS 17 202 18329600
165552286 huangxw A July 24, 2022, 2:56 p.m. OK PyPy 3-64 TESTS 17 217 19968000
165546201 xxh1999 A July 24, 2022, 2:47 p.m. OK PyPy 3-64 TESTS 17 249 18124800
165551049 taiga0629 A July 24, 2022, 2:54 p.m. OK PyPy 3-64 TESTS 17 265 18124800
165546490 chinerist A July 24, 2022, 2:47 p.m. OK PyPy 3-64 TESTS 17 265 20992000
165545736 siganai A July 24, 2022, 2:46 p.m. OK PyPy 3-64 TESTS 17 280 19660800
165614477 Lhohelhohehmm A July 25, 2022, 12:27 a.m. OK PyPy 3-64 TESTS 18 374 13107200
165610264 olezhkavayn A July 24, 2022, 10:24 p.m. OK PyPy 3-64 TESTS 18 389 11673600
165556606 Jimanbanashi A July 24, 2022, 3:06 p.m. OK Python 2 TESTS 17 171 5734400
165548461 r57shell A July 24, 2022, 2:50 p.m. OK Python 3 TESTS 17 140 8806400
165632501 aravind21 A July 25, 2022, 5:50 a.m. OK Python 3 TESTS 18 280 8806400
165549353 apilat A July 24, 2022, 2:51 p.m. OK Rust 2021 TESTS 17 31 3891200
165547687 sansen A July 24, 2022, 2:49 p.m. OK Rust 2021 TESTS 17 31 4812800

remove filters

Back to search problems