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 |
|---|---|---|---|---|---|---|
| 2045 | 2024-2025 ICPC Asia Jakarta Regional Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 43462484 | Dec. 1, 2024, 5:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 131 ) | K | GCDDCG | PROGRAMMING | 2900 |
You are playing the Greatest Common Divisor Deck-Building Card Game (GCDDCG). There are (N) cards (numbered from (1) to (N)). Card (i) has the value of (A_i), which is an integer between (1) and (N) (inclusive). The game consists of (N) rounds (numbered from (1) to (N)). Within each round, you need to build two non-empty decks, deck (1) and deck (2). A card cannot be inside both decks, and it is allowed to not use all (N) cards. In round (i), the greatest common divisor (GCD) of the card values in each deck must equal (i). Your creativity point during round (i) is the product of (i) and the number of ways to build two valid decks. Two ways are considered different if one of the decks contains different cards. Find the sum of creativity points across all (N) rounds. Since the sum can be very large, calculate the sum modulo (998\,244\,353). The first line consists of an integer (N) ((2 \leq N \leq 200\,000)). The second line consists of (N) integers (A_i) ((1 \leq A_i \leq N)). Output a single integer representing the sum of creativity points across all (N) rounds modulo (998\,244\,353). Explanation for the sample input/output #1 The creativity point during each of rounds (1) and (2) is (0). During round (3), there are (12) ways to build both decks. Denote (B) and (C) as the set of card numbers within deck (1) and deck (2), respectively. The (12) ways to build both decks are: (B = \{ 1 \}, C = \{ 2 \}); (B = \{ 1 \}, C = \{ 3 \}); (B = \{ 1 \}, C = \{ 2, 3 \}); (B = \{ 2 \}, C = \{ 1 \}); (B = \{ 2 \}, C = \{ 3 \}); (B = \{ 2 \}, C = \{ 1, 3 \}); (B = \{ 3 \}, C = \{ 1 \}); (B = \{ 3 \}, C = \{ 2 \}); (B = \{ 3 \}, C = \{ 1, 2 \}); (B = \{ 1, 2 \}, C = \{ 3 \}); (B = \{ 2, 3 \}, C = \{ 1 \}); and (B = \{ 1, 3 \}, C = \{ 2 \}). Explanation for the sample input/output #2 |
| raRzKDJLPHcUnqTcwvGznwEdKiDWjEkd.pdf |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 294286403 | greatpaul2008 | K | Dec. 2, 2024, 2:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 327 | 13107200 | 2900 | |
| 294174311 | bachbeo2007 daoquanglinh2k7 CDuongg | K | Dec. 1, 2024, 9:57 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 390 | 44851200 | 2900 | |
| 294167751 | BitesTheDust | K | Dec. 1, 2024, 9:17 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 561 | 62771200 | 2900 | |
| 294139639 | A_zjzj JCY_ 275307894a | K | Dec. 1, 2024, 5:35 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 718 | 94412800 | 2900 | |
| 294166913 | cn449 | K | Dec. 1, 2024, 9:09 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 999 | 305971200 | 2900 | |
| 294176063 | JettyOller | K | Dec. 1, 2024, 10:13 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 296 | 5632000 | 2900 | |
| 294177894 | Etohari | K | Dec. 1, 2024, 10:30 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 796 | 20070400 | 2900 | |
| 294146596 | ksun48 ecnerwala | K | Dec. 1, 2024, 6:41 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 875 | 409600 | 2900 | |
| 294279021 | arvindf232 | K | Dec. 1, 2024, 11:11 p.m. | OK | Kotlin 1.9 | TESTS | 71 | 999 | 30003200 | 2900 |
Back to search problems