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. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 283 ) | F2 | Shohag Loves Counting (Hard Version) | PROGRAMMING | number theory |
This is the hard version of the problem. The only differences between the two versions of this problem are the constraints on (t), (m), and the sum of (m). You can only make hacks if both versions of the problem are solved. For an integer array (a) of length (n), define (f(k)) as the greatest common divisor (GCD) of the maximum values of all subarrays(^{\text{∗}}) of length (k). For example, if the array is (2, 1, 4, 6, 2), then (f(3) = \operatorname{gcd}(\operatorname{max}(2, 1, 4), \operatorname{max}(1, 4, 6), \operatorname{max}(4, 6, 2)) = \operatorname{gcd}(4, 6, 6) = 2). An array is good if (f(i) \neq f(j)) is satisfied over all pairs (1 \le i \lt j \le n). Shohag has an integer (m). Help him count the number, modulo (998\,244\,353), of non-empty good arrays of arbitrary length such that each element of the array is an integer from (1) to (m). (^{\text{∗}})An array (d) is a subarray of an array (c) if (d) can be obtained from (c) by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. The first line contains a single integer (t) ((1 \le t \le 3 \cdot 10^5)) — the number of test cases. The first and only line of each test case contains an integer (m) ((1 \le m \le 10^6)). Note that there is no limit on the sum of (m) over all test cases. For each test case, output an integer — the number of valid arrays modulo (998\,244\,353). In the first test case, the valid arrays are (1), (1, 2), (2), and (2, 1). In the second test case, there are a total of (29) valid arrays. In particular, the array (2, 1, 4) with length (n = 3) is valid because all elements are from (1) to (m = 5) and (f(1)), (f(2)) and (f(n = 3)) all are distinct: $$$f(1) = \operatorname{gcd}(\operatorname{max}(2), \operatorname{max}(1), \oper |
| Editorial of CodeTON Round 9 (Div. 1 + Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 292986584 | grass8sheep | F2 | Nov. 23, 2024, 5:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 1811 | 277606400 | ||
| 292967640 | jiangbowen | F2 | Nov. 23, 2024, 4:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 2921 | 121139200 | ||
| 293021832 | Linanchen | F2 | Nov. 24, 2024, 2:17 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 3093 | 122880000 | ||
| 293021763 | Linanchen | F2 | Nov. 24, 2024, 2:16 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 3233 | 123289600 | ||
| 292981803 | PubabaOnO | F2 | Nov. 23, 2024, 5:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 3468 | 185958400 | ||
| 292995716 | LortyMorty | F2 | Nov. 23, 2024, 7:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 3515 | 123187200 | ||
| 293026193 | Marckess | F2 | Nov. 24, 2024, 3:47 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 3874 | 192921600 | ||
| 293022589 | jiangbowen | F2 | Nov. 24, 2024, 2:34 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 3889 | 119091200 | ||
| 292999416 | maspy | F2 | Nov. 23, 2024, 7:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 2124 | 17510400 | ||
| 292972039 | kaiboy | F2 | Nov. 23, 2024, 4:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 2155 | 103424000 | ||
| 293002952 | Xylenox | F2 | Nov. 23, 2024, 8:25 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 2515 | 156160000 | ||
| 292976694 | lexiyvv | F2 | Nov. 23, 2024, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 2624 | 258867200 | ||
| 292994707 | hos.lyric | F2 | Nov. 23, 2024, 6:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 2796 | 148172800 | ||
| 292991673 | zjy2008 | F2 | Nov. 23, 2024, 6:27 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 2984 | 144281600 | ||
| 293026438 | Chinese_zjc_ | F2 | Nov. 24, 2024, 3:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 3202 | 146227200 | ||
| 292973216 | RGB_ICPC1 | F2 | Nov. 23, 2024, 4:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 3296 | 140390400 | ||
| 292986188 | conqueror_of_tourist | F2 | Nov. 23, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 3358 | 220262400 | ||
| 292970902 | cn449 | F2 | Nov. 23, 2024, 4:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 3374 | 135577600 | ||
| 293028263 | JoesSR | F2 | Nov. 24, 2024, 4:26 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 858 | 32153600 | ||
| 292967655 | jiangly | F2 | Nov. 23, 2024, 4:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 2296 | 152883200 | ||
| 292993481 | Ormlis | F2 | Nov. 23, 2024, 6:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 2983 | 143769600 | ||
| 292997180 | Benq | F2 | Nov. 23, 2024, 7:18 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3077 | 144076800 | ||
| 292993311 | Ormlis | F2 | Nov. 23, 2024, 6:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3171 | 143769600 | ||
| 293027845 | Normalizerr | F2 | Nov. 24, 2024, 4:19 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3265 | 151756800 | ||
| 293000772 | Benq | F2 | Nov. 23, 2024, 7:59 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3327 | 144896000 | ||
| 292984216 | QwertyPi | F2 | Nov. 23, 2024, 5:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3624 | 334643200 | ||
| 293024524 | raincity | F2 | Nov. 24, 2024, 3:16 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3733 | 227430400 | ||
| 292978164 | ecnerwala | F2 | Nov. 23, 2024, 5:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 3843 | 207155200 | ||
| 292978776 | arvindf232 | F2 | Nov. 23, 2024, 5:06 p.m. | OK | Kotlin 1.7 | TESTS | 13 | 3858 | 173363200 |
Back to search problems