Codeforces Round 709 (Div. 1, based on Technocup 2021 Final Round)

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
1483 Codeforces Round 709 (Div. 1, based on Technocup 2021 Final Round) FINISHED False 8100 120847163 March 21, 2021, 1:20 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3852 ) A Basic Diplomacy PROGRAMMING constructive algorithms flows greedy implementation

B'Aleksey has n friends. He is also on a vacation right now, so he has m days to play this new viral cooperative game! But since it 's cooperative, Aleksey will need one teammate in each of these m days. On each of these days some friends will be available for playing, and all others will not. On each day Aleksey must choose one of his available friends to offer him playing the game (and they, of course, always agree). However, if any of them happens to be chosen strictly more than <= ft lceil dfrac{m}{2} right rceil times, then all other friends are offended. Of course, Aleksey doesn 't want to offend anyone. Help him to choose teammates so that nobody is chosen strictly more than <= ft lceil dfrac{m}{2} right rceil times. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10 ,000 ). Description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n, m <= q 100 ,000 ) standing for the number of friends and the number of days to play, respectively. The i -th of the following m lines contains an integer k_i ( 1 <= q k_i <= q n ), followed by k_i distinct integers f_{i1} , ..., f_{ik_i} ( 1 <= q f_{ij} <= q n ), separated by spaces -- indices of available friends on the day i . It is guaranteed that the sums of n and m over all test cases do not exceed 100 ,000 . It 's guaranteed that the sum of all k_i over all days of all test cases doesn 't exceed 200 ,000 . Print an answer for each test case. If there is no way to achieve the goal, print "NO". Otherwise, in the first line print "YES", and in the second line print m space separated integers c_1 , ..., c_m . Each c_i must denote the chosen friend on day i (and therefore must be one of f_{ij} ). No value must occur more than <= ft lceil dfrac{m}{2} right '...

Tutorials

Technocup 2021: Final Round and Codeforces Round #709 — tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
110642805 iica A March 21, 2021, 2:03 p.m. OK D TESTS 14 171 38400000
110744975 luogu_bot2 A March 22, 2021, 2:35 p.m. OK GNU C++11 TESTS 14 31 3993600
110638438 clfzs A March 21, 2021, 1:49 p.m. OK GNU C++11 TESTS 14 31 3993600
110637386 LYC. A March 21, 2021, 1:45 p.m. OK GNU C++11 TESTS 14 31 4096000
110640829 QwQcOrZ A March 21, 2021, 1:57 p.m. OK GNU C++11 TESTS 14 31 4505600
110640679 myx12345 A March 21, 2021, 1:56 p.m. OK GNU C++11 TESTS 14 31 5120000
110731041 fishcathu. A March 22, 2021, 11:58 a.m. OK GNU C++11 TESTS 14 46 1638400
110631252 hanyuwei A March 21, 2021, 1:29 p.m. OK GNU C++11 TESTS 14 46 3174400
110634872 Sanzenkai A March 21, 2021, 1:36 p.m. OK GNU C++11 TESTS 14 46 3174400
110634939 jzp A March 21, 2021, 1:36 p.m. OK GNU C++11 TESTS 14 46 3686400
110638364 jiaangk_ A March 21, 2021, 1:48 p.m. OK GNU C++11 TESTS 14 46 3993600
110640157 Daniel_yuan A March 21, 2021, 1:55 p.m. OK GNU C++14 TESTS 14 46 6144000
110636323 donentseto A March 21, 2021, 1:41 p.m. OK GNU C++14 TESTS 14 62 3788800
110634050 kimjihoon A March 21, 2021, 1:33 p.m. OK GNU C++14 TESTS 14 77 1228800
110631610 Potassium A March 21, 2021, 1:30 p.m. OK GNU C++14 TESTS 14 77 3788800
110639914 marko312 A March 21, 2021, 1:54 p.m. OK GNU C++14 TESTS 14 77 3788800
110636082 Devil A March 21, 2021, 1:40 p.m. OK GNU C++14 TESTS 14 77 3788800
110628508 DmitryGrigorev A March 21, 2021, 1:25 p.m. OK GNU C++14 TESTS 14 77 3788800
110638955 Kwords A March 21, 2021, 1:50 p.m. OK GNU C++14 TESTS 14 77 4198400
110645906 glancing_back A March 21, 2021, 2:13 p.m. OK GNU C++14 TESTS 14 77 4198400
110630206 sjcsjcsjc A March 21, 2021, 1:27 p.m. OK GNU C++14 TESTS 14 77 4198400
110688988 allfadeaway A March 21, 2021, 11:19 p.m. OK GNU C++17 TESTS 14 46 13209600
110692435 lyyyyy A March 22, 2021, 1:58 a.m. OK GNU C++17 TESTS 14 46 19046400
110634936 yukihana0416 A March 21, 2021, 1:36 p.m. OK GNU C++17 TESTS 14 61 19251200
110637774 xmt A March 21, 2021, 1:46 p.m. OK GNU C++17 TESTS 14 62 2457600
110747192 WHUWKL A March 22, 2021, 3:01 p.m. OK GNU C++17 TESTS 14 62 4198400
110636166 bthero A March 21, 2021, 1:40 p.m. OK GNU C++17 TESTS 14 62 4198400
110631520 AliShahali1382 A March 21, 2021, 1:29 p.m. OK GNU C++17 TESTS 14 62 7782400
110634685 Amir_Reza A March 21, 2021, 1:35 p.m. OK GNU C++17 TESTS 14 77 3174400
110675149 Lieska A March 21, 2021, 5:23 p.m. OK GNU C++17 TESTS 14 77 3174400
110648813 adhvana A March 21, 2021, 2:22 p.m. OK GNU C++17 TESTS 14 77 3174400
110634246 yosupo A March 21, 2021, 1:34 p.m. OK GNU C++17 (64) TESTS 14 31 4915200
110637507 dysyn1314 A March 21, 2021, 1:45 p.m. OK GNU C++17 (64) TESTS 14 31 9011200
110629106 LayCurse A March 21, 2021, 1:26 p.m. OK GNU C++17 (64) TESTS 14 46 6963200
110633285 hzkmd A March 21, 2021, 1:32 p.m. OK GNU C++17 (64) TESTS 14 61 4403200
110731556 Starman_ A March 22, 2021, 12:04 p.m. OK GNU C++17 (64) TESTS 14 61 4812800
110672516 IceKnight1093 A March 21, 2021, 4:47 p.m. OK GNU C++17 (64) TESTS 14 61 4812800
110699826 user32 A March 22, 2021, 5:16 a.m. OK GNU C++17 (64) TESTS 14 61 4812800
110693809 zlt1117 A March 22, 2021, 2:50 a.m. OK GNU C++17 (64) TESTS 14 61 4915200
110690000 19992147 A March 22, 2021, 12:07 a.m. OK GNU C++17 (64) TESTS 14 61 5222400
110733932 rgnerdplayer A March 22, 2021, 12:30 p.m. OK GNU C++17 (64) TESTS 14 61 5222400
110703862 0x3F A March 22, 2021, 6:20 a.m. OK Go TESTS 14 155 4915200
110704008 0x3F A March 22, 2021, 6:22 a.m. OK Go TESTS 14 155 4915200
110704404 0x3F A March 22, 2021, 6:28 a.m. OK Go TESTS 14 171 4915200
110727881 0x3F A March 22, 2021, 11:27 a.m. OK Go TESTS 14 218 4915200
110634439 mikit A March 21, 2021, 1:34 p.m. OK Java 11 TESTS 14 187 0
110673543 its_aks_ulure A March 21, 2021, 5:01 p.m. OK Java 11 TESTS 14 249 0
110638501 insert_cool_handle A March 21, 2021, 1:49 p.m. OK Java 11 TESTS 14 249 6348800
110633176 shilov A March 21, 2021, 1:32 p.m. OK Java 11 TESTS 14 280 0
110633405 fetetriste A March 21, 2021, 1:32 p.m. OK Java 11 TESTS 14 280 0
110637775 Apfeloxid A March 21, 2021, 1:46 p.m. OK Java 11 TESTS 14 327 16076800
110634812 Justyo A March 21, 2021, 1:35 p.m. OK Java 11 TESTS 14 342 14643200
110631726 uwi A March 21, 2021, 1:30 p.m. OK Java 11 TESTS 14 577 57446400
110635889 Discombobulated A March 21, 2021, 1:39 p.m. OK Java 11 TESTS 14 763 86118400
110710914 onlytrall A March 22, 2021, 8:01 a.m. OK Java 8 TESTS 14 171 0
110633757 polyakoff A March 21, 2021, 1:33 p.m. OK Java 8 TESTS 14 186 0
110634431 dalt A March 21, 2021, 1:34 p.m. OK Java 8 TESTS 14 186 307200
110642324 hu_tao A March 21, 2021, 2:02 p.m. OK Java 8 TESTS 14 234 5632000
110634807 awesomelemonade A March 21, 2021, 1:35 p.m. OK Java 8 TESTS 14 280 16588800
110637097 2020akadaver A March 21, 2021, 1:44 p.m. OK Java 8 TESTS 14 296 15360000
110754365 Whiplash99 A March 22, 2021, 4:28 p.m. OK Java 8 TESTS 14 374 36249600
110632385 Tlatoani A March 21, 2021, 1:31 p.m. OK Kotlin TESTS 14 233 3584000
110656299 arvindf232 A March 21, 2021, 2:46 p.m. OK Kotlin TESTS 14 295 17100800
110635675 koper A March 21, 2021, 1:38 p.m. OK Kotlin TESTS 14 327 4096000
110659380 r57shell A March 21, 2021, 2:56 p.m. OK MS C++ TESTS 14 156 17408000
110640118 tarattata1 A March 21, 2021, 1:54 p.m. OK MS C++ 2017 TESTS 14 109 3993600
110752412 Friska A March 22, 2021, 4:03 p.m. OK MS C++ 2017 TESTS 14 327 29696000
110726869 gaserashraf A March 22, 2021, 11:16 a.m. OK MS C++ 2017 TESTS 14 436 9830400
110651003 keymoon A March 21, 2021, 2:29 p.m. OK .NET Core C# TESTS 14 311 22835200
110693345 watarimaycry2 A March 22, 2021, 2:34 a.m. OK Node.js TESTS 14 327 34201600
110635135 bcollet A March 21, 2021, 1:36 p.m. OK PyPy 2 TESTS 14 280 15667200
110681043 rishabnahar2025 A March 21, 2021, 6:50 p.m. OK PyPy 2 TESTS 14 327 15462400
110701328 not_tehlka A March 22, 2021, 5:42 a.m. OK PyPy 3 TESTS 14 312 21299200
110631897 qwertz73355a A March 21, 2021, 1:30 p.m. OK PyPy 3 TESTS 14 358 15462400
110638862 titia A March 21, 2021, 1:50 p.m. OK PyPy 3 TESTS 14 358 15974400
110633495 SPD_9X2 A March 21, 2021, 1:32 p.m. OK PyPy 3 TESTS 14 373 16179200
110634904 asdsasd A March 21, 2021, 1:36 p.m. OK PyPy 3 TESTS 14 374 18329600
110780522 brimstone A March 23, 2021, 4:21 a.m. OK PyPy 3 TESTS 14 374 18534400
110642717 jimm89 A March 21, 2021, 2:03 p.m. OK PyPy 3 TESTS 14 421 26624000
110681956 seanhwang10 A March 21, 2021, 7:07 p.m. OK PyPy 3 TESTS 14 467 23859200
110648263 fanfly A March 21, 2021, 2:21 p.m. OK PyPy 3 TESTS 14 1106 16998400
110632320 nwi A March 21, 2021, 1:31 p.m. OK Python 2 TESTS 14 311 14028800
110774598 Genius3435 A March 23, 2021, 12:12 a.m. OK Python 3 TESTS 14 577 16179200
110721988 Ravivek080 A March 22, 2021, 10:18 a.m. OK Python 3 TESTS 14 623 13004800
110774612 Genius3435 A March 23, 2021, 12:13 a.m. OK Python 3 TESTS 14 655 16076800
110637205 toomer A March 21, 2021, 1:44 p.m. OK Rust TESTS 14 78 12697600
110633394 sansen A March 21, 2021, 1:32 p.m. OK Rust TESTS 14 109 28569600
110636668 ngtkana A March 21, 2021, 1:42 p.m. OK Rust TESTS 14 249 6553600
110636781 hiratai A March 21, 2021, 1:43 p.m. OK Rust TESTS 14 296 52428800

remove filters

Back to search problems