Good Bye 2021: 2022 is NEAR

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
1616 Good Bye 2021: 2022 is NEAR FINISHED False 7200 91031099 Dec. 29, 2021, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 282 ) G Just Add an Edge PROGRAMMING dfs and similar dp graphs 3500

B'You are given a directed acyclic graph with n vertices and m edges. For all edges a to b in the graph, a < b holds. You need to find the number of pairs of vertices x , y , such that x > y and after adding the edge x to y to the graph, it has a Hamiltonian path. The first line of input contains one integer t ( 1 <= q t <= q 5 ): the number of test cases. The next lines contains the descriptions of the test cases. In the first line you are given two integers n and m ( 1 <= q n <= q 150 ,000 , 0 <= q m <= q min(150 ,000, frac{n(n-1)}{2}) ): the number of vertices and edges in the graph. Each of the next m lines contains two integers a , b ( 1 <= q a < b <= q n ), specifying an edge a to b in the graph. No edge a to b appears more than once. For each test case, print one integer: the number of pairs of vertices x , y , x > y , such that after adding the edge x to y to the graph, it has a Hamiltonian path. In the first example, any edge x to y such that x > y is valid, because there already is a path 1 to 2 to 3 . In the second example only the edge 4 to 1 is valid. There is a path 3 to 4 to 1 to 2 if this edge is added. In the third example you can add edges 2 to 1 , 3 to 1 , 4 to 1 , 4 to 2 . '...

Tutorials

Good Bye 2021 -- Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
141144476 hos.lyric G Dec. 30, 2021, 9:50 a.m. OK D TESTS 102 982 75366400 3500
141136676 hos.lyric G Dec. 30, 2021, 8:28 a.m. OK D TESTS 102 982 75366400 3500
141144331 hos.lyric G Dec. 30, 2021, 9:48 a.m. OK D TESTS 102 998 75468800 3500
141137816 ugly2333 G Dec. 30, 2021, 8:49 a.m. OK GNU C++14 TESTS 102 327 32153600 3500
141207221 137_345_2814 G Dec. 31, 2021, 2:24 a.m. OK GNU C++17 TESTS 102 280 5427200 3500
141175891 Anusha__123 G Dec. 30, 2021, 3:27 p.m. OK GNU C++17 TESTS 102 312 32153600 3500
141193928 ProfMYK G Dec. 30, 2021, 7:16 p.m. OK GNU C++17 TESTS 102 404 14540800 3500
141136712 QAQAutoMaton G Dec. 30, 2021, 8:29 a.m. OK GNU C++17 (64) TESTS 102 156 34406400 3500
141133386 ecnerwala G Dec. 29, 2021, 6:35 p.m. OK GNU C++17 (64) TESTS 102 233 6144000 3500
141133315 ecnerwala G Dec. 29, 2021, 6:34 p.m. OK GNU C++17 (64) TESTS 102 249 6144000 3500
141132484 ecnerwala G Dec. 29, 2021, 6:26 p.m. OK GNU C++17 (64) TESTS 102 249 10752000 3500
141133192 ecnerwala G Dec. 29, 2021, 6:33 p.m. OK GNU C++17 (64) TESTS 102 280 6963200 3500
141156317 Abdujalilodddd G Dec. 30, 2021, 11:55 a.m. OK GNU C++17 (64) TESTS 102 311 17612800 3500
141129976 Benq G Dec. 29, 2021, 6:08 p.m. OK GNU C++17 (64) TESTS 102 312 17612800 3500
141143018 wanyuezaifengli1 G Dec. 30, 2021, 9:32 a.m. OK GNU C++17 (64) TESTS 102 327 18432000 3500
141169609 maroonrk G Dec. 30, 2021, 2:15 p.m. OK GNU C++17 (64) TESTS 102 342 15769600 3500
141186930 nasrulloev G Dec. 30, 2021, 5:42 p.m. OK GNU C++20 (64) TESTS 102 265 17612800 3500
141138240 HideOneMan2002 G Dec. 30, 2021, 8:56 a.m. OK GNU C++20 (64) TESTS 102 312 22016000 3500
141129804 jiangly G Dec. 29, 2021, 6:07 p.m. OK GNU C++20 (64) TESTS 102 343 19968000 3500
141210278 thienclone89 G Dec. 31, 2021, 4:03 a.m. OK GNU C++20 (64) TESTS 102 889 5324800 3500
141177362 Krolo7 G Dec. 30, 2021, 3:45 p.m. OK GNU C++20 (64) TESTS 102 904 45465600 3500

remove filters

Back to search problems