Codeforces Round 435 (Div. 2)

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
862 Codeforces Round 435 (Div. 2) FINISHED False 7200 231692123 Sept. 19, 2017, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18912 ) B Mahmoud and Ehab and the bipartiteness PROGRAMMING dfs and similar graphs trees 1400

B"Mahmoud and Ehab continue their adventures! As everybody in the evil land knows, Dr. Evil likes bipartite graphs, especially trees. A tree is a connected acyclic graph. A bipartite graph is a graph, whose vertices can be partitioned into 2 sets in such a way, that for each edge (u, xe2 x80 x89v) that belongs to the graph, u and v belong to different sets. You can find more formal definitions of a tree and a bipartite graph in the notes section below. Dr. Evil gave Mahmoud and Ehab a tree consisting of n nodes and asked them to add edges to it in such a way, that the graph is still bipartite. Besides, after adding these edges the graph should be simple (doesn't contain loops or multiple edges). What is the maximum number of edges they can add? A loop is an edge, which connects a node with itself. Graph doesn't contain multiple edges when for each pair of nodes there is no more than one edge between them. A cycle and a loop aren't the same . The first line of input contains an integer n -- the number of nodes in the tree (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The next n xe2 x80 x89- xe2 x80 x891 lines contain integers u and v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89u, xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, u xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89v) -- the description of the edges of the tree. It's guaranteed that the given graph is a tree. Output one integer -- the maximum number of edges that Mahmoud and Ehab can add to the tree while fulfilling the conditions. Tree definition: https://en.wikipedia.org/wiki/Tree_(graph_theory) Bipartite graph definition: https://en.wikipedia.org/wiki/Bipartite_graph In the first test case the only edge that can be added in such a way, that graph won't contain loops or multiple edges is (2, xe2 x80 x893), but adding this edge will make the graph non-bipartite so the answer is 0. In the second test case Mahmoud and Ehab can add edges (1, xe2 x80 x894) and (2, xe2 x80 x895). "...

Tutorials

Codeforces round #435 editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
30511697 KagamiharaNadeshiko B Sept. 19, 2017, 3:49 p.m. OK FPC TESTS 36 46 2867200 1400
30511458 __peossp B Sept. 19, 2017, 3:48 p.m. OK FPC TESTS 36 61 4403200 1400
30511704 mengqqQQ B Sept. 19, 2017, 3:49 p.m. OK FPC TESTS 36 61 6451200 1400
30515732 Qambitions B Sept. 19, 2017, 4:16 p.m. OK FPC TESTS 36 62 14233600 1400
61529995 YQL B Sept. 30, 2019, 2:18 a.m. OK FPC TESTS 36 77 4403200 1400
30630746 NikitaOrsha B Sept. 23, 2017, 5:28 a.m. OK FPC TESTS 36 78 5939200 1400
30509143 kmc1987g2002 B Sept. 19, 2017, 3:35 p.m. OK FPC TESTS 36 78 8704000 1400
42097272 TShT B Aug. 25, 2018, 5:08 p.m. OK FPC TESTS 36 78 16588800 1400
30952264 Vasyl_Protsiv B Oct. 2, 2017, 7:43 p.m. OK GNU C TESTS 36 46 5734400 1400
30517718 Yash_Agarwal B Sept. 19, 2017, 4:31 p.m. OK GNU C TESTS 36 61 7065600 1400
30512689 codemart786 B Sept. 19, 2017, 3:55 p.m. OK GNU C TESTS 36 62 5836800 1400
31986469 lucasolivamorim B Nov. 2, 2017, 4:39 p.m. OK GNU C TESTS 36 62 7475200 1400
30511641 narang9958875313 B Sept. 19, 2017, 3:49 p.m. OK GNU C TESTS 36 62 8601600 1400
30526778 MarcosK B Sept. 19, 2017, 6:58 p.m. OK GNU C TESTS 36 93 9830400 1400
30667548 Magolor B Sept. 24, 2017, 2:01 p.m. OK GNU C++ TESTS 36 15 5632000 1400
30617351 shyf1301 B Sept. 22, 2017, 2:29 p.m. OK GNU C++ TESTS 36 15 5632000 1400
30667559 vjudge5 B Sept. 24, 2017, 2:02 p.m. OK GNU C++ TESTS 36 30 5632000 1400
30693022 Matrix256 B Sept. 25, 2017, 1:06 a.m. OK GNU C++ TESTS 36 31 4608000 1400
31269296 Scut82 B Oct. 13, 2017, 8:53 a.m. OK GNU C++ TESTS 36 31 6860800 1400
34922371 NicoDafaGood B Feb. 4, 2018, 12:13 p.m. OK GNU C++ TESTS 36 31 7270400 1400
35666162 vjudge2 B Feb. 25, 2018, 2:20 a.m. OK GNU C++ TESTS 36 31 7782400 1400
38992053 hhr B June 6, 2018, 10:49 a.m. OK GNU C++ TESTS 36 31 14745600 1400
30576335 vjudge2 B Sept. 21, 2017, noon OK GNU C++ TESTS 36 46 1638400 1400
30511139 litianfeng B Sept. 19, 2017, 3:46 p.m. OK GNU C++ TESTS 36 46 2150400 1400
37865276 Hyeokshin B May 3, 2018, 2:35 p.m. OK GNU C11 TESTS 36 62 9728000 1400
31188928 a799091501 B Oct. 10, 2017, 12:10 p.m. OK GNU C++11 TESTS 36 30 8499200 1400
30749901 TUncleWangT B Sept. 26, 2017, 12:13 p.m. OK GNU C++11 TESTS 36 30 12083200 1400
45409124 DB.LesterLv B Nov. 7, 2018, 11:15 a.m. OK GNU C++11 TESTS 36 31 4198400 1400
30531956 hymscoty B Sept. 20, 2017, 1:14 a.m. OK GNU C++11 TESTS 36 31 5632000 1400
44528655 luogu_bot2 B Oct. 19, 2018, 5:03 a.m. OK GNU C++11 TESTS 36 31 6553600 1400
46900644 Refpqwq B Dec. 11, 2018, 11:46 a.m. OK GNU C++11 TESTS 36 31 7680000 1400
54968549 bojverdict2 B June 2, 2019, 7:33 a.m. OK GNU C++11 TESTS 36 31 8908800 1400
30639387 s_a_b_e_r B Sept. 23, 2017, 11:15 a.m. OK GNU C++11 TESTS 36 31 10240000 1400
55707852 FAQmother B June 18, 2019, 8:37 a.m. OK GNU C++11 TESTS 36 31 11673600 1400
55319446 bojverdict1 B June 9, 2019, 2:58 a.m. OK GNU C++11 TESTS 36 46 2867200 1400
32013073 vjudge1 B Nov. 3, 2017, 4:06 p.m. OK GNU C++14 TESTS 36 46 3379200 1400
63556371 vjudge3 B Oct. 27, 2019, 1 p.m. OK GNU C++14 TESTS 36 46 4915200 1400
30756609 Mr.Death.Hunk B Sept. 26, 2017, 4:18 p.m. OK GNU C++14 TESTS 36 46 5324800 1400
30591117 LeeHolmes B Sept. 21, 2017, 4:27 p.m. OK GNU C++14 TESTS 36 46 5734400 1400
30541961 liu397688551 B Sept. 20, 2017, 10:54 a.m. OK GNU C++14 TESTS 36 46 6041600 1400
52556860 memorXie B April 10, 2019, 8:14 a.m. OK GNU C++14 TESTS 36 46 6041600 1400
30516171 Anxdada B Sept. 19, 2017, 4:19 p.m. OK GNU C++14 TESTS 36 46 6144000 1400
32627524 monarch.130 B Nov. 24, 2017, 4:59 p.m. OK GNU C++14 TESTS 36 46 7475200 1400
30541555 jeffreyzfq B Sept. 20, 2017, 10:37 a.m. OK GNU C++14 TESTS 36 46 30003200 1400
30627554 Lanceriet B Sept. 23, 2017, 12:42 a.m. OK GNU C++14 TESTS 36 61 3072000 1400
53471859 vjudge5 B April 28, 2019, 1:15 p.m. OK GNU C++17 TESTS 36 61 1945600 1400
63421676 vjudge3 B Oct. 26, 2019, 6:36 a.m. OK GNU C++17 TESTS 36 61 8499200 1400
44525307 vjudge4 B Oct. 19, 2018, 1:40 a.m. OK GNU C++17 TESTS 36 61 20377600 1400
50277832 vjudge4 B Feb. 21, 2019, 11:11 a.m. OK GNU C++17 TESTS 36 62 2048000 1400
50276374 vjudge3 B Feb. 21, 2019, 10:14 a.m. OK GNU C++17 TESTS 36 62 2764800 1400
50278102 vjudge3 B Feb. 21, 2019, 11:19 a.m. OK GNU C++17 TESTS 36 62 4608000 1400
64843878 vjudge4 B Nov. 13, 2019, 5:01 p.m. OK GNU C++17 TESTS 36 62 4812800 1400
62199785 -B1nary- B Oct. 9, 2019, 11:45 a.m. OK GNU C++17 TESTS 36 62 5222400 1400
65018003 vjudge2 B Nov. 15, 2019, 5:17 a.m. OK GNU C++17 TESTS 36 62 5632000 1400
47108212 ouyeye B Dec. 16, 2018, 2:06 p.m. OK GNU C++17 TESTS 36 62 5632000 1400
30510494 smalex69 B Sept. 19, 2017, 3:42 p.m. OK Go TESTS 36 78 25600000 1400
46189505 davidguandev B Nov. 25, 2018, 3:24 a.m. OK Go TESTS 36 171 23142400 1400
30521766 sl0th B Sept. 19, 2017, 5:01 p.m. OK Haskell TESTS 36 295 33792000 1400
31984353 daniboybye B Nov. 2, 2017, 3:13 p.m. OK Haskell TESTS 36 421 51712000 1400
34835536 retrograd B Feb. 2, 2018, 11:25 a.m. OK Haskell TESTS 36 1060 111206400 1400
34835223 retrograd B Feb. 2, 2018, 11:12 a.m. OK Haskell TESTS 36 1544 116428800 1400
30578651 AndreiNet B Sept. 21, 2017, 1:13 p.m. OK Haskell TESTS 36 1964 110489600 1400
30578776 AndreiNet B Sept. 21, 2017, 1:17 p.m. OK Haskell TESTS 36 1996 110489600 1400
63679170 jujubiabc B Oct. 28, 2019, 7:19 p.m. OK Java 11 TESTS 36 654 21606400 1400
65544176 jenish9599 B Nov. 22, 2019, 4:34 p.m. OK Java 8 TESTS 36 139 2355200 1400
53196160 StayAwayFromBitches B April 23, 2019, 3:25 p.m. OK Java 8 TESTS 36 139 2764800 1400
38349771 In_The_Name_Of_Love B May 17, 2018, 1:06 p.m. OK Java 8 TESTS 36 140 0 1400
30527096 coderbond007 B Sept. 19, 2017, 7:11 p.m. OK Java 8 TESTS 36 140 0 1400
31487310 prabhat236218 B Oct. 18, 2017, 4:25 p.m. OK Java 8 TESTS 36 140 60825600 1400
31003834 tyuan73 B Oct. 4, 2017, 10:01 p.m. OK Java 8 TESTS 36 155 0 1400
30529672 Saturnman B Sept. 19, 2017, 9:23 p.m. OK Java 8 TESTS 36 155 102400 1400
30692128 m.levin B Sept. 24, 2017, 11:16 p.m. OK Java 8 TESTS 36 171 0 1400
30624373 orailly B Sept. 22, 2017, 7:39 p.m. OK Java 8 TESTS 36 171 0 1400
31003674 tyuan73 B Oct. 4, 2017, 9:44 p.m. OK Java 8 TESTS 36 171 0 1400
62426769 david_varela B Oct. 12, 2019, 2:31 p.m. OK Kotlin TESTS 36 623 25907200 1400
30510501 kuuso B Sept. 19, 2017, 3:42 p.m. OK Mono C# TESTS 36 186 14131200 1400
50902042 nemars B March 6, 2019, 5:54 p.m. OK Mono C# TESTS 36 264 25497600 1400
30515272 valekru B Sept. 19, 2017, 4:13 p.m. OK Mono C# TESTS 36 326 22118400 1400
30524885 og.kostya B Sept. 19, 2017, 5:58 p.m. OK MS C# TESTS 36 93 13209600 1400
30532735 54ashishbrt B Sept. 20, 2017, 2:22 a.m. OK MS C# TESTS 36 109 13107200 1400
30523572 Zvigintsev B Sept. 19, 2017, 5:35 p.m. OK MS C# TESTS 36 155 17920000 1400
30611298 Liran B Sept. 22, 2017, 10:15 a.m. OK MS C# TESTS 36 171 16793600 1400
30510942 fr0st B Sept. 19, 2017, 3:45 p.m. OK MS C# TESTS 36 171 17715200 1400
30549528 SmileA B Sept. 20, 2017, 2:55 p.m. OK MS C# TESTS 36 187 13107200 1400
30597656 konsiljere B Sept. 21, 2017, 7:02 p.m. OK MS C# TESTS 36 187 15462400 1400
30627671 yura_dz B Sept. 23, 2017, 1:02 a.m. OK MS C# TESTS 36 187 18124800 1400
30513732 AdMiRaLL B Sept. 19, 2017, 4:02 p.m. OK MS C# TESTS 36 218 15462400 1400
30527382 hloya B Sept. 19, 2017, 7:21 p.m. OK MS C# TESTS 36 233 17817600 1400
32336240 scorpiowf B Nov. 15, 2017, 3:43 p.m. OK MS C++ TESTS 36 46 4096000 1400
47108241 vjudge2 B Dec. 16, 2018, 2:07 p.m. OK MS C++ TESTS 36 46 4403200 1400
50276558 vjudge2 B Feb. 21, 2019, 10:23 a.m. OK MS C++ TESTS 36 46 4505600 1400
31601484 tyf0530 B Oct. 22, 2017, 11:09 a.m. OK MS C++ TESTS 36 46 7577600 1400
51109989 vjudge4 B March 10, 2019, 3:31 a.m. OK MS C++ TESTS 36 46 17510400 1400
35665895 vjudge3 B Feb. 25, 2018, 1:55 a.m. OK MS C++ TESTS 36 46 23552000 1400
47159199 vjudge4 B Dec. 17, 2018, 8:48 a.m. OK MS C++ TESTS 36 61 5222400 1400
34435492 vjudge2 B Jan. 22, 2018, 6:54 a.m. OK MS C++ TESTS 36 61 7577600 1400
50301133 vjudge2 B Feb. 22, 2019, 2:20 a.m. OK MS C++ TESTS 36 62 3379200 1400
64894150 vjudge3 B Nov. 14, 2019, 3:52 p.m. OK MS C++ TESTS 36 62 4403200 1400
64888449 vjudge4 B Nov. 14, 2019, 1:53 p.m. OK MS C++ 2017 TESTS 36 62 4198400 1400
54508407 buyolitsez B May 23, 2019, 5:40 a.m. OK MS C++ 2017 TESTS 36 186 7987200 1400
51204680 TiAnNing_DUMU B March 12, 2019, 3:42 a.m. OK MS C++ 2017 TESTS 36 187 5017600 1400
54349986 vshirochenko B May 18, 2019, 2:19 p.m. OK MS C++ 2017 TESTS 36 187 5120000 1400
49937781 nomiku99 B Feb. 15, 2019, 8:08 a.m. OK MS C++ 2017 TESTS 36 202 5222400 1400
63513845 vsulovyev B Oct. 26, 2019, 10:18 p.m. OK MS C++ 2017 TESTS 36 202 5939200 1400
64324620 Uj_employee B Nov. 5, 2019, 4:50 p.m. OK MS C++ 2017 TESTS 36 202 5939200 1400
30560060 rsFalse B Sept. 20, 2017, 7:20 p.m. OK Perl TESTS 36 514 48947200 1400
30555587 rsFalse B Sept. 20, 2017, 6:19 p.m. OK Perl TESTS 36 670 46489600 1400
45337461 matheus.justino B Nov. 5, 2018, 6:26 p.m. OK PyPy 2 TESTS 36 421 19763200 1400
30512303 cgfs10000 B Sept. 19, 2017, 3:53 p.m. OK PyPy 2 TESTS 36 436 24780800 1400
30537408 anuj_shah B Sept. 20, 2017, 7:30 a.m. OK PyPy 2 TESTS 36 452 14028800 1400
30514410 osev B Sept. 19, 2017, 4:06 p.m. OK PyPy 2 TESTS 36 498 19660800 1400
39699115 pavankatta B June 27, 2018, 10:56 a.m. OK PyPy 2 TESTS 36 514 13209600 1400
30563572 WyattWismer B Sept. 21, 2017, 12:08 a.m. OK PyPy 2 TESTS 36 514 24473600 1400
46406353 noob77777 B Nov. 30, 2018, 2:48 p.m. OK PyPy 2 TESTS 36 514 24576000 1400
30528516 nealzane B Sept. 19, 2017, 8:08 p.m. OK PyPy 2 TESTS 36 561 15974400 1400
30564878 wolffd B Sept. 21, 2017, 1:08 a.m. OK PyPy 2 TESTS 36 623 29388800 1400
49205134 soumyasarkar1998 B Jan. 30, 2019, 1:40 p.m. OK PyPy 2 TESTS 36 763 13926400 1400
58091380 chaudhary_19 B July 31, 2019, 5:42 p.m. OK PyPy 3 TESTS 36 436 17715200 1400
56664599 tchr B July 7, 2019, 10:52 a.m. OK PyPy 3 TESTS 36 967 15974400 1400
62315911 kopok2 B Oct. 10, 2019, 3:17 p.m. OK PyPy 3 TESTS 36 997 25190400 1400
60346250 deadguy B Sept. 10, 2019, 12:41 p.m. OK PyPy 3 TESTS 36 1029 22937600 1400
58369596 p_ritu B Aug. 6, 2019, 6 a.m. OK PyPy 3 TESTS 36 1060 16691200 1400
58369564 p_ritu B Aug. 6, 2019, 5:59 a.m. OK PyPy 3 TESTS 36 1075 14028800 1400
30658069 Marii B Sept. 24, 2017, 6:35 a.m. OK PyPy 3 TESTS 36 1122 13209600 1400
30541368 kishertka B Sept. 20, 2017, 10:30 a.m. OK PyPy 3 TESTS 36 1170 16896000 1400
33486004 SerChirag B Dec. 21, 2017, 4:38 p.m. OK Python 2 TESTS 36 498 33792000 1400
30697455 ytz123 B Sept. 25, 2017, 7:19 a.m. OK Python 2 TESTS 36 499 12902400 1400
44456237 vjudge2 B Oct. 17, 2018, 6 p.m. OK Python 2 TESTS 36 499 17203200 1400
44456217 GabrielN B Oct. 17, 2018, 6 p.m. OK Python 2 TESTS 36 514 17203200 1400
30510082 dwij28 B Sept. 19, 2017, 3:40 p.m. OK Python 2 TESTS 36 561 13721600 1400
30512399 songzy12 B Sept. 19, 2017, 3:54 p.m. OK Python 2 TESTS 36 576 24678400 1400
39681255 Ali_Pi B June 26, 2018, 4:42 p.m. OK Python 2 TESTS 36 577 12902400 1400
30512050 packwolf B Sept. 19, 2017, 3:51 p.m. OK Python 2 TESTS 36 592 16281600 1400
30512026 aniket3167 B Sept. 19, 2017, 3:51 p.m. OK Python 2 TESTS 36 607 15564800 1400
31131850 WNG B Oct. 8, 2017, 3:50 a.m. OK Python 2 TESTS 36 607 31436800 1400
30596796 orailly B Sept. 21, 2017, 6:27 p.m. OK Python 3 TESTS 36 452 12492800 1400
47521283 jaaguptamme B Dec. 26, 2018, 1:13 p.m. OK Python 3 TESTS 36 498 11776000 1400
58091329 chaudhary_19 B July 31, 2019, 5:41 p.m. OK Python 3 TESTS 36 498 16588800 1400
54263931 shivammishra B May 17, 2019, 4:27 a.m. OK Python 3 TESTS 36 514 11366400 1400
51571860 echikawa B March 20, 2019, 11:50 a.m. OK Python 3 TESTS 36 514 12697600 1400
30687879 yugle7 B Sept. 24, 2017, 6:42 p.m. OK Python 3 TESTS 36 514 16179200 1400
58091244 chaudhary_19 B July 31, 2019, 5:39 p.m. OK Python 3 TESTS 36 530 16486400 1400
30687790 yugle7 B Sept. 24, 2017, 6:36 p.m. OK Python 3 TESTS 36 545 16486400 1400
31219313 Firepaw B Oct. 11, 2017, 2:37 p.m. OK Python 3 TESTS 36 577 18329600 1400
30618921 rchome B Sept. 22, 2017, 3:25 p.m. OK Python 3 TESTS 36 577 31846400 1400
30511081 Hillmouse B Sept. 19, 2017, 3:45 p.m. OK Rust TESTS 36 61 5427200 1400
30749264 shiki7 B Sept. 26, 2017, 11:53 a.m. OK Rust TESTS 36 77 6451200 1400
31129915 IvanDyachenko B Oct. 8, 2017, 12:04 a.m. OK Scala TESTS 36 1029 22528000 1400
31129870 IvanDyachenko B Oct. 7, 2017, 11:58 p.m. OK Scala TESTS 36 1029 142233600 1400
31102188 Jugaza B Oct. 7, 2017, 6:36 a.m. OK Scala TESTS 36 1513 107110400 1400
31230938 Jugaza B Oct. 12, 2017, 2:35 a.m. OK Scala TESTS 36 1575 118579200 1400
31102109 Jugaza B Oct. 7, 2017, 6:33 a.m. OK Scala TESTS 36 1622 107110400 1400
31231093 Jugaza B Oct. 12, 2017, 2:51 a.m. OK Scala TESTS 36 1700 95027200 1400

remove filters

Back to search problems