Codeforces Round 698 (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
1477 Codeforces Round 698 (Div. 1) FINISHED False 8100 125335463 Jan. 28, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 580 ) D Nezzar and Hidden Permutations PROGRAMMING constructive algorithms dfs and similar graphs 2800

B'Nezzar designs a brand new game "Hidden Permutations" and shares it with his best friend, Nanako. At the beginning of the game, Nanako and Nezzar both know integers n and m . The game goes in the following way: However, Nezzar accidentally knows Nanako 's unordered pairs and decides to take advantage of them. Please help Nezzar find out two permutations p and q such that the score is maximized. The first line contains a single integer t ( 1 <= t <= 5 cdot 10^5 ) -- the number of test cases. The first line of each test case contains two integers n,m ( 1 <= n <= 5 cdot 10^5, 0 <= m <= min( frac{n(n-1)}{2},5 cdot 10^5) ). Then m lines follow, i -th of them contains two integers l_i,r_i ( 1 <= l_i,r_i <= n , l_i neq r_i ), describing the i -th unordered pair Nanako chooses. It is guaranteed that all m unordered pairs are distinct. It is guaranteed that the sum of n for all test cases does not exceed 5 cdot 10^5 , and the sum of m for all test cases does not exceed 5 cdot 10^5 . For each test case, print two permutations p_1,p_2, ldots,p_n and q_1,q_2, ldots,q_n such that the score Nezzar gets is maximized. For first test case, for each pair given by Nanako: As Nezzar does not lose instantly, Nezzar gains the score of 4 as p_i neq q_i for all 1 <= q i <= q 4 . Obviously, it is the maximum possible score Nezzar can get. '...

Tutorials

87294

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
105799306 The-Out-Land D Jan. 29, 2021, 3:32 a.m. OK GNU C++11 TESTS 49 499 50483200 2800
105804478 sh1194 D Jan. 29, 2021, 5:06 a.m. OK GNU C++11 TESTS 49 561 54579200 2800
105740692 jcvb D Jan. 28, 2021, 3:44 p.m. OK GNU C++11 TESTS 49 623 35430400 2800
105737956 panole D Jan. 28, 2021, 3:38 p.m. OK GNU C++11 TESTS 49 639 54579200 2800
105757616 Jlytxdy D Jan. 28, 2021, 4:24 p.m. OK GNU C++11 TESTS 49 716 49766400 2800
105804837 Mr_Spade D Jan. 29, 2021, 5:11 a.m. OK GNU C++11 TESTS 49 810 90726400 2800
105801086 skydogli D Jan. 29, 2021, 4:07 a.m. OK GNU C++11 TESTS 49 1091 133529600 2800
105795910 yijan D Jan. 29, 2021, 2:07 a.m. OK GNU C++11 TESTS 49 1918 130457600 2800
105771373 soltanbh D Jan. 28, 2021, 5:29 p.m. OK GNU C++11 TESTS 49 2979 78131200 2800
105758060 soltanbh D Jan. 28, 2021, 4:25 p.m. OK GNU C++11 TESTS 49 2979 78131200 2800
105738580 yhx-12243 D Jan. 28, 2021, 3:39 p.m. OK GNU C++14 TESTS 49 577 46592000 2800
105776907 Motarack D Jan. 28, 2021, 6:17 p.m. OK GNU C++14 TESTS 49 607 40243200 2800
105756611 Amoo_Safar D Jan. 28, 2021, 4:21 p.m. OK GNU C++14 TESTS 49 607 44339200 2800
105754989 y1s1 D Jan. 28, 2021, 4:17 p.m. OK GNU C++14 TESTS 49 638 45875200 2800
105747089 receed D Jan. 28, 2021, 3:58 p.m. OK GNU C++14 TESTS 49 654 50278400 2800
105800161 Zetr0 D Jan. 29, 2021, 3:50 a.m. OK GNU C++14 TESTS 49 655 49459200 2800
105761428 caoyue D Jan. 28, 2021, 4:34 p.m. OK GNU C++14 TESTS 49 1122 93081600 2800
105785238 BlueDiamond D Jan. 28, 2021, 8:18 p.m. OK GNU C++14 TESTS 49 1310 100044800 2800
105776755 dlalswp25 D Jan. 28, 2021, 6:15 p.m. OK GNU C++14 TESTS 49 1560 81203200 2800
105761440 Aleks5d D Jan. 28, 2021, 4:34 p.m. OK GNU C++14 TESTS 49 1669 129228800 2800
105796945 C20191629 D Jan. 29, 2021, 2:37 a.m. OK GNU C++17 TESTS 49 608 48742400 2800
105798957 kiyoshi0205 D Jan. 29, 2021, 3:25 a.m. OK GNU C++17 TESTS 49 623 46694400 2800
105755295 stasio6 D Jan. 28, 2021, 4:18 p.m. OK GNU C++17 TESTS 49 654 72294400 2800
105743296 semiexp D Jan. 28, 2021, 3:49 p.m. OK GNU C++17 TESTS 49 655 54169600 2800
105798149 kiyoshi0205 D Jan. 29, 2021, 3:06 a.m. OK GNU C++17 TESTS 49 670 46284800 2800
105754277 Aishiteru. D Jan. 28, 2021, 4:15 p.m. OK GNU C++17 TESTS 49 670 54272000 2800
105807406 xtqqwq D Jan. 29, 2021, 5:48 a.m. OK GNU C++17 TESTS 49 732 40550400 2800
105757853 TeaPot D Jan. 28, 2021, 4:25 p.m. OK GNU C++17 TESTS 49 795 44544000 2800
105737576 Golovanov399 D Jan. 28, 2021, 3:37 p.m. OK GNU C++17 TESTS 49 841 57139200 2800
105772667 Mehrdad_Sohrabi D Jan. 28, 2021, 5:37 p.m. OK GNU C++17 TESTS 49 873 60006400 2800
105759843 LayCurse D Jan. 28, 2021, 4:30 p.m. OK GNU C++17 (64) TESTS 49 280 134758400 2800
105731973 maroonrk D Jan. 28, 2021, 3:25 p.m. OK GNU C++17 (64) TESTS 49 530 31539200 2800
105800366 RiverHamster D Jan. 29, 2021, 3:54 a.m. OK GNU C++17 (64) TESTS 49 530 120627200 2800
105782276 IgorI D Jan. 28, 2021, 7:28 p.m. OK GNU C++17 (64) TESTS 49 592 66764800 2800
105745290 jiangly D Jan. 28, 2021, 3:54 p.m. OK GNU C++17 (64) TESTS 49 592 68710400 2800
105755022 noimi D Jan. 28, 2021, 4:17 p.m. OK GNU C++17 (64) TESTS 49 655 60825600 2800
105755294 tourist D Jan. 28, 2021, 4:18 p.m. OK GNU C++17 (64) TESTS 49 655 83046400 2800
105770891 sugarrr D Jan. 28, 2021, 5:27 p.m. OK GNU C++17 (64) TESTS 49 655 121548800 2800
105801463 tute7627 D Jan. 29, 2021, 4:14 a.m. OK GNU C++17 (64) TESTS 49 670 75059200 2800
105736926 Swistakk D Jan. 28, 2021, 3:36 p.m. OK GNU C++17 (64) TESTS 49 685 82022400 2800
105770652 SecondThread D Jan. 28, 2021, 5:26 p.m. OK Java 11 TESTS 49 2573 193945600 2800

remove filters

Back to search problems