Codeforces Round 890 (Div. 2) supported by Constructor Institute

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
1856 Codeforces Round 890 (Div. 2) supported by Constructor Institute FINISHED False 7200 45933863 Aug. 5, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5537 ) E1 PermuTree (easy version) PROGRAMMING dfs and similar dp trees

B'This is the easy version of the problem. The differences between the two versions are the constraint on n and the time limit. You can make hacks only if both versions of the problem are solved. You are given a tree with n vertices rooted at vertex 1 . For some permutation ^ dagger a of length n , let f(a) be the number of pairs of vertices (u, v) such that a_u < a_{ operatorname{lca}(u, v)} < a_v . Here, operatorname{lca}(u,v) denotes the lowest common ancestor of vertices u and v . Find the maximum possible value of f(a) over all permutations a of length n . ^ dagger A permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array), and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). The first line contains a single integer n ( 2 <= n <= 5000 ). The second line contains n - 1 integers p_2,p_3, ldots,p_n ( 1 <= p_i < i ) indicating that there is an edge between vertices i and p_i . Output the maximum value of f(a) . The tree in the first test: One possible optimal permutation a is [2, 1, 4, 5, 3] with 4 suitable pairs of vertices: The tree in the third test: The tree in the fourth test: '...

Tutorials

Codeforces Round #890 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
217351313 kuuso E1 Aug. 5, 2023, 4:33 p.m. OK C# 8 TESTS 76 202 7577600
217409441 swayingdream E1 Aug. 6, 2023, 5:53 a.m. OK GNU C11 TESTS 76 78 614400
217393359 Hanx16 E1 Aug. 6, 2023, 1:34 a.m. OK GNU C++14 TESTS 76 15 614400
217407850 pengyantong E1 Aug. 6, 2023, 5:33 a.m. OK GNU C++14 TESTS 76 30 153702400
217390426 monster_hunter E1 Aug. 6, 2023, 12:25 a.m. OK GNU C++14 TESTS 76 31 307200
217392288 pratts_02 E1 Aug. 6, 2023, 1:13 a.m. OK GNU C++14 TESTS 76 31 409600
217407350 pzj114514 E1 Aug. 6, 2023, 5:27 a.m. OK GNU C++14 TESTS 76 31 614400
217406295 pzj114514 E1 Aug. 6, 2023, 5:13 a.m. OK GNU C++14 TESTS 76 31 614400
217380837 omeganot E1 Aug. 5, 2023, 9 p.m. OK GNU C++14 TESTS 76 31 614400
217358927 teateart E1 Aug. 5, 2023, 5:37 p.m. OK GNU C++14 TESTS 76 31 614400
217351001 anha3k25cvp E1 Aug. 5, 2023, 4:33 p.m. OK GNU C++14 TESTS 76 31 614400
217408460 pzj114514 E1 Aug. 6, 2023, 5:41 a.m. OK GNU C++14 TESTS 76 31 614400
217356240 pmqwerty E1 Aug. 5, 2023, 5:24 p.m. OK GNU C++17 TESTS 76 15 307200
217403797 shadow9236 E1 Aug. 6, 2023, 4:35 a.m. OK GNU C++17 TESTS 76 15 512000
217367660 Rosmontispes E1 Aug. 5, 2023, 6:42 p.m. OK GNU C++17 TESTS 76 15 7065600
217367263 NaveeN_46 E1 Aug. 5, 2023, 6:38 p.m. OK GNU C++17 TESTS 76 31 409600
217379123 abhinavarora887 E1 Aug. 5, 2023, 8:36 p.m. OK GNU C++17 TESTS 76 31 512000
217388302 theNewSon E1 Aug. 5, 2023, 11:27 p.m. OK GNU C++17 TESTS 76 31 614400
217383252 Chelovek9 E1 Aug. 5, 2023, 9:41 p.m. OK GNU C++17 TESTS 76 31 614400
217356134 crabcrabcrab E1 Aug. 5, 2023, 5:24 p.m. OK GNU C++17 TESTS 76 31 614400
217403938 wsy123 E1 Aug. 6, 2023, 4:38 a.m. OK GNU C++17 TESTS 76 31 614400
217402264 _Load_ E1 Aug. 6, 2023, 4:10 a.m. OK GNU C++17 TESTS 76 31 716800
217406030 bkifhr6 E1 Aug. 6, 2023, 5:09 a.m. OK GNU C++17 (64) TESTS 76 15 7372800
217390218 Rektyu E1 Aug. 6, 2023, 12:18 a.m. OK GNU C++17 (64) TESTS 76 30 1126400
217401204 six-floor-slip-liu E1 Aug. 6, 2023, 3:53 a.m. OK GNU C++17 (64) TESTS 76 31 921600
217391796 zihouzhong E1 Aug. 6, 2023, 1:03 a.m. OK GNU C++17 (64) TESTS 76 31 921600
217363935 Carl_Hu E1 Aug. 5, 2023, 6:12 p.m. OK GNU C++17 (64) TESTS 76 31 921600
217363378 Carl_Hu E1 Aug. 5, 2023, 6:07 p.m. OK GNU C++17 (64) TESTS 76 31 921600
217362241 Carl_Hu E1 Aug. 5, 2023, 5:58 p.m. OK GNU C++17 (64) TESTS 76 31 921600
217393759 Mag1sk E1 Aug. 6, 2023, 1:42 a.m. OK GNU C++17 (64) TESTS 76 31 1024000
217401642 Pulga E1 Aug. 6, 2023, 4:01 a.m. OK GNU C++17 (64) TESTS 76 31 1024000
217388605 hhux E1 Aug. 5, 2023, 11:35 p.m. OK GNU C++17 (64) TESTS 76 31 1024000
217366726 loggerr E1 Aug. 5, 2023, 6:33 p.m. OK GNU C++20 (64) TESTS 76 15 716800
217365962 hongjinjian E1 Aug. 5, 2023, 6:27 p.m. OK GNU C++20 (64) TESTS 76 15 819200
217386407 mikekimkc E1 Aug. 5, 2023, 10:42 p.m. OK GNU C++20 (64) TESTS 76 15 921600
217355841 mcbanana E1 Aug. 5, 2023, 5:23 p.m. OK GNU C++20 (64) TESTS 76 15 921600
217378419 1RONMAN E1 Aug. 5, 2023, 8:27 p.m. OK GNU C++20 (64) TESTS 76 15 921600
217372328 tkacper E1 Aug. 5, 2023, 7:22 p.m. OK GNU C++20 (64) TESTS 76 15 1024000
217408113 Karrrrr E1 Aug. 6, 2023, 5:37 a.m. OK GNU C++20 (64) TESTS 76 15 1024000
217380908 CYhuang E1 Aug. 5, 2023, 9:01 p.m. OK GNU C++20 (64) TESTS 76 15 1126400
217370510 SiRBruce E1 Aug. 5, 2023, 7:07 p.m. OK GNU C++20 (64) TESTS 76 15 1126400
217381122 CYhuang E1 Aug. 5, 2023, 9:04 p.m. OK GNU C++20 (64) TESTS 76 15 1228800
217409429 vijender_8601 E1 Aug. 6, 2023, 5:52 a.m. OK Java 11 TESTS 76 811 273100800
217403112 oneafter E1 Aug. 6, 2023, 4:24 a.m. OK Java 11 TESTS 76 1637 401612800
217357993 StacGnihsihp E1 Aug. 5, 2023, 5:32 p.m. OK Java 17 TESTS 76 218 2048000
217351578 5ps E1 Aug. 5, 2023, 4:34 p.m. OK Java 17 TESTS 76 233 1024000
217359736 jack.t.y.wu E1 Aug. 5, 2023, 5:42 p.m. OK Java 17 TESTS 76 1262 1331200
217377415 aditya888 E1 Aug. 5, 2023, 8:15 p.m. OK Java 8 TESTS 76 202 81817600
217376251 PanZverski E1 Aug. 5, 2023, 8:02 p.m. OK MS C++ 2017 TESTS 76 1559 1228800
217368375 ossau_guildo E1 Aug. 5, 2023, 6:48 p.m. OK PyPy 3-64 TESTS 76 109 8908800
217360112 CinaDor E1 Aug. 5, 2023, 5:45 p.m. OK PyPy 3-64 TESTS 76 170 8908800
217356537 hvbird E1 Aug. 5, 2023, 5:26 p.m. OK PyPy 3-64 TESTS 76 171 9523200
217399141 HimanshuRajput E1 Aug. 6, 2023, 3:20 a.m. OK PyPy 3-64 TESTS 76 171 10240000
217367579 ManasJain E1 Aug. 5, 2023, 6:41 p.m. OK PyPy 3-64 TESTS 76 186 9216000
217399369 HimanshuRajput E1 Aug. 6, 2023, 3:24 a.m. OK PyPy 3-64 TESTS 76 186 10752000
217391250 hvbird E1 Aug. 6, 2023, 12:49 a.m. OK PyPy 3-64 TESTS 76 187 10137600
217389234 SoleProprietor E1 Aug. 5, 2023, 11:52 p.m. OK PyPy 3-64 TESTS 76 202 9113600
217350179 ak-bot E1 Aug. 5, 2023, 4:32 p.m. OK PyPy 3-64 TESTS 76 202 181145600
217362344 xuanwoshiluo E1 Aug. 5, 2023, 5:59 p.m. OK PyPy 3-64 TESTS 76 217 14643200

remove filters

Back to search problems