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 |
|---|---|---|---|---|---|---|
| 2018 | Codeforces Round 975 (Div. 1) | FINISHED | False | 9000 | 48961523 | Sept. 27, 2024, 1:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 300 ) | F3 | Speedbreaker Counting (Hard Version) | PROGRAMMING | dp greedy math |
This is the hard version of the problem. In the three versions, the constraints on (n) and the time limit are different. You can make hacks only if all the versions of the problem are solved. This is the statement of Problem D1B : There are (n) cities in a row, numbered (1, 2, \ldots, n) left to right. At time (1), you conquer exactly one city, called the starting city . At time (2, 3, \ldots, n), you can choose a city adjacent to the ones conquered so far and conquer it. You win if, for each (i), you conquer city (i) at a time no later than (a_i). A winning strategy may or may not exist, also depending on the starting city. How many starting cities allow you to win? At time (1), you conquer exactly one city, called the starting city . At time (2, 3, \ldots, n), you can choose a city adjacent to the ones conquered so far and conquer it. You win if, for each (i), you conquer city (i) at a time no later than (a_i). A winning strategy may or may not exist, also depending on the starting city. How many starting cities allow you to win? For each (0 \leq k \leq n), count the number of arrays of positive integers (a_1, a_2, \ldots, a_n) such that (1 \leq a_i \leq n) for each (1 \leq i \leq n); the answer to Problem D1B is (k). The answer can be very large, so you have to calculate it modulo a given prime (p). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 3000)). The description of the test cases follows. The only line of each test case contains two integers (n), (p) ((1 \le n \le 3000), (10^8 \leq p \leq 10^9), (p) is prime) — the number of cities and the modulo. It is guaranteed that the sum of (n) over all test cases does not exceed (3000). For each test case, output (n+1) integers: the (i)-th integer should be the number of arrays that satisfy the conditions for (k = i-1). In th |
| Editorial of Codeforces Round 975 (Div. 1, Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 283291974 | Ormlis | F3 | Sept. 28, 2024, 12:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 102400 | ||
| 283242213 | Endagorion | F3 | Sept. 27, 2024, 3:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 155 | 102400 | ||
| 283289082 | Felipe006 | F3 | Sept. 27, 2024, 10:57 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 233 | 102400 | ||
| 283231408 | crazy_sea | F3 | Sept. 27, 2024, 3:10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 233 | 102400 | ||
| 283293832 | MakaPakka | F3 | Sept. 28, 2024, 1:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 233 | 72499200 | ||
| 283274670 | Ormlis | F3 | Sept. 27, 2024, 7:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 374 | 102400 | ||
| 283257667 | alireza_kaviani | F3 | Sept. 27, 2024, 4:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 390 | 72704000 | ||
| 283240426 | DPprince | F3 | Sept. 27, 2024, 3:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 421 | 146227200 | ||
| 283296128 | Chenly | F3 | Sept. 28, 2024, 2:04 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 436 | 144896000 | ||
| 283237265 | wwwwodddd | F3 | Sept. 27, 2024, 3:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 561 | 73216000 | ||
| 283271588 | turmax | F3 | Sept. 27, 2024, 6:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 204800 | ||
| 283303795 | le0n | F3 | Sept. 28, 2024, 3:55 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 3686400 | ||
| 283296378 | Flamire | F3 | Sept. 28, 2024, 2:09 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 77 | 4096000 | ||
| 283297200 | A_G | F3 | Sept. 28, 2024, 2:21 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 124 | 102400 | ||
| 283236714 | Nachia | F3 | Sept. 27, 2024, 3:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 124 | 102400 | ||
| 283289118 | Benq | F3 | Sept. 27, 2024, 10:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 171 | 35737600 | ||
| 283219246 | hos.lyric | F3 | Sept. 27, 2024, 2:41 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 171 | 36352000 | ||
| 283250516 | Xylenox | F3 | Sept. 27, 2024, 3:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 265 | 102400 | ||
| 283261412 | _MASSIMO_ | F3 | Sept. 27, 2024, 5:14 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 265 | 68608000 | ||
| 283240882 | jiangly | F3 | Sept. 27, 2024, 3:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 265 | 68608000 | ||
| 283298613 | hhoppitree | F3 | Sept. 28, 2024, 2:41 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 46 | 102400 | ||
| 283290196 | nicksms | F3 | Sept. 27, 2024, 11:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 46 | 102400 | ||
| 283287968 | nicksms | F3 | Sept. 27, 2024, 10:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 46 | 102400 | ||
| 283288320 | nicksms | F3 | Sept. 27, 2024, 10:37 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 61 | 102400 | ||
| 283267674 | SparshMittal11 | F3 | Sept. 27, 2024, 6 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 234 | 68710400 | ||
| 283223675 | PEIMUDA | F3 | Sept. 27, 2024, 2:52 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 311 | 144691200 | ||
| 283249803 | ecnerwala | F3 | Sept. 27, 2024, 3:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 312 | 102400 | ||
| 283289652 | hhoppitree | F3 | Sept. 27, 2024, 11:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 328 | 102400 | ||
| 283299419 | Richard1211 | F3 | Sept. 28, 2024, 2:54 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 328 | 142848000 | ||
| 283273255 | nicksms | F3 | Sept. 27, 2024, 6:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 13 | 452 | 102400 | ||
| 283206528 | rainboy | F3 | Sept. 27, 2024, 2:14 p.m. | OK | GNU C11 | TESTS | 13 | 327 | 36147200 | ||
| 283284888 | bnmanubharadwaj | F3 | Sept. 27, 2024, 9:23 p.m. | OK | Node.js | TESTS | 13 | 2905 | 55091200 | ||
| 283302181 | xlk | F3 | Sept. 28, 2024, 3:34 a.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 2662400 | ||
| 283303203 | xlk | F3 | Sept. 28, 2024, 3:47 a.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 2764800 | ||
| 283244371 | Egor | F3 | Sept. 27, 2024, 3:42 p.m. | OK | Rust 2021 | TESTS | 13 | 686 | 141107200 |
Back to search problems