Codeforces Round 686 (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
1454 Codeforces Round 686 (Div. 3) FINISHED False 7200 131037863 Nov. 24, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5925 ) E Number of Simple Paths PROGRAMMING combinatorics data structures dfs and similar ds graphs trees

B'You are given an undirected graph consisting of n vertices and n edges. It is guaranteed that the given graph is connected (i. e. it is possible to reach any vertex from any other vertex) and there are no self-loops and multiple edges in the graph. Your task is to calculate the number of simple paths of length at least 1 in the given graph. Note that paths that differ only by their direction are considered the same (i. e. you have to calculate the number of undirected paths). For example, paths [1, 2, 3] and [3, 2, 1] are considered the same. You have to answer t independent test cases. Recall that a path in the graph is a sequence of vertices v_1, v_2, ldots, v_k such that each pair of adjacent (consecutive) vertices in this sequence is connected by an edge. The length of the path is the number of edges in it. A simple path is such a path that all vertices in it are distinct. The first line of the input contains one integer t ( 1 <= t <= 2 cdot 10^4 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of vertices (and the number of edges) in the graph. The next n lines of the test case describe edges: edge i is given as a pair of vertices u_i , v_i ( 1 <= u_i, v_i <= n , u_i ne v_i ), where u_i and v_i are vertices the i -th edge connects. For each pair of vertices (u, v) , there is at most one edge between u and v . There are no edges from the vertex to itself. So, there are no self-loops and multiple edges in the graph. The graph is undirected, i. e. all its edges are bidirectional. The graph is connected, i. e. it is possible to reach any vertex from any other vertex by moving along the edges of the graph. It is guaranteed that the sum of n does not exceed 2 cdot 10^5 ( sum n <= 2 cdot 10^5$'...

Tutorials

Codeforces Round #686 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
99552352 lanChe E Nov. 25, 2020, 11:19 a.m. OK GNU C++11 TESTS 61 46 11264000
99551415 lanChe E Nov. 25, 2020, 11:08 a.m. OK GNU C++11 TESTS 61 61 11264000
99554387 greysheep E Nov. 25, 2020, 11:43 a.m. OK GNU C++11 TESTS 61 62 6451200
99551669 vjudge1 E Nov. 25, 2020, 11:11 a.m. OK GNU C++11 TESTS 61 62 11264000
99600822 sorry_thebighead E Nov. 26, 2020, 1:05 a.m. OK GNU C++11 TESTS 61 62 14028800
99520850 fishcathu. E Nov. 25, 2020, 4:13 a.m. OK GNU C++11 TESTS 61 62 14438400
99609188 Maybach E Nov. 26, 2020, 5:25 a.m. OK GNU C++11 TESTS 61 62 20992000
99553391 Daneii E Nov. 25, 2020, 11:31 a.m. OK GNU C++11 TESTS 61 77 11264000
99571159 xajd1906 E Nov. 25, 2020, 2:53 p.m. OK GNU C++11 TESTS 61 78 13209600
99553270 yu__xuan E Nov. 25, 2020, 11:29 a.m. OK GNU C++11 TESTS 61 93 6451200
99600929 diaofenyihao E Nov. 26, 2020, 1:11 a.m. OK GNU C++14 TESTS 61 124 13107200
99600888 diaofenyihao E Nov. 26, 2020, 1:08 a.m. OK GNU C++14 TESTS 61 124 13107200
99536788 num73 E Nov. 25, 2020, 8:09 a.m. OK GNU C++14 TESTS 61 124 43520000
99552372 vjudge3 E Nov. 25, 2020, 11:19 a.m. OK GNU C++14 TESTS 61 139 6041600
99518068 CrayonKe E Nov. 25, 2020, 3:10 a.m. OK GNU C++14 TESTS 61 140 13004800
99574983 AcFunHL E Nov. 25, 2020, 3:28 p.m. OK GNU C++14 TESTS 61 155 9420800
99581694 KYoA_A E Nov. 25, 2020, 4:38 p.m. OK GNU C++14 TESTS 61 155 16179200
99552776 Tech_shot E Nov. 25, 2020, 11:24 a.m. OK GNU C++14 TESTS 61 171 9216000
99592629 szymi E Nov. 25, 2020, 7:39 p.m. OK GNU C++14 TESTS 61 171 9932800
99557814 _HonEy E Nov. 25, 2020, 12:21 p.m. OK GNU C++14 TESTS 61 171 10752000
99559881 hunxuewangzi E Nov. 25, 2020, 12:43 p.m. OK GNU C++17 TESTS 61 124 8192000
99603227 yueyuanzhiyyz E Nov. 26, 2020, 2:38 a.m. OK GNU C++17 TESTS 61 124 16384000
99557761 Irene E Nov. 25, 2020, 12:21 p.m. OK GNU C++17 TESTS 61 124 18636800
99560788 study_ing E Nov. 25, 2020, 12:53 p.m. OK GNU C++17 TESTS 61 139 8806400
99548120 acm_log E Nov. 25, 2020, 10:28 a.m. OK GNU C++17 TESTS 61 140 6041600
99554171 Loser_Five E Nov. 25, 2020, 11:40 a.m. OK GNU C++17 TESTS 61 140 6656000
99539252 Yang_Lin E Nov. 25, 2020, 8:41 a.m. OK GNU C++17 TESTS 61 140 6860800
99602084 study_ing E Nov. 26, 2020, 1:56 a.m. OK GNU C++17 TESTS 61 140 8806400
99518039 loulingli E Nov. 25, 2020, 3:09 a.m. OK GNU C++17 TESTS 61 155 6656000
99603910 o0O0o0O0o0O0o E Nov. 26, 2020, 2:59 a.m. OK GNU C++17 TESTS 61 155 7270400
99589008 vk48962713 E Nov. 25, 2020, 6:29 p.m. OK GNU C++17 (64) TESTS 61 155 27648000
99515190 pacha2880 E Nov. 25, 2020, 1:50 a.m. OK GNU C++17 (64) TESTS 61 155 32460800
99545941 raven.cpp E Nov. 25, 2020, 10 a.m. OK GNU C++17 (64) TESTS 61 171 12492800
99522088 shibaka E Nov. 25, 2020, 4:37 a.m. OK GNU C++17 (64) TESTS 61 171 29696000
99512001 lucifer1004 E Nov. 24, 2020, 11:28 p.m. OK GNU C++17 (64) TESTS 61 171 29696000
99565174 forceac E Nov. 25, 2020, 1:45 p.m. OK GNU C++17 (64) TESTS 61 171 32870400
99568845 Ayalla E Nov. 25, 2020, 2:30 p.m. OK GNU C++17 (64) TESTS 61 171 33792000
99536416 indubitable E Nov. 25, 2020, 8:04 a.m. OK GNU C++17 (64) TESTS 61 171 34099200
99516663 Coki628 E Nov. 25, 2020, 2:35 a.m. OK GNU C++17 (64) TESTS 61 171 35430400
99535900 tabae326 E Nov. 25, 2020, 7:57 a.m. OK GNU C++17 (64) TESTS 61 171 36864000
99528654 synapse E Nov. 25, 2020, 6:31 a.m. OK Go TESTS 61 358 15564800
99530027 Apass.Jack E Nov. 25, 2020, 6:47 a.m. OK Java 11 TESTS 61 560 35123200
99527822 gladwin_rojer E Nov. 25, 2020, 6:21 a.m. OK Java 11 TESTS 61 592 45977600
99529072 MystiQue_1 E Nov. 25, 2020, 6:36 a.m. OK Java 11 TESTS 61 608 68300800
99521221 sunnyguan E Nov. 25, 2020, 4:20 a.m. OK Java 11 TESTS 61 872 76697600
99509904 mphillotry E Nov. 24, 2020, 9:47 p.m. OK Java 11 TESTS 61 966 134246400
99547009 singh.ankit2117 E Nov. 25, 2020, 10:12 a.m. OK Java 11 TESTS 61 1279 57344000
99558900 jbera510 E Nov. 25, 2020, 12:33 p.m. OK Java 11 TESTS 61 1388 58265600
99593376 YahiaSherif E Nov. 25, 2020, 7:55 p.m. OK Java 8 TESTS 61 514 54476800
99534974 punit1999 E Nov. 25, 2020, 7:46 a.m. OK Java 8 TESTS 61 529 32051200
99546185 2u_my_light E Nov. 25, 2020, 10:03 a.m. OK Java 8 TESTS 61 530 41574400
99593134 godxpunk E Nov. 25, 2020, 7:50 p.m. OK Java 8 TESTS 61 545 53145600
99566999 harshitContest E Nov. 25, 2020, 2:08 p.m. OK Java 8 TESTS 61 545 64921600
99587363 revanthreddy85 E Nov. 25, 2020, 6:02 p.m. OK Java 8 TESTS 61 545 97996800
99535474 honeysingh18 E Nov. 25, 2020, 7:52 a.m. OK Java 8 TESTS 61 577 83968000
99559897 desp__beginner E Nov. 25, 2020, 12:43 p.m. OK Java 8 TESTS 61 623 76902400
99548050 desp__beginner E Nov. 25, 2020, 10:27 a.m. OK Java 8 TESTS 61 639 47206400
99539921 physai E Nov. 25, 2020, 8:48 a.m. OK Java 8 TESTS 61 717 127897600
99597516 tscha E Nov. 25, 2020, 10:10 p.m. OK Kotlin TESTS 61 1029 81203200
99597588 tscha E Nov. 25, 2020, 10:14 p.m. OK Kotlin TESTS 61 1045 79974400
99553155 SlavaG E Nov. 25, 2020, 11:28 a.m. OK Kotlin TESTS 61 1185 79360000
99583170 a1000 E Nov. 25, 2020, 5:01 p.m. OK Kotlin TESTS 61 1294 138547200
99578782 Accumulate_gradually E Nov. 25, 2020, 4:05 p.m. OK MS C++ 2017 TESTS 61 140 7475200
99512929 frelion E Nov. 25, 2020, 12:16 a.m. OK MS C++ 2017 TESTS 61 202 17305600
99509092 tarattata1 E Nov. 24, 2020, 9:17 p.m. OK MS C++ 2017 TESTS 61 202 19251200
99552016 dimasidorenko E Nov. 25, 2020, 11:15 a.m. OK MS C++ 2017 TESTS 61 389 13824000
99513705 rkdwlss2 E Nov. 25, 2020, 12:51 a.m. OK MS C++ 2017 TESTS 61 405 10444800
99546415 russian_proger E Nov. 25, 2020, 10:05 a.m. OK MS C++ 2017 TESTS 61 467 25088000
99558266 SlowDecay E Nov. 25, 2020, 12:26 p.m. OK Node.js TESTS 61 686 60108800
99556323 codershuvo E Nov. 25, 2020, 12:06 p.m. OK PyPy 3 TESTS 61 482 88576000
99565986 TheVan E Nov. 25, 2020, 1:55 p.m. OK PyPy 3 TESTS 61 592 35020800
99540903 nano145 E Nov. 25, 2020, 9 a.m. OK PyPy 3 TESTS 61 623 30310400
99543788 srijan.sarkar E Nov. 25, 2020, 9:33 a.m. OK PyPy 3 TESTS 61 686 25600000
99580087 deepak_ug E Nov. 25, 2020, 4:21 p.m. OK PyPy 3 TESTS 61 733 27340800
99582673 __eRRor__ E Nov. 25, 2020, 4:54 p.m. OK PyPy 3 TESTS 61 795 35328000
99544714 PratyaydeepG E Nov. 25, 2020, 9:44 a.m. OK PyPy 3 TESTS 61 889 88371200
99552153 aberent E Nov. 25, 2020, 11:17 a.m. OK PyPy 3 TESTS 61 1544 36454400
99589864 marroncastle E Nov. 25, 2020, 6:44 p.m. OK PyPy 3 TESTS 61 1808 38604800
99563498 myotra E Nov. 25, 2020, 1:25 p.m. OK PyPy 3 TESTS 61 1918 28057600
99515132 sushanthsamala E Nov. 25, 2020, 1:48 a.m. OK Python 3 TESTS 61 1544 55910400

remove filters

Back to search problems