Codeforces Round 743 (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
1572 Codeforces Round 743 (Div. 1) FINISHED False 7200 105290663 Sept. 18, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9265 ) A Book PROGRAMMING binary search data structures dp graphs implementation 1800

B"You are given a book with n chapters. Each chapter has a specified list of other chapters that need to be understood in order to understand this chapter. To understand a chapter, you must read it after you understand every chapter on its required list. Currently you don't understand any of the chapters. You are going to read the book from the beginning till the end repeatedly until you understand the whole book. Note that if you read a chapter at a moment when you don't understand some of the required chapters, you don't understand this chapter. Determine how many times you will read the book to understand every chapter, or determine that you will never understand every chapter no matter how many times you read the book. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 2 cdot10^4 ). The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot10^5 ) -- number of chapters. Then n lines follow. The i -th line begins with an integer k_i ( 0 <= k_i <= n-1 ) -- number of chapters required to understand the i -th chapter. Then k_i integers a_{i,1}, a_{i,2}, ... , a_{i, k_i} ( 1 <= a_{i, j} <= n, a_{i, j} ne i, a_{i, j} ne a_{i, l} for j ne l ) follow -- the chapters required to understand the i -th chapter. It is guaranteed that the sum of n and sum of k_i over all testcases do not exceed 2 cdot10^5 . For each test case, if the entire book can be understood, print how many times you will read it, otherwise print -1 . In the first example, we will understand chapters {2, 4 } in the first reading and chapters {1, 3 } in the second reading of the book. In the second example, every chapter requires the understanding of some other chapter, so it is impossible to understand the book. In the third example, every chapter requires only chapters that appear earlier in the b"...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
129181245 hos.lyric A Sept. 18, 2021, 2:55 p.m. OK D TESTS 16 171 19865600 1800
129176286 marcOS A Sept. 18, 2021, 2:47 p.m. OK GNU C++14 TESTS 16 108 12697600 1800
129192707 daydream. A Sept. 18, 2021, 3:25 p.m. OK GNU C++14 TESTS 16 109 10240000 1800
129171056 BeyondHeaven A Sept. 18, 2021, 2:41 p.m. OK GNU C++14 TESTS 16 109 11776000 1800
129173514 hieu_2004 A Sept. 18, 2021, 2:44 p.m. OK GNU C++14 TESTS 16 109 12288000 1800
129174696 Kaitokid A Sept. 18, 2021, 2:45 p.m. OK GNU C++14 TESTS 16 109 13107200 1800
129177312 syksykCCC A Sept. 18, 2021, 2:48 p.m. OK GNU C++14 TESTS 16 109 13107200 1800
129176912 walk_alone A Sept. 18, 2021, 2:48 p.m. OK GNU C++14 TESTS 16 124 9318400 1800
129173896 Hollowed A Sept. 18, 2021, 2:44 p.m. OK GNU C++14 TESTS 16 124 10240000 1800
129171658 ugly2333 A Sept. 18, 2021, 2:42 p.m. OK GNU C++14 TESTS 16 124 10854400 1800
129193696 tkxkd A Sept. 18, 2021, 3:29 p.m. OK GNU C++14 TESTS 16 124 10956800 1800
129174559 fallleaves01 A Sept. 18, 2021, 2:45 p.m. OK GNU C++17 TESTS 16 46 10240000 1800
129168038 izone A Sept. 18, 2021, 2:38 p.m. OK GNU C++17 TESTS 16 78 11059200 1800
129174304 I_love_QMsh A Sept. 18, 2021, 2:45 p.m. OK GNU C++17 TESTS 16 93 12595200 1800
129214050 Dr.Mentalist A Sept. 18, 2021, 6:55 p.m. OK GNU C++17 TESTS 16 93 13209600 1800
129176713 Backseat-Stargazer A Sept. 18, 2021, 2:47 p.m. OK GNU C++17 TESTS 16 93 15360000 1800
129173444 foolishgoat A Sept. 18, 2021, 2:44 p.m. OK GNU C++17 TESTS 16 108 11776000 1800
129169426 darkkcyan A Sept. 18, 2021, 2:40 p.m. OK GNU C++17 TESTS 16 108 13107200 1800
129173140 sam.rei A Sept. 18, 2021, 2:44 p.m. OK GNU C++17 TESTS 16 108 13312000 1800
129187969 0x24 A Sept. 18, 2021, 3:11 p.m. OK GNU C++17 TESTS 16 108 14336000 1800
129172424 AliShahali1382 A Sept. 18, 2021, 2:43 p.m. OK GNU C++17 TESTS 16 108 18841600 1800
129200667 LiChenKoh A Sept. 18, 2021, 4:04 p.m. OK GNU C++17 (64) TESTS 16 77 13619200 1800
129184851 codelegend A Sept. 18, 2021, 3:03 p.m. OK GNU C++17 (64) TESTS 16 93 18022400 1800
129170956 -is-this-fft- A Sept. 18, 2021, 2:41 p.m. OK GNU C++17 (64) TESTS 16 93 19865600 1800
129177530 MAKMED1337 A Sept. 18, 2021, 2:49 p.m. OK GNU C++17 (64) TESTS 16 93 20582400 1800
129170978 yosupo A Sept. 18, 2021, 2:41 p.m. OK GNU C++17 (64) TESTS 16 93 24268800 1800
129180829 gyh20 A Sept. 18, 2021, 2:55 p.m. OK GNU C++17 (64) TESTS 16 93 33280000 1800
129172066 LayCurse A Sept. 18, 2021, 2:42 p.m. OK GNU C++17 (64) TESTS 16 93 110387200 1800
129169464 paulll A Sept. 18, 2021, 2:40 p.m. OK GNU C++17 (64) TESTS 16 108 13619200 1800
129170785 olphe A Sept. 18, 2021, 2:41 p.m. OK GNU C++17 (64) TESTS 16 108 13619200 1800
129178933 Akulyat A Sept. 18, 2021, 2:51 p.m. OK GNU C++17 (64) TESTS 16 108 18124800 1800
129189706 clyring A Sept. 18, 2021, 3:16 p.m. OK Haskell TESTS 16 358 28467200 1800
129177030 dalt A Sept. 18, 2021, 2:48 p.m. OK Java 11 TESTS 16 389 44441600 1800
129172132 SergeyMelnikov A Sept. 18, 2021, 2:43 p.m. OK Java 11 TESTS 16 405 58675200 1800
129221902 tushar19280 A Sept. 18, 2021, 10:38 p.m. OK Java 11 TESTS 16 561 52838400 1800
129193053 Hemose A Sept. 18, 2021, 3:26 p.m. OK Java 11 TESTS 16 561 57856000 1800
129181173 dusty.and.rusty A Sept. 18, 2021, 2:55 p.m. OK Java 11 TESTS 16 592 49356800 1800
129222518 codicon A Sept. 18, 2021, 11:19 p.m. OK Java 11 TESTS 16 592 57548800 1800
129222077 _Body A Sept. 18, 2021, 10:48 p.m. OK Java 11 TESTS 16 592 62873600 1800
129185208 Apfeloxid A Sept. 18, 2021, 3:04 p.m. OK Java 11 TESTS 16 623 64307200 1800
129201314 bobib A Sept. 18, 2021, 4:07 p.m. OK Java 11 TESTS 16 686 92672000 1800
129188229 mphillotry A Sept. 18, 2021, 3:12 p.m. OK Java 11 TESTS 16 733 53452800 1800
129201032 fetetriste A Sept. 18, 2021, 4:05 p.m. OK Java 8 TESTS 16 187 20480000 1800
129173865 TheSawan A Sept. 18, 2021, 2:44 p.m. OK Java 8 TESTS 16 202 25088000 1800
129197159 NighTurs A Sept. 18, 2021, 3:46 p.m. OK Java 8 TESTS 16 264 53657600 1800
129200058 DarLam A Sept. 18, 2021, 4:01 p.m. OK Java 8 TESTS 16 280 28467200 1800
129175417 medude A Sept. 18, 2021, 2:46 p.m. OK Java 8 TESTS 16 343 56115200 1800
129179401 AdhmMohamed A Sept. 18, 2021, 2:52 p.m. OK Java 8 TESTS 16 499 58163200 1800
129176069 YahiaSherif A Sept. 18, 2021, 2:47 p.m. OK Java 8 TESTS 16 576 52736000 1800
129182050 martins A Sept. 18, 2021, 2:57 p.m. OK Java 8 TESTS 16 685 69836800 1800
129179305 jxin31415 A Sept. 18, 2021, 2:52 p.m. OK Java 8 TESTS 16 732 75059200 1800
129226780 Spheniscine A Sept. 19, 2021, 2:20 a.m. OK Kotlin TESTS 16 342 38604800 1800
129186879 Hakiobo A Sept. 18, 2021, 3:08 p.m. OK Kotlin TESTS 16 405 41676800 1800
129173812 arvindf232 A Sept. 18, 2021, 2:44 p.m. OK Kotlin TESTS 16 514 63692800 1800
129173154 Tlatoani A Sept. 18, 2021, 2:44 p.m. OK Kotlin TESTS 16 639 54169600 1800
129177616 r57shell A Sept. 18, 2021, 2:49 p.m. OK MS C++ 2017 TESTS 16 218 11980800 1800
129178278 forest A Sept. 18, 2021, 2:50 p.m. OK MS C++ 2017 TESTS 16 343 12595200 1800
129196109 machine_solution A Sept. 18, 2021, 3:40 p.m. OK MS C++ 2017 TESTS 16 733 20582400 1800
129174706 terry_u16 A Sept. 18, 2021, 2:45 p.m. OK .NET Core C# TESTS 16 218 28160000 1800
129177233 Yupiteru A Sept. 18, 2021, 2:48 p.m. OK .NET Core C# TESTS 16 717 96768000 1800
129179425 riantkb A Sept. 18, 2021, 2:52 p.m. OK .NET Core C# TESTS 16 779 88268800 1800
129170086 asdsasd A Sept. 18, 2021, 2:41 p.m. OK PyPy 3 TESTS 16 560 40038400 1800
129188373 tamato A Sept. 18, 2021, 3:12 p.m. OK PyPy 3 TESTS 16 561 35635200 1800
129186852 neterukun A Sept. 18, 2021, 3:08 p.m. OK PyPy 3 TESTS 16 561 50278400 1800
129195065 SPD_9X2 A Sept. 18, 2021, 3:35 p.m. OK PyPy 3 TESTS 16 592 39731200 1800
129171057 chinerist A Sept. 18, 2021, 2:41 p.m. OK PyPy 3 TESTS 16 654 49561600 1800
129205233 titia A Sept. 18, 2021, 4:26 p.m. OK PyPy 3 TESTS 16 655 39424000 1800
129204616 FlakeLCR A Sept. 18, 2021, 4:22 p.m. OK PyPy 3 TESTS 16 701 63180800 1800
129209376 eepsilon A Sept. 18, 2021, 5:45 p.m. OK PyPy 3 TESTS 16 857 67993600 1800
129183186 cocopalm A Sept. 18, 2021, 2:59 p.m. OK PyPy 3 TESTS 16 873 63078400 1800
129177486 FruminousBandersnatch A Sept. 18, 2021, 2:48 p.m. OK PyPy 3 TESTS 16 1231 95846400 1800
129177037 nwi A Sept. 18, 2021, 2:48 p.m. OK Python 2 TESTS 16 1497 33484800 1800
129181281 nebocco A Sept. 18, 2021, 2:55 p.m. OK Rust TESTS 16 77 13824000 1800
129227879 Spheniscine A Sept. 19, 2021, 2:56 a.m. OK Rust TESTS 16 109 10956800 1800
129199776 apilat A Sept. 18, 2021, 4 p.m. OK Rust TESTS 16 109 12697600 1800
129170372 sansen A Sept. 18, 2021, 2:41 p.m. OK Rust TESTS 16 124 13209600 1800
129230938 kobae964 A Sept. 19, 2021, 4:21 a.m. OK Rust TESTS 16 124 16691200 1800
129174550 kobae964 A Sept. 18, 2021, 2:45 p.m. OK Rust TESTS 16 140 16998400 1800
129181014 avm A Sept. 18, 2021, 2:55 p.m. OK Rust TESTS 16 202 16793600 1800
129174667 ngtkana A Sept. 18, 2021, 2:45 p.m. OK Rust TESTS 16 295 27545600 1800

remove filters

Back to search problems