Codeforces Round 493 (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
997 Codeforces Round 493 (Div. 1) FINISHED False 7200 207071723 July 1, 2018, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 467 ) D Cycles in product PROGRAMMING combinatorics divide and conquer trees 2800

B"Consider a tree (that is, an undirected connected graph without loops) T_1 and a tree T_2 . Let's define their cartesian product T_1 x T_2 in a following way. Let V be the set of vertices in T_1 and U be the set of vertices in T_2 . Then the set of vertices of graph T_1 x T_2 is V x U , that is, a set of ordered pairs of vertices, where the first vertex in pair is from V and the second -- from U . Let's draw the following edges: Please see the notes section for the pictures of products of trees in the sample tests. Let's examine the graph T_1 x T_2 . How much cycles (not necessarily simple) of length k it contains? Since this number can be very large, print it modulo 998244353 . The sequence of vertices w_1 , w_2 , ..., w_k , where w_i in V x U called cycle, if any neighboring vertices are adjacent and w_1 is adjacent to w_k . Cycles that differ only by the cyclic shift or direction of traversal are still considered different. First line of input contains three integers -- n_1 , n_2 and k ( 2 <= n_1, n_2 <= 4000 , 2 <= k <= 75 ) -- number of vertices in the first tree, number of vertices in the second tree and the cycle length respectively. Then follow n_1 - 1 lines describing the first tree. Each of this lines contains two integers -- v_i, u_i ( 1 <= v_i, u_i <= n_1 ), which define edges of the first tree. Then follow n_2 - 1 lines, which describe the second tree in the same format. It is guaranteed, that given graphs are trees. Print one integer -- number of cycles modulo 998244353 . The following three pictures illustrate graph, which are products of the trees from sample tests. In the first example, the list of cycles of length 2 is as follows: "...

Tutorials

60357

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
39975960 sheaf D July 5, 2018, 7:10 a.m. OK Clang++17 Diagnostics TESTS 89 3275 15257600 2800
39976487 sheaf D July 5, 2018, 7:59 a.m. OK Clang++17 Diagnostics TESTS 89 3478 14950400 2800
39982735 litble D July 5, 2018, 11:41 a.m. OK GNU C++ TESTS 89 217 10547200 2800
40026725 Scut82 D July 6, 2018, 10:18 a.m. OK GNU C++ TESTS 89 218 4403200 2800
40106121 OrangeLee D July 9, 2018, 8:37 a.m. OK GNU C++ TESTS 89 218 4608000 2800
41232131 mayaohua2003 D Aug. 5, 2018, 4:12 a.m. OK GNU C++ TESTS 89 233 3379200 2800
42241252 dyxx D Aug. 29, 2018, 12:42 p.m. OK GNU C++ TESTS 89 234 3379200 2800
40590865 guille D July 20, 2018, 11 p.m. OK GNU C++ TESTS 89 514 23756800 2800
39940227 nblt D July 4, 2018, 2:28 a.m. OK GNU C++ TESTS 89 654 7065600 2800
40565817 jacky35 D July 20, 2018, 5:21 a.m. OK GNU C++ TESTS 89 1123 9113600 2800
39945794 robinliu D July 4, 2018, 7:21 a.m. OK GNU C++ TESTS 89 2152 3072000 2800
39980465 Notseefire D July 5, 2018, 10:20 a.m. OK GNU C++ TESTS 89 2308 5734400 2800
40931727 ReaLNero1 D July 30, 2018, 1:16 a.m. OK GNU C++11 TESTS 89 93 5632000 2800
39871466 yasugongshang D July 2, 2018, 2:42 p.m. OK GNU C++11 TESTS 89 93 5632000 2800
61926952 Starlit D Oct. 5, 2019, 2:57 p.m. OK GNU C++11 TESTS 89 109 2867200 2800
39855458 neal D July 2, 2018, 2:58 a.m. OK GNU C++11 TESTS 89 186 1126400 2800
39869440 yfzcsc D July 2, 2018, 1:22 p.m. OK GNU C++11 TESTS 89 202 5632000 2800
43449621 ldy419 D Sept. 26, 2018, 12:48 p.m. OK GNU C++11 TESTS 89 202 8294400 2800
39866327 251 D July 2, 2018, 11:27 a.m. OK GNU C++11 TESTS 89 233 13414400 2800
40133222 krijgertje D July 9, 2018, 4:30 p.m. OK GNU C++11 TESTS 89 234 4096000 2800
44112324 _rqy D Oct. 11, 2018, 12:27 p.m. OK GNU C++11 TESTS 89 264 18329600 2800
39882757 Steaunk D July 3, 2018, 3:33 a.m. OK GNU C++11 TESTS 89 265 4915200 2800
55810736 Scut82 D June 20, 2019, 3:32 a.m. OK GNU C++14 TESTS 89 140 3072000 2800
55821668 Scut82 D June 20, 2019, 8:52 a.m. OK GNU C++14 TESTS 89 155 8089600 2800
58220548 Scut82 D Aug. 3, 2019, 12:24 p.m. OK GNU C++14 TESTS 89 155 10240000 2800
58220487 Scut82 D Aug. 3, 2019, 12:23 p.m. OK GNU C++14 TESTS 89 156 10137600 2800
39854124 ecnerwala D July 2, 2018, 1:19 a.m. OK GNU C++14 TESTS 89 171 2150400 2800
39853938 ecnerwala D July 2, 2018, 1:02 a.m. OK GNU C++14 TESTS 89 171 2150400 2800
45312146 Shedneryan D Nov. 5, 2018, 5:15 a.m. OK GNU C++14 TESTS 89 171 2457600 2800
68035193 yan-zp D Jan. 1, 2020, 11:38 a.m. OK GNU C++14 TESTS 89 171 5836800 2800
39844833 apiadu D July 1, 2018, 4:04 p.m. OK GNU C++14 TESTS 89 171 6860800 2800
39838295 Um_nik D July 1, 2018, 3:08 p.m. OK GNU C++14 TESTS 89 202 2560000 2800
40082080 pragcor D July 8, 2018, 10:32 a.m. OK GNU C++17 TESTS 89 93 5734400 2800
39846353 Benq D July 1, 2018, 5:38 p.m. OK GNU C++17 TESTS 89 139 4608000 2800
40707049 Twishkle.Aevdark D July 24, 2018, 1:48 p.m. OK GNU C++17 TESTS 89 171 1843200 2800
48603353 Nakagawa.Kanon D Jan. 20, 2019, 9:27 a.m. OK GNU C++17 TESTS 89 187 2764800 2800
39882398 ekzhang D July 3, 2018, 3:05 a.m. OK GNU C++17 TESTS 89 187 5632000 2800
48603634 Nakagawa.Kanon D Jan. 20, 2019, 9:36 a.m. OK GNU C++17 TESTS 89 202 2764800 2800
39856291 ainta D July 2, 2018, 3:54 a.m. OK GNU C++17 TESTS 89 218 2457600 2800
39979691 MoonBall D July 5, 2018, 9:50 a.m. OK GNU C++17 TESTS 89 233 3788800 2800
40414691 Ali_Pi D July 16, 2018, 2:19 p.m. OK GNU C++17 TESTS 89 234 2457600 2800
56634332 Shayan.P D July 6, 2019, 6:24 p.m. OK GNU C++17 TESTS 89 234 3174400 2800
39844480 uwi D July 1, 2018, 4:02 p.m. OK Java 8 TESTS 89 499 0 2800
39840986 Petr D July 1, 2018, 3:28 p.m. OK Java 8 TESTS 89 1450 7680000 2800
42784573 tri D Sept. 12, 2018, 2:35 a.m. OK Java 8 TESTS 89 5803 0 2800
40093581 qwerty787788 D July 8, 2018, 7:13 p.m. OK Java 8 TESTS 89 6036 7168000 2800

remove filters

Back to search problems