CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!)

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
2039 CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 10800 44033123 Nov. 23, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 82 ) G Shohag Loves Pebae PROGRAMMING

Shohag has a tree with (n) nodes. Pebae has an integer (m). She wants to assign each node a value — an integer from (1) to (m). So she asks Shohag to count the number, modulo (998\,244\,353), of assignments such that following conditions are satisfied: For each pair (1 \le u \lt v \le n), the least common multiple (LCM) of the values of the nodes in the unique simple path from (u) to (v) is not divisible by the number of nodes in the path. The greatest common divisor (GCD) of the values of all nodes from (1) to (n) is (1). But this problem is too hard for Shohag to solve. As Shohag loves Pebae, he has to solve the problem. Please save Shohag! The first line contains two space-separated integers (n) and (m) ((2 \le n \le 10^6), (1 \le m \le 10^{9})). Each of the next (n - 1) lines contains two integers (u) and (v) ((1 \le u, v \le n)) indicating there is an edge between vertices (u) and (v). It is guaranteed that the given edges form a tree. Print a single integer — the number of valid ways to assign each vertex a value, modulo (998\,244\,353). In the first test case, the valid assignments are (1, 1, 1, 1, 1, 1) and (1, 1, 1, 1, 1, 5). In the second test case, the valid assignments are (1, 1), (1, 3), (1, 5), (3, 1), (3, 5), (5, 1) and (5, 3).

Tutorials

Editorial of CodeTON Round 9 (Div. 1 + Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
292995736 LortyMorty G Nov. 23, 2024, 7:01 p.m. OK C++17 (GCC 7-32) TESTS 185 2827 331878400
292969247 orzdevinwang G Nov. 23, 2024, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 185 2405 398540800
292992996 Qiulyqwq G Nov. 23, 2024, 6:37 p.m. OK C++20 (GCC 13-64) TESTS 185 3171 198041600
293010120 maroonrk G Nov. 23, 2024, 10:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 1906 157388800
293010471 maroonrk G Nov. 23, 2024, 10:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 1921 157593600
293010553 maroonrk G Nov. 23, 2024, 10:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 1936 157388800
293010018 maroonrk G Nov. 23, 2024, 10:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 1967 157388800
293010834 maroonrk G Nov. 23, 2024, 10:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 1984 157388800
293004197 ElayV1313 G Nov. 23, 2024, 8:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 2077 380006400
293009655 maroonrk G Nov. 23, 2024, 10:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 2124 157593600
293027876 Normalizerr G Nov. 24, 2024, 4:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 185 2124 367718400
293010340 maroonrk G Nov. 23, 2024, 10:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 2140 214118400
293009701 maroonrk G Nov. 23, 2024, 10:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 185 2249 157593600

remove filters

Back to search problems