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 |
|---|---|---|---|---|---|---|
| 2249 | Codeforces Round 1112 (Div. 1) | FINISHED | False | 9000 | 2388314 | July 26, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 203 ) | E1 | String (Easy Version) | PROGRAMMING | divide and conquer implementation strings |
This is the easy version of the problem. The difference between the versions is that in this version, the constraints on (k) and (q) are smaller. You can hack only if you solved all versions of this problem. Define (\mathrm{popcount}_k(m)) as the sum of all digits of (m) in base (k). Define a base-(k) integer (s=\overline{s_1s_2\cdots}) of infinite length, where the (i)-th digit of (s) is (s_i=(\mathrm{popcount}_k(i) \bmod k)). There are (q) queries. Each query consists of three integers (l), (r), and (n) (all of them are given in decimal form), as well as a base-(k) integer (t) with (n) digits. Note that (t) may have leading zeros. Consider (t) as a string, and your task is to find the number of occurrences of (t) in the string (s_ls_{l+1}\ldots s_r). For digits greater than or equal to decimal (\mathtt{10}), uppercase and lowercase letters are used. Specifically, the uppercase letters (\{\mathtt{A, B,\ldots,Z}\}) represent the decimal values (\{\mathtt{10, 11,\ldots,35}\}), and the lowercase letters (\{\mathtt{a, b,\ldots,z}\}) represent the decimal values (\{\mathtt{36, 37,\ldots,61}\}). The first line of the input contains two integers (k) and (q) ((2\le k\le 10), (1\le q\le 1000)) — the base and the number of queries. Each query contains two lines. The first line contains the three integers (l), (r), and (n) ((1\le l\le r\le 10^{17}), (1\le n\le 2\cdot 10^6)). The second line contains the base-(k) integer (t) with (n) digits ((t_i\in\{\mathtt{0,1,\ldots,9,A,B,\ldots,Z,a,b,\ldots,z}\})). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^6). For each query, output a single integer — the answer to the query. Denote the string (s_ls_{l+1}\ldots s_r) as (sl;r). In the first example, (k = 3), (s = \mathtt{12120201120201012201120012\ldots}), $$$ |
| Codeforces Round 1112 (Div. 1, Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 384453158 | supercoder888 | E1 | July 27, 2026, 2:09 a.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 93 | 243302400 | ||
| 384449367 | 1.618 | E1 | July 27, 2026, 12:55 a.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 156 | 1126400 | ||
| 384421607 | _annhien_ruby22 | E1 | July 26, 2026, 4:54 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 156 | 12492800 | ||
| 384417707 | chintu | E1 | July 26, 2026, 4:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 187 | 14131200 | ||
| 384409315 | potato167 | E1 | July 26, 2026, 4:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 187 | 30515200 | ||
| 384438542 | milky0002 | E1 | July 26, 2026, 7:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 203 | 22220800 | ||
| 384413279 | macsolaso | E1 | July 26, 2026, 4:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 218 | 12185600 | ||
| 384416676 | yinghua_luoxue | E1 | July 26, 2026, 4:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 265 | 129126400 | ||
| 384441489 | kasjf | E1 | July 26, 2026, 8:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 406 | 12185600 | ||
| 384416850 | FdHasd | E1 | July 26, 2026, 4:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 48 | 671 | 19046400 | ||
| 384422928 | zeroliebe | E1 | July 26, 2026, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 62 | 8294400 | ||
| 384444777 | Geothermal | E1 | July 26, 2026, 10:03 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 156 | 18739200 | ||
| 384430461 | Ormlis | E1 | July 26, 2026, 6:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 171 | 4198400 | ||
| 384421011 | xuanxuan001 | E1 | July 26, 2026, 4:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 234 | 18124800 | ||
| 384424586 | Survivor_winner | E1 | July 26, 2026, 5:04 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 250 | 49664000 | ||
| 384420189 | iloveMT | E1 | July 26, 2026, 4:49 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 359 | 27340800 | ||
| 384430464 | 244mhq | E1 | July 26, 2026, 6:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 375 | 14643200 | ||
| 384423115 | FLY_lai | E1 | July 26, 2026, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 468 | 13516800 | ||
| 384419993 | wuyuetong | E1 | July 26, 2026, 4:48 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 718 | 268083200 | ||
| 384421986 | shiomusubi496 | E1 | July 26, 2026, 4:55 p.m. | OK | C++20 (GCC 13-64) | TESTS | 48 | 828 | 22425600 | ||
| 384456537 | GordenSoul | E1 | July 27, 2026, 3:03 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 62 | 7475200 | ||
| 384423595 | Altair_45 | E1 | July 26, 2026, 5:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 93 | 15462400 | ||
| 384422285 | Benq | E1 | July 26, 2026, 4:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 109 | 1331200 | ||
| 384417456 | woyebuzhidaowoshishui | E1 | July 26, 2026, 4:39 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 109 | 3174400 | ||
| 384409914 | LLI_E_P_JI_O_K | E1 | July 26, 2026, 4:14 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 109 | 7475200 | ||
| 384445871 | bitset | E1 | July 26, 2026, 10:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 125 | 2252800 | ||
| 384429091 | permutation | E1 | July 26, 2026, 5:52 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 125 | 6553600 | ||
| 384416479 | StevenKnight | E1 | July 26, 2026, 4:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 125 | 11366400 | ||
| 384427725 | Sulfox | E1 | July 26, 2026, 5:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 125 | 28774400 | ||
| 384417917 | hodza | E1 | July 26, 2026, 4:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 48 | 140 | 13312000 | ||
| 384451435 | codecrasher_ | E1 | July 27, 2026, 1:38 a.m. | OK | Go | TESTS | 48 | 93 | 23040000 | ||
| 384423690 | AJ123496 | E1 | July 26, 2026, 5:01 p.m. | OK | Java 21 | TESTS | 48 | 468 | 15257600 | ||
| 384411192 | dumb_god | E1 | July 26, 2026, 4:18 p.m. | OK | PyPy 3-64 | TESTS | 48 | 281 | 11468800 | ||
| 384429179 | superbcoder102 | E1 | July 26, 2026, 5:53 p.m. | OK | PyPy 3-64 | TESTS | 48 | 343 | 52224000 | ||
| 384420562 | anango | E1 | July 26, 2026, 4:51 p.m. | OK | PyPy 3-64 | TESTS | 48 | 1671 | 160051200 | ||
| 384412590 | d11maan | E1 | July 26, 2026, 4:22 p.m. | OK | Rust 2024 | TESTS | 48 | 62 | 2150400 | ||
| 384451495 | trycatchcry | E1 | July 27, 2026, 1:38 a.m. | OK | Rust 2024 | TESTS | 48 | 78 | 4198400 | ||
| 384418126 | Egor | E1 | July 26, 2026, 4:41 p.m. | OK | Rust 2024 | TESTS | 48 | 562 | 15564800 |
Back to search problems