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 |
|---|---|---|---|---|---|---|
| 2072 | Codeforces Round 1006 (Div. 3) | FINISHED | False | 8100 | 35911523 | Feb. 25, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2137 ) | G | I've Been Flipping Numbers for 300 Years and Calculated the Sum | PROGRAMMING | brute force math number theory | #A. The Play Never Ends |
After three hundred years of slime farming, Akito finally obtained the magical number (n). Upon reaching the merchant, he wanted to exchange the number for gold, but the merchant gave the hero a quest. The merchant said that for the quest, the skill (\text{rev}(n, p)) would be required, which Akito, by happy coincidence, had recently learned. (\text{rev}(n, p)) represents the following procedure: Write the number (n) in base (p), let this representation be (n = \overline{n_{\ell - 1} \ldots n_1 n_0}), where (\ell) is the length of the base (p) representation of the number (n). Reverse the base (p) representation, let this be (m = \overline{n_0 n_1 \ldots n_{\ell - 1}}). Convert the number (m) back to decimal and return it as the result. The merchant's quest was to calculate the sum (x = \sum\limits_{p = 2}^{k} \text{rev}(n, p)). Since this number can be quite large, only the remainder of (x) when divided by (10^9 + 7) is required. The merchant also mentioned that the previous traveler had been calculating this sum for three hundred years and had not finished it. But you will help Akito finish it faster, right? The first line contains the number (t) ((1 \le t \le 5000)) — the number of test cases. In the only line of each test case, two numbers (n) and (k) are given ((1 \le n \le 3 \cdot 10^5, 2 \le k \le 10^{18})) — the magical number and the upper limit for summation. Note that the sum of (n) across all test cases is not bounded . For each test case, you need to output a single number — the remainder of (x = \sum\limits_{p = 2}^{k} \text{rev}(n, p)) when divided by (10^9 + 7). In the third test case, (n = 1). The number one in any numeral system is represented by a single digit, which means (\text{rev}(1, p) = 1) for any (p \ge 2). Thus, (x = \sum\limits_{p = 2}^{k} 1 = \sum\limits_{p = 2}^{10} 1 = 10 - 2 + 1 = 9). In the fourth test case, $$$x = \t |
| Codeforces Round 1006 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 308006759 | iceyx | G | Feb. 26, 2025, 11:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 249 | 102400 | ||
| 308017061 | 3demonsky | G | Feb. 27, 2025, 3:39 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 265 | 102400 | ||
| 308023828 | dfhzzj | G | Feb. 27, 2025, 5:12 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 312 | 102400 | ||
| 307965281 | SamuelTull | G | Feb. 26, 2025, 4:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 312 | 102400 | ||
| 307931679 | zhoujingchen | G | Feb. 26, 2025, 12:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 312 | 102400 | ||
| 308016158 | The_Caspian_Sea | G | Feb. 27, 2025, 3:23 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 327 | 102400 | ||
| 308010215 | cimcle | G | Feb. 27, 2025, 1:10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 328 | 0 | ||
| 307932426 | Code937 | G | Feb. 26, 2025, 12:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 405 | 16076800 | ||
| 307929868 | Code937 | G | Feb. 26, 2025, 12:12 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 421 | 16076800 | ||
| 307951974 | tczzz | G | Feb. 26, 2025, 2:47 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 437 | 0 | ||
| 307952622 | Lzy_ | G | Feb. 26, 2025, 2:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 156 | 102400 | ||
| 307955917 | BuzzyBeez | G | Feb. 26, 2025, 3:17 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 156 | 7270400 | ||
| 307945560 | HTER | G | Feb. 26, 2025, 1:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 171 | 4812800 | ||
| 307909033 | Fantasy_Blue | G | Feb. 26, 2025, 9:43 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 202 | 0 | ||
| 307911488 | liuzr156 | G | Feb. 26, 2025, 10:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 217 | 102400 | ||
| 307957392 | goodZL | G | Feb. 26, 2025, 3:27 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 218 | 102400 | ||
| 307912278 | liuzr156 | G | Feb. 26, 2025, 10:07 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 218 | 102400 | ||
| 308022271 | Madeeyuth | G | Feb. 27, 2025, 4:51 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 218 | 2457600 | ||
| 307967695 | alex2421 | G | Feb. 26, 2025, 4:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 233 | 0 | ||
| 307910707 | secretman1312 | G | Feb. 26, 2025, 9:55 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 233 | 102400 | ||
| 307884182 | Mukundan314 | G | Feb. 26, 2025, 4:51 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 109 | 102400 | ||
| 307909115 | seanlsy | G | Feb. 26, 2025, 9:43 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 186 | 102400 | ||
| 307947727 | kunwar_ajay | G | Feb. 26, 2025, 2:16 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 187 | 0 | ||
| 308000644 | Hsiahian | G | Feb. 26, 2025, 9:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 187 | 102400 | ||
| 307913735 | honghaojin | G | Feb. 26, 2025, 10:19 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 187 | 2457600 | ||
| 307999275 | aayudumb | G | Feb. 26, 2025, 9:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 202 | 102400 | ||
| 308000633 | n685 | G | Feb. 26, 2025, 9:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 202 | 30003200 | ||
| 307999394 | aayudumb | G | Feb. 26, 2025, 9:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 218 | 102400 | ||
| 307952122 | tczzz | G | Feb. 26, 2025, 2:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 218 | 102400 | ||
| 307883218 | harshkankhar1 | G | Feb. 26, 2025, 4:37 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 218 | 102400 | ||
| 308009521 | cpp10 | G | Feb. 27, 2025, 12:50 a.m. | OK | Java 21 | TESTS | 27 | 718 | 1740800 | ||
| 308009628 | cpp10 | G | Feb. 27, 2025, 12:53 a.m. | OK | Java 21 | TESTS | 27 | 733 | 819200 | ||
| 308000404 | dzhi | G | Feb. 26, 2025, 9:20 p.m. | OK | Java 21 | TESTS | 27 | 890 | 921600 | ||
| 307998507 | dzhi | G | Feb. 26, 2025, 8:53 p.m. | OK | Java 21 | TESTS | 27 | 967 | 921600 | ||
| 307963737 | arnabmanna | G | Feb. 26, 2025, 4:13 p.m. | OK | Java 8 | TESTS | 27 | 1296 | 0 | ||
| 307924068 | khesarilaly548 | G | Feb. 26, 2025, 11:32 a.m. | OK | Kotlin 1.9 | TESTS | 27 | 1624 | 0 | ||
| 307960948 | chinesedfan | G | Feb. 26, 2025, 3:52 p.m. | OK | Node.js | TESTS | 27 | 1515 | 18227200 | ||
| 307960009 | chinesedfan | G | Feb. 26, 2025, 3:46 p.m. | OK | Node.js | TESTS | 27 | 1999 | 8396800 | ||
| 307934176 | HelloFromMars | G | Feb. 26, 2025, 12:42 p.m. | OK | PyPy 3-64 | TESTS | 27 | 468 | 3891200 | ||
| 307887586 | gardengnome | G | Feb. 26, 2025, 5:35 a.m. | OK | PyPy 3-64 | TESTS | 27 | 483 | 3686400 | ||
| 307953153 | vxgmichel | G | Feb. 26, 2025, 2:56 p.m. | OK | PyPy 3-64 | TESTS | 27 | 515 | 4300800 | ||
| 307887704 | gardengnome | G | Feb. 26, 2025, 5:36 a.m. | OK | PyPy 3-64 | TESTS | 27 | 530 | 3686400 | ||
| 307882333 | Jim_X | G | Feb. 26, 2025, 4:22 a.m. | OK | PyPy 3-64 | TESTS | 27 | 531 | 6451200 | ||
| 307936385 | vss103824_Umar.Farooq | G | Feb. 26, 2025, 12:57 p.m. | OK | PyPy 3-64 | TESTS | 27 | 562 | 6758400 | ||
| 307949927 | vxgmichel | G | Feb. 26, 2025, 2:31 p.m. | OK | PyPy 3-64 | TESTS | 27 | 577 | 5734400 | ||
| 307917285 | Polynomu | G | Feb. 26, 2025, 10:45 a.m. | OK | PyPy 3-64 | TESTS | 27 | 608 | 8294400 | ||
| 307882931 | BakhtiyarZBJ | G | Feb. 26, 2025, 4:33 a.m. | OK | PyPy 3-64 | TESTS | 27 | 609 | 23961600 | ||
| 307951128 | vxgmichel | G | Feb. 26, 2025, 2:41 p.m. | OK | PyPy 3-64 | TESTS | 27 | 624 | 5734400 | ||
| 307951217 | vxgmichel | G | Feb. 26, 2025, 2:42 p.m. | OK | Rust 2021 | TESTS | 27 | 109 | 0 | ||
| 307953864 | vxgmichel | G | Feb. 26, 2025, 3:02 p.m. | OK | Rust 2021 | TESTS | 27 | 109 | 102400 | ||
| 307987874 | Martician | G | Feb. 26, 2025, 7:16 p.m. | OK | Rust 2021 | TESTS | 27 | 156 | 0 |
Back to search problems