Codeforces Round 564 (Div. 1)

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
1172 Codeforces Round 564 (Div. 1) FINISHED False 7200 177530087 June 7, 2019, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4120 ) B Nauuo and Circle PROGRAMMING combinatorics dfs and similar dp trees 2000

B'Nauuo is a girl who loves drawing circles. One day she has drawn a circle and wanted to draw a tree on it. The tree is a connected undirected graph consisting of n nodes and n-1 edges. The nodes are numbered from 1 to n . Nauuo wants to draw a tree on the circle, the nodes of the tree should be in n distinct points on the circle, and the edges should be straight without crossing each other. "Without crossing each other" means that every two edges have no common point or the only common point is an endpoint of both edges. Nauuo wants to draw the tree using a permutation of n elements. A permutation of n elements is a sequence of integers p_1,p_2, ldots,p_n in which every integer from 1 to n appears exactly once. After a permutation is chosen Nauuo draws the i -th node in the p_i -th point on the circle, then draws the edges connecting the nodes. The tree is given, Nauuo wants to know how many permutations are there so that the tree drawn satisfies the rule (the edges are straight without crossing each other). She only wants to know the answer modulo 998244353 , can you help her? It is obvious that whether a permutation is valid or not does not depend on which n points on the circle are chosen. The first line contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of nodes in the tree. Each of the next n-1 lines contains two integers u and v ( 1 <= u,v <= n ), denoting there is an edge between u and v . It is guaranteed that the given edges form a tree. The output contains a single integer -- the number of permutations suitable to draw the given tree on a circle satisfying the rule, modulo 998244353 . Example 1 All valid permutations and their spanning trees are as follows. Here is an example of invalid permutation: the edges (1,3) and (2,4) are crossed. Example 2 Every permutation leads to a valid tree, '...

Tutorials

Codeforces Round #564 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
55258008 Gassa B June 7, 2019, 1:02 p.m. OK D TESTS 65 218 15257600 2000
55257836 hos.lyric B June 7, 2019, 1:01 p.m. OK D TESTS 65 249 22425600 2000
57701425 Sarica B July 24, 2019, 6 p.m. OK GNU C11 TESTS 65 124 16076800 2000
57701338 hejbro B July 24, 2019, 5:58 p.m. OK GNU C11 TESTS 65 124 16076800 2000
55550172 luogu_bot1 B June 14, 2019, 6:31 a.m. OK GNU C++11 TESTS 65 46 614400 2000
55550168 xcxxcx B June 14, 2019, 6:30 a.m. OK GNU C++11 TESTS 65 46 614400 2000
55698418 liuzhangfeiabc B June 18, 2019, 1:43 a.m. OK GNU C++11 TESTS 65 46 819200 2000
55285824 Lonely666 B June 8, 2019, 4:48 a.m. OK GNU C++11 TESTS 65 46 819200 2000
55749583 lovewz B June 19, 2019, noon OK GNU C++11 TESTS 65 46 819200 2000
58660082 zbctd B Aug. 12, 2019, 10:36 a.m. OK GNU C++11 TESTS 65 46 819200 2000
58934799 luogu_bot4 B Aug. 17, 2019, 3:21 a.m. OK GNU C++11 TESTS 65 46 1331200 2000
55289240 Frame233 B June 8, 2019, 6:49 a.m. OK GNU C++11 TESTS 65 46 1433600 2000
55388600 DennyQi B June 10, 2019, 8:41 a.m. OK GNU C++11 TESTS 65 46 1433600 2000
66620041 luogu_bot2 B Dec. 11, 2019, 6:33 a.m. OK GNU C++11 TESTS 65 46 1638400 2000
55742561 wjyyy B June 19, 2019, 8:18 a.m. OK GNU C++14 TESTS 65 61 17305600 2000
58947596 rhrnald B Aug. 17, 2019, 9:40 a.m. OK GNU C++14 TESTS 65 78 12083200 2000
63251701 Mynesis B Oct. 23, 2019, 4:16 p.m. OK GNU C++14 TESTS 65 93 2457600 2000
56514329 ishancosmos25 B July 4, 2019, noon OK GNU C++14 TESTS 65 108 819200 2000
55418629 bachhieu1412 B June 11, 2019, 4:46 a.m. OK GNU C++14 TESTS 65 108 819200 2000
57269981 Libitina B July 18, 2019, 8:34 a.m. OK GNU C++14 TESTS 65 109 819200 2000
69180990 _XXXTENTACION B Jan. 20, 2020, 10:08 a.m. OK GNU C++14 TESTS 65 109 819200 2000
56197230 chaichenkai1 B June 28, 2019, 8:26 a.m. OK GNU C++14 TESTS 65 109 819200 2000
55420726 Newusers B June 11, 2019, 6:17 a.m. OK GNU C++14 TESTS 65 109 819200 2000
55337169 guanhuai04 B June 9, 2019, 2:34 p.m. OK GNU C++14 TESTS 65 109 819200 2000
67134022 Louhc B Dec. 18, 2019, 2:43 a.m. OK GNU C++17 TESTS 65 61 3686400 2000
61291653 Lezedary_sandwich B Sept. 25, 2019, 9:06 p.m. OK GNU C++17 TESTS 65 93 9523200 2000
55282667 whzzt B June 8, 2019, 2:30 a.m. OK GNU C++17 TESTS 65 93 25190400 2000
62041133 zhumagaliansar B Oct. 7, 2019, 6 a.m. OK GNU C++17 TESTS 65 108 1638400 2000
56217736 EvolveZ B June 28, 2019, 9:56 a.m. OK GNU C++17 TESTS 65 108 17612800 2000
57697321 venkatesh_saki B July 24, 2019, 4:55 p.m. OK GNU C++17 TESTS 65 109 819200 2000
60306237 aadityatripathi2608 B Sept. 9, 2019, 1:59 p.m. OK GNU C++17 TESTS 65 109 819200 2000
59000581 liangjinzhe B Aug. 18, 2019, 1:32 p.m. OK GNU C++17 TESTS 65 109 819200 2000
58345260 couplefire B Aug. 5, 2019, 2:42 p.m. OK GNU C++17 TESTS 65 109 819200 2000
57000775 ST_C B July 14, 2019, 3:22 a.m. OK GNU C++17 TESTS 65 109 819200 2000
57274048 gaidash B July 18, 2019, 10:05 a.m. OK Java 8 TESTS 65 140 0 2000
55296210 zmurzagaliev B June 8, 2019, 9:59 a.m. OK Java 8 TESTS 65 202 0 2000
55275019 guillermo_sz B June 7, 2019, 6:27 p.m. OK Java 8 TESTS 65 202 0 2000
55249775 Egor B June 7, 2019, 12:22 p.m. OK Java 8 TESTS 65 218 30003200 2000
55259308 Intrincantation B June 7, 2019, 1:11 p.m. OK Java 8 TESTS 65 233 0 2000
55259090 Taran_1407 B June 7, 2019, 1:10 p.m. OK Java 8 TESTS 65 233 0 2000
55253373 uwi B June 7, 2019, 12:35 p.m. OK Java 8 TESTS 65 233 9216000 2000
55257353 dalt B June 7, 2019, 12:57 p.m. OK Java 8 TESTS 65 390 52531200 2000
55268596 Sharon B June 7, 2019, 3:32 p.m. OK Java 8 TESTS 65 405 60825600 2000
55306654 Noureldin B June 8, 2019, 2:54 p.m. OK Java 8 TESTS 65 436 35532800 2000
57304190 Spheniscine B July 19, 2019, 2:30 a.m. OK Kotlin TESTS 65 451 307200 2000
58255266 Spheniscine B Aug. 4, 2019, 9:42 a.m. OK Kotlin TESTS 65 467 4300800 2000
56499104 Tlatoani B July 4, 2019, 5:22 a.m. OK Kotlin TESTS 65 608 0 2000
55263063 elizarov B June 7, 2019, 1:39 p.m. OK Kotlin TESTS 65 608 33177600 2000
56499142 Tlatoani B July 4, 2019, 5:23 a.m. OK Kotlin TESTS 65 639 1945600 2000
55258970 ymatsux B June 7, 2019, 1:09 p.m. OK Kotlin TESTS 65 1122 155238400 2000
55256387 keymoon B June 7, 2019, 12:51 p.m. OK Mono C# TESTS 65 373 26419200 2000
55249436 riantkb B June 7, 2019, 12:20 p.m. OK Mono C# TESTS 65 451 35430400 2000
61302374 vjudge3 B Sept. 26, 2019, 5:38 a.m. OK MS C++ TESTS 65 93 1638400 2000
55268324 qcwlmqy B June 7, 2019, 3:27 p.m. OK MS C++ TESTS 65 93 2457600 2000
61684989 vjudge3 B Oct. 2, 2019, 3:22 a.m. OK MS C++ TESTS 65 109 12800000 2000
55718545 vjudge2 B June 18, 2019, 2:01 p.m. OK MS C++ TESTS 65 358 13107200 2000
56545376 petko_mitkov B July 5, 2019, 7:25 a.m. OK MS C++ 2017 TESTS 65 124 2457600 2000
57016618 C20191522 B July 14, 2019, 11:55 a.m. OK MS C++ 2017 TESTS 65 218 14438400 2000
55268711 st1vdy B June 7, 2019, 3:34 p.m. OK MS C++ 2017 TESTS 65 405 4812800 2000
55255199 kotamanegi B June 7, 2019, 12:44 p.m. OK MS C++ 2017 TESTS 65 467 21299200 2000
55270913 pajenegod B June 7, 2019, 4:21 p.m. OK PyPy 2 TESTS 65 187 11673600 2000
55300815 YESMAths B June 8, 2019, 11:57 a.m. OK PyPy 2 TESTS 65 296 17203200 2000
55462415 Bovniova B June 11, 2019, 3:17 p.m. OK PyPy 3 TESTS 65 577 34406400 2000
55260571 Kiri8128 B June 7, 2019, 1:20 p.m. OK PyPy 3 TESTS 65 670 41984000 2000
55256772 iehn B June 7, 2019, 12:54 p.m. OK PyPy 3 TESTS 65 1232 105267200 2000
55684886 sdhd B June 17, 2019, 2:58 p.m. OK PyPy 3 TESTS 65 1652 10956800 2000
55854296 codershuvo B June 21, 2019, 6:12 a.m. OK PyPy 3 TESTS 65 1716 20480000 2000
57807293 Helli.code B July 26, 2019, 3:41 p.m. OK Python 2 TESTS 65 670 4300800 2000
55291424 shurongwang B June 8, 2019, 7:52 a.m. OK Python 2 TESTS 65 686 1638400 2000
56511615 KILLER_CODER B July 4, 2019, 10:43 a.m. OK Python 3 TESTS 65 732 819200 2000
55312541 Limeni B June 8, 2019, 6:40 p.m. OK Python 3 TESTS 65 748 5017600 2000
55277544 whatshisbucket B June 7, 2019, 8:17 p.m. OK Python 3 TESTS 65 748 6041600 2000
55854153 codershuvo B June 21, 2019, 6:07 a.m. OK Python 3 TESTS 65 810 5017600 2000
55277464 whatshisbucket B June 7, 2019, 8:13 p.m. OK Python 3 TESTS 65 904 24780800 2000
67507111 gearjack B Dec. 24, 2019, 7:45 a.m. OK Rust TESTS 65 108 21913600 2000

remove filters

Back to search problems