Codeforces Round 954 (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
1986 Codeforces Round 954 (Div. 3) FINISHED False 8100 18025763 June 23, 2024, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4782 ) F Non-academic Problem PROGRAMMING combinatorics dfs and similar ds graphs

B'You are given a connected undirected graph, the vertices of which are numbered with integers from 1 to n . Your task is to minimize the number of pairs of vertices 1 <= q u < v <= q n between which there exists a path in this graph. To achieve this, you can remove exactly one edge from the graph. Find the smallest number of pairs of vertices! Each test consists of several sets of input data. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of sets of input data. Then follows their description. The first line of each set of input data contains two integers n and m ( 2 <= q n <= q 10^5 , n - 1 <= q m <= q min(10^5, frac{n cdot (n - 1)}{2}) ) -- the number of vertices in the graph and the number of edges. Each of the next m lines contains two integers u and v ( 1 <= q u, v <= q n, u neq v ), indicating that there is an undirected edge in the graph between vertices u and v . It is guaranteed that the given graph is connected and without multiple edges. It is guaranteed that the sum of n and the sum of m over all sets of input data does not exceed 2 cdot 10^5 . For each set of input data, output the smallest number of pairs of reachable vertices, if exactly one edge can be removed. In the first set of input data, we will remove the single edge (1, 2) and the only pair of vertices (1, 2) will become unreachable from each other. In the second set of input data, no matter which edge we remove, all vertices will be reachable from each other. In the fourth set of input data, the graph looks like this initially. We will remove the edge (3, 4) and then the only reachable pairs of vertices will be (1, 2) , (1, 3) , (2, 3) , (4, 5) , (4, 6) , (5, 6) . In the sixth set of input data, the graph looks like this initially. After removing the edge (2, 4) , the graph will look like this. '...

Tutorials

130762

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
267112382 Wuyanru F June 24, 2024, 12:50 a.m. OK C++14 (GCC 6-32) TESTS 20 155 4915200
267110950 Junz_LJL F June 24, 2024, 12:15 a.m. OK C++14 (GCC 6-32) TESTS 20 155 72192000
267093169 yuyc F June 23, 2024, 7:07 p.m. OK C++14 (GCC 6-32) TESTS 20 171 6553600
267112407 HHH666666 F June 24, 2024, 12:50 a.m. OK C++14 (GCC 6-32) TESTS 20 171 6758400
267127650 GB11 F June 24, 2024, 4:54 a.m. OK C++14 (GCC 6-32) TESTS 20 171 7168000
267083298 yuyc F June 23, 2024, 5:35 p.m. OK C++14 (GCC 6-32) TESTS 20 171 8089600
267100331 fscy F June 23, 2024, 8:41 p.m. OK C++14 (GCC 6-32) TESTS 20 171 10854400
267075301 busy_programmer F June 23, 2024, 5:01 p.m. OK C++14 (GCC 6-32) TESTS 20 171 46592000
267098546 ilija_IR_13 F June 23, 2024, 8:15 p.m. OK C++14 (GCC 6-32) TESTS 20 186 15052800
267122014 sparsh301 F June 24, 2024, 3:44 a.m. OK C++14 (GCC 6-32) TESTS 20 202 7987200
267119516 Nanako7_ix F June 24, 2024, 3:08 a.m. OK C++17 (GCC 7-32) TESTS 20 139 8601600
267084705 X_Luo F June 23, 2024, 5:46 p.m. OK C++17 (GCC 7-32) TESTS 20 139 11468800
267092171 Icyecho F June 23, 2024, 6:56 p.m. OK C++17 (GCC 7-32) TESTS 20 140 7065600
267091557 hunter_l F June 23, 2024, 6:49 p.m. OK C++17 (GCC 7-32) TESTS 20 155 7475200
267117882 cow23 F June 24, 2024, 2:40 a.m. OK C++17 (GCC 7-32) TESTS 20 155 10137600
267131548 _Faineant F June 24, 2024, 5:41 a.m. OK C++17 (GCC 7-32) TESTS 20 156 6758400
267131559 Sparkle_Twilight F June 24, 2024, 5:41 a.m. OK C++17 (GCC 7-32) TESTS 20 171 6758400
267085401 vedant_vaidya_77 F June 23, 2024, 5:52 p.m. OK C++17 (GCC 7-32) TESTS 20 171 6758400
267082752 Amir1386n F June 23, 2024, 5:31 p.m. OK C++17 (GCC 7-32) TESTS 20 171 6963200
267112617 usaco_thrower F June 24, 2024, 12:55 a.m. OK C++17 (GCC 7-32) TESTS 20 171 8499200
267113476 8Conan8 F June 24, 2024, 1:15 a.m. OK C++20 (GCC 13-64) TESTS 20 109 12288000
267111479 N_z__ F June 24, 2024, 12:27 a.m. OK C++20 (GCC 13-64) TESTS 20 124 11673600
267123391 Z-301 F June 24, 2024, 4:02 a.m. OK C++20 (GCC 13-64) TESTS 20 124 12083200
267085638 Mafuyu F June 23, 2024, 5:54 p.m. OK C++20 (GCC 13-64) TESTS 20 124 18227200
267091503 sgrigoryan F June 23, 2024, 6:48 p.m. OK C++20 (GCC 13-64) TESTS 20 140 14643200
267131563 Tezcatlipoca F June 24, 2024, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 20 155 17203200
267097444 tiom4eg F June 23, 2024, 8:01 p.m. OK C++20 (GCC 13-64) TESTS 20 155 18022400
267103476 Enamul_Hasan85 F June 23, 2024, 9:33 p.m. OK C++20 (GCC 13-64) TESTS 20 155 25395200
267104863 ImSarthak F June 23, 2024, 9:59 p.m. OK C++20 (GCC 13-64) TESTS 20 156 14950400
267118711 Wangshushushu F June 24, 2024, 2:54 a.m. OK C++20 (GCC 13-64) TESTS 20 156 16588800
267080873 is_this_greedy F June 23, 2024, 5:19 p.m. OK Java 21 TESTS 20 656 39116800
267121093 _global F June 24, 2024, 3:31 a.m. OK Java 21 TESTS 20 656 40960000
267108695 IceWolf898 F June 23, 2024, 11:18 p.m. OK Java 21 TESTS 20 687 46592000
267094648 vermadv2000 F June 23, 2024, 7:25 p.m. OK Java 21 TESTS 20 781 54579200
267077066 Flick__ F June 23, 2024, 5:03 p.m. OK Java 21 TESTS 20 1015 62771200
267078103 pm_2 F June 23, 2024, 5:04 p.m. OK Java 21 TESTS 20 1546 57958400
267083698 Prime369 F June 23, 2024, 5:38 p.m. OK Java 8 TESTS 20 483 29081600
267085195 NerfThis F June 23, 2024, 5:50 p.m. OK Java 8 TESTS 20 687 44646400
267085906 SweetAsCocaine F June 23, 2024, 5:56 p.m. OK Java 8 TESTS 20 811 76595200
267083055 SweetAsCocaine F June 23, 2024, 5:33 p.m. OK Java 8 TESTS 20 889 76492800
267078926 vatsal_04 F June 23, 2024, 5:09 p.m. OK Java 8 TESTS 20 1655 115302400
267076379 shockwave_air F June 23, 2024, 5:02 p.m. OK PHP TESTS 20 437 162611200
267086582 mgoldy925 F June 23, 2024, 6:02 p.m. OK PyPy 3-64 TESTS 20 437 30310400
267106759 samoylovboris F June 23, 2024, 10:35 p.m. OK PyPy 3-64 TESTS 20 702 73113600
267083447 zarubin F June 23, 2024, 5:36 p.m. OK PyPy 3-64 TESTS 20 718 41574400
267109772 RobinFromTheHood F June 23, 2024, 11:44 p.m. OK PyPy 3-64 TESTS 20 734 216371200
267081292 zarubin F June 23, 2024, 5:22 p.m. OK PyPy 3-64 TESTS 20 749 47001600
267098719 citrinitas F June 23, 2024, 8:18 p.m. OK PyPy 3-64 TESTS 20 781 41369600
267081469 hokto F June 23, 2024, 5:23 p.m. OK PyPy 3-64 TESTS 20 1031 136499200
267090621 Ivan_Li F June 23, 2024, 6:38 p.m. OK PyPy 3-64 TESTS 20 1062 100454400
267087038 krism F June 23, 2024, 6:05 p.m. OK PyPy 3-64 TESTS 20 1296 107622400
267111413 KingofCSES F June 24, 2024, 12:26 a.m. OK Python 3 TESTS 20 1265 32972800
267108339 helli5.tech F June 23, 2024, 11:11 p.m. OK Python 3 TESTS 20 1374 32972800

remove filters

Back to search problems