Codeforces Round 575 (Div. 3)

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
1196 Codeforces Round 575 (Div. 3) FINISHED False 7200 167844299 July 24, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3746 ) E Connected Component on a Chessboard PROGRAMMING constructive algorithms implementation 1900

B'You are given two integers b and w . You have a chessboard of size 10^9 x 10^9 with the top left cell at (1; 1) , the cell (1; 1) is painted white. Your task is to find a connected component on this chessboard that contains exactly b black cells and exactly w white cells. Two cells are called connected if they share a side (i.e. for the cell (x, y) there are at most four connected cells: (x - 1, y), (x + 1, y), (x, y - 1), (x, y + 1) ). A set of cells is called a connected component if for every pair of cells C_1 and C_2 from this set, there exists a sequence of cells c_1 , c_2 , ..., c_k such that c_1 = C_1 , c_k = C_2 , all c_i from 1 to k are belong to this set of cells and for every i in [1, k - 1] , cells c_i and c_{i + 1} are connected. Obviously, it can be impossible to find such component. In this case print "NO". Otherwise, print "YES" and any suitable connected component. You have to answer q independent queries. The first line of the input contains one integer q ( 1 <= q <= 10^5 ) -- the number of queries. Then q queries follow. The only line of the query contains two integers b and w ( 1 <= b, w <= 10^5 ) -- the number of black cells required and the number of white cells required. It is guaranteed that the sum of numbers of cells does not exceed 2 cdot 10^5 ( sum w + sum b <= 2 cdot 10^5 ). For each query, print the answer to it. If it is impossible to find the required component, print "NO" on the first line. Otherwise, print "YES" on the first line. In the next b + w lines print coordinates of cells of your component in any order. There should be exactly b black cells and w white cells in your answer. The printed component should be connected. If there are several answers, you can print any. All coordinates in the answer should be in th'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57876602 hatsuyuki15 E July 28, 2019, 5:44 a.m. OK D TESTS 20 93 2150400 1900
67850315 rr_ E Dec. 29, 2019, 2:21 a.m. OK D TESTS 20 108 4198400 1900
60403142 Denor E Sept. 11, 2019, 5:27 p.m. OK Delphi TESTS 20 77 102400 1900
58220659 Craspedacusta E Aug. 3, 2019, 12:27 p.m. OK FPC TESTS 20 592 0 1900
57840410 LaSWeeG E July 27, 2019, 9:05 a.m. OK FPC TESTS 20 623 0 1900
57738520 MRoy E July 25, 2019, 10:42 a.m. OK GNU C11 TESTS 20 686 0 1900
69886576 Bring E Jan. 31, 2020, 8:26 a.m. OK GNU C++11 TESTS 20 31 0 1900
61855083 vjudge2 E Oct. 4, 2019, 1:51 p.m. OK GNU C++11 TESTS 20 46 0 1900
60971745 luogu_bot1 E Sept. 21, 2019, 7:18 a.m. OK GNU C++11 TESTS 20 46 0 1900
65029145 vjudge5 E Nov. 15, 2019, 9:06 a.m. OK GNU C++11 TESTS 20 46 0 1900
58790042 BestMSN E Aug. 14, 2019, 1:54 a.m. OK GNU C++11 TESTS 20 46 0 1900
58710627 vjudge5 E Aug. 13, 2019, 12:05 p.m. OK GNU C++11 TESTS 20 46 0 1900
58390222 luoZH111 E Aug. 6, 2019, 1:26 p.m. OK GNU C++11 TESTS 20 46 0 1900
58389941 luoZH111 E Aug. 6, 2019, 1:20 p.m. OK GNU C++11 TESTS 20 46 0 1900
59837191 no_one_qwq E Sept. 1, 2019, 5:05 a.m. OK GNU C++11 TESTS 20 46 0 1900
62567476 ANiuZY E Oct. 14, 2019, 1:36 p.m. OK GNU C++11 TESTS 20 46 0 1900
68514951 100gods E Jan. 10, 2020, 2:33 p.m. OK GNU C++14 TESTS 20 46 0 1900
68834762 mahdi.hasnat E Jan. 15, 2020, 2:16 a.m. OK GNU C++14 TESTS 20 46 0 1900
68710576 Scut82 E Jan. 13, 2020, 12:51 p.m. OK GNU C++14 TESTS 20 46 0 1900
68709258 Scut82 E Jan. 13, 2020, 12:26 p.m. OK GNU C++14 TESTS 20 46 0 1900
61863743 vjudge4 E Oct. 4, 2019, 4:01 p.m. OK GNU C++14 TESTS 20 46 0 1900
61847775 Sarah_Wang E Oct. 4, 2019, 11:50 a.m. OK GNU C++14 TESTS 20 46 0 1900
61796397 follower0523 E Oct. 3, 2019, 5:24 p.m. OK GNU C++14 TESTS 20 46 0 1900
61319641 onlystar E Sept. 26, 2019, 12:10 p.m. OK GNU C++14 TESTS 20 46 0 1900
60481469 Rubikun E Sept. 13, 2019, 10:40 a.m. OK GNU C++14 TESTS 20 46 0 1900
59088567 LilMeyer E Aug. 19, 2019, 11:57 a.m. OK GNU C++14 TESTS 20 46 0 1900
65151819 vjudge3 E Nov. 16, 2019, 7:49 a.m. OK GNU C++17 TESTS 20 46 0 1900
65035710 vjudge2 E Nov. 15, 2019, 11:33 a.m. OK GNU C++17 TESTS 20 46 0 1900
65030684 caozhenlin E Nov. 15, 2019, 9:44 a.m. OK GNU C++17 TESTS 20 46 0 1900
63773437 oshawott_cute E Oct. 30, 2019, 8:45 a.m. OK GNU C++17 TESTS 20 46 0 1900
63285808 aoyu E Oct. 24, 2019, 10:17 a.m. OK GNU C++17 TESTS 20 46 0 1900
60833428 jjang36524 E Sept. 19, 2019, 7:58 a.m. OK GNU C++17 TESTS 20 46 0 1900
60366403 drade0 E Sept. 10, 2019, 9:12 p.m. OK GNU C++17 TESTS 20 46 0 1900
59569751 07_2018 E Aug. 27, 2019, 12:07 p.m. OK GNU C++17 TESTS 20 46 0 1900
59334932 crisis666 E Aug. 23, 2019, 4:01 a.m. OK GNU C++17 TESTS 20 46 0 1900
69288775 himanshugarg1703 E Jan. 22, 2020, 9:20 a.m. OK GNU C++17 TESTS 20 46 0 1900
59700401 reanimatorzon E Aug. 30, 2019, 10:25 a.m. OK Go TESTS 20 46 0 1900
61130110 synapse E Sept. 23, 2019, 2:19 p.m. OK Go TESTS 20 62 0 1900
62896692 sighduck E Oct. 19, 2019, 12:49 a.m. OK Go TESTS 20 78 8294400 1900
58243085 WangJialei E Aug. 4, 2019, 3:08 a.m. OK Go TESTS 20 655 0 1900
58254446 vjudge5 E Aug. 4, 2019, 9:20 a.m. OK Go TESTS 20 686 0 1900
57915158 jmazon E July 29, 2019, 12:35 a.m. OK Haskell TESTS 20 93 102400 1900
57749656 TheSawan E July 25, 2019, 2:20 p.m. OK Java 8 TESTS 20 124 3379200 1900
59543208 mbfeci E Aug. 26, 2019, 7:58 p.m. OK Java 8 TESTS 20 140 0 1900
58212122 Link20 E Aug. 3, 2019, 9:12 a.m. OK Java 8 TESTS 20 140 0 1900
57885632 revanthreddy85 E July 28, 2019, 9:44 a.m. OK Java 8 TESTS 20 140 0 1900
57804586 potatmen E July 26, 2019, 2:38 p.m. OK Java 8 TESTS 20 140 0 1900
67172749 kalyanirishabh1198 E Dec. 18, 2019, 5:55 p.m. OK Java 8 TESTS 20 155 0 1900
68395297 sakt_coder E Jan. 8, 2020, 10:45 a.m. OK Java 8 TESTS 20 155 0 1900
58868854 PaoloP E Aug. 15, 2019, 2:29 p.m. OK Java 8 TESTS 20 155 0 1900
58098952 ISSAM_LAKOUAM E July 31, 2019, 10:10 p.m. OK Java 8 TESTS 20 155 0 1900
57990955 Jarik E July 30, 2019, 1:13 p.m. OK Java 8 TESTS 20 155 0 1900
57782171 bohuss E July 26, 2019, 6:24 a.m. OK Kotlin TESTS 20 140 5529600 1900
59688090 Spheniscine E Aug. 30, 2019, 3:33 a.m. OK Kotlin TESTS 20 202 5324800 1900
60195502 Benq E Sept. 7, 2019, 1:22 a.m. OK Kotlin TESTS 20 264 18739200 1900
58033172 og.kostya E July 30, 2019, 4:40 p.m. OK Mono C# TESTS 20 92 3174400 1900
65298887 vjudge1 E Nov. 18, 2019, 12:31 p.m. OK MS C++ TESTS 20 62 0 1900
58062305 vjudge3 E July 31, 2019, 7:50 a.m. OK MS C++ TESTS 20 62 0 1900
61919128 vjudge2 E Oct. 5, 2019, 12:53 p.m. OK MS C++ TESTS 20 62 0 1900
61865915 vjudge1 E Oct. 4, 2019, 4:35 p.m. OK MS C++ TESTS 20 77 0 1900
61867605 vjudge5 E Oct. 4, 2019, 5:03 p.m. OK MS C++ TESTS 20 77 1638400 1900
57951282 pericle E July 29, 2019, 4:34 p.m. OK MS C++ TESTS 20 889 12800000 1900
58068196 vjudge5 E July 31, 2019, 9:38 a.m. OK MS C++ 2017 TESTS 20 62 0 1900
57733557 hwangganzi E July 25, 2019, 9:16 a.m. OK MS C++ 2017 TESTS 20 77 0 1900
58068171 Saber_Altria E July 31, 2019, 9:38 a.m. OK MS C++ 2017 TESTS 20 77 0 1900
57838561 xsc E July 27, 2019, 8:28 a.m. OK MS C++ 2017 TESTS 20 77 3584000 1900
58068095 yyoooo E July 31, 2019, 9:36 a.m. OK MS C++ 2017 TESTS 20 78 0 1900
57755425 omerb.zeybek E July 25, 2019, 4:08 p.m. OK MS C++ 2017 TESTS 20 78 0 1900
57753360 pmitkov E July 25, 2019, 3:28 p.m. OK MS C++ 2017 TESTS 20 78 0 1900
58068117 vjudge4 E July 31, 2019, 9:37 a.m. OK MS C++ 2017 TESTS 20 78 0 1900
57796339 ai.lugle1997 E July 26, 2019, 11:33 a.m. OK MS C++ 2017 TESTS 20 93 1024000 1900
57796394 ai.lugle1997 E July 26, 2019, 11:34 a.m. OK MS C++ 2017 TESTS 20 93 2150400 1900
57808668 mayakin E July 26, 2019, 4:15 p.m. OK PHP TESTS 20 686 22630400 1900
57897750 yumtam E July 28, 2019, 2:19 p.m. OK PyPy 2 TESTS 20 249 7577600 1900
58829466 wolffd E Aug. 14, 2019, 5:17 p.m. OK PyPy 2 TESTS 20 592 23040000 1900
57742747 MalleAbile E July 25, 2019, 11:59 a.m. OK PyPy 3 TESTS 20 280 14745600 1900
57742638 MalleAbile E July 25, 2019, 11:57 a.m. OK PyPy 3 TESTS 20 280 14848000 1900
57852107 Pokeylope E July 27, 2019, 1:32 p.m. OK PyPy 3 TESTS 20 296 10035200 1900
57898897 petya47 E July 28, 2019, 2:49 p.m. OK PyPy 3 TESTS 20 311 9420800 1900
62587704 H4Wk3ye E Oct. 14, 2019, 7:32 p.m. OK PyPy 3 TESTS 20 311 16486400 1900
57830530 Akash_123 E July 27, 2019, 5:51 a.m. OK PyPy 3 TESTS 20 373 10444800 1900
58546669 v1adimir E Aug. 10, 2019, 5:06 p.m. OK PyPy 3 TESTS 20 374 10547200 1900
57784029 brosucks E July 26, 2019, 7:04 a.m. OK PyPy 3 TESTS 20 405 11468800 1900
57987120 yfo E July 30, 2019, 11:49 a.m. OK PyPy 3 TESTS 20 405 23244800 1900
57816844 Tlatoani E July 26, 2019, 8:12 p.m. OK PyPy 3 TESTS 20 468 9420800 1900
57904281 Helli.code E July 28, 2019, 4:58 p.m. OK Python 2 TESTS 20 326 3481600 1900
57904171 TVBlackman1 E July 28, 2019, 4:55 p.m. OK Python 3 TESTS 20 546 512000 1900
58180010 renjied E Aug. 2, 2019, 2:47 p.m. OK Python 3 TESTS 20 732 14336000 1900
58134671 renjied E Aug. 1, 2019, 3:36 p.m. OK Python 3 TESTS 20 732 14336000 1900
58307074 maslov.alex1580 E Aug. 4, 2019, 7:55 p.m. OK Python 3 TESTS 20 779 921600 1900
57862379 asvasil E July 27, 2019, 6:32 p.m. OK Python 3 TESTS 20 795 716800 1900
57748688 deadguy E July 25, 2019, 1:58 p.m. OK Python 3 TESTS 20 795 716800 1900
61185100 Unpossible E Sept. 23, 2019, 9:55 p.m. OK Python 3 TESTS 20 826 716800 1900
63535247 vjudge5 E Oct. 27, 2019, 7:53 a.m. OK Python 3 TESTS 20 842 716800 1900
63535196 Elo E Oct. 27, 2019, 7:52 a.m. OK Python 3 TESTS 20 842 716800 1900
63535114 Elo E Oct. 27, 2019, 7:50 a.m. OK Python 3 TESTS 20 858 716800 1900

remove filters

Back to search problems