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 |
|---|---|---|---|---|---|---|
| 2048 | Codeforces Global Round 28 | FINISHED | False | 10800 | 41786723 | Dec. 19, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1307 ) | F | Kevin and Math Class | PROGRAMMING | brute force data structures divide and conquer dp math trees two pointers |
Kevin is a student from Eversleeping Town, currently attending a math class where the teacher is giving him division exercises. On the board, there are two rows of positive integers written, each containing (n) numbers. The first row is (a_1, a_2, \ldots, a_n), and the second row is (b_1, b_2, \ldots, b_n). For each division exercise, Kevin can choose any segment (l, r) and find the smallest value (x) among (b_l, b_{l+1}, \ldots, b_r). He will then modify each (a_i) for (l \leq i \leq r) to be the ceiling of (a_i) divided by (x). Formally, he selects two integers (1 \leq l \leq r \leq n), sets (x = \min_{l \leq i \leq r} b_i), and changes all (a_i) for (l \leq i \leq r) to (\lceil \frac{a_i}{x} \rceil). Kevin can leave class and go home when all (a_i) become (1). He is eager to leave and wants to know the minimum number of division exercises required to achieve this. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The first line of each test case contains an integer (n) ((1 \le n \leq 2 \cdot 10^5)) — the length of the sequence (a) and (b). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^{18})) — the first row of integers on the board. The third line of each test case contains (n) integers (b_1, b_2, \ldots, b_n) ((2 \le b_i \le 10^{18})) — the second row of integers on the board. It is guaranteed that the sum of (n) over all test cases doesn't exceed (2 \cdot 10^5). For each test case, output one integer — the minimum number of division exercises required to leave class. For the first test case: $$$ {\color{red}{5,4}},2\xrightarrow\min(b_1,b_2)=3{\text{operate segment }1,2}{\color{red}{2,2,2}}\xrightarrow\min(b_1,b_2,b_3)=2{\text{operate segment |
| Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 297341967 | KumaTachiRen | F | Dec. 19, 2024, 5:23 p.m. | OK | C# 10 | TESTS | 34 | 1734 | 306995200 | ||
| 297376931 | rogeryi | F | Dec. 20, 2024, 2:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 36 | 390 | 125849600 | ||
| 297380494 | vdudu | F | Dec. 20, 2024, 3:46 a.m. | OK | C++17 (GCC 7-32) | TESTS | 36 | 421 | 114995200 | ||
| 297375530 | rogeryi | F | Dec. 20, 2024, 2:12 a.m. | OK | C++17 (GCC 7-32) | TESTS | 36 | 421 | 125849600 | ||
| 297358765 | BenjaminJ | F | Dec. 19, 2024, 7:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 35 | 437 | 100761600 | ||
| 297357964 | MetalPower | F | Dec. 19, 2024, 7:41 p.m. | OK | C++17 (GCC 7-32) | TESTS | 35 | 468 | 104652800 | ||
| 297377766 | lnw143 | F | Dec. 20, 2024, 2:58 a.m. | OK | C++17 (GCC 7-32) | TESTS | 36 | 499 | 120524800 | ||
| 297377224 | Celebrate | F | Dec. 20, 2024, 2:47 a.m. | OK | C++17 (GCC 7-32) | TESTS | 36 | 499 | 151244800 | ||
| 297333941 | recollect_ii | F | Dec. 19, 2024, 4:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 34 | 514 | 107724800 | ||
| 297352898 | ltf0501 | F | Dec. 19, 2024, 6:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 34 | 515 | 124518400 | ||
| 297352268 | IzhtskiyTimofey | F | Dec. 19, 2024, 6:47 p.m. | OK | C++17 (GCC 7-32) | TESTS | 34 | 531 | 127795200 | ||
| 297334604 | maxplus | F | Dec. 19, 2024, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 249 | 29491200 | ||
| 297379273 | fydj | F | Dec. 20, 2024, 3:25 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 296 | 125952000 | ||
| 297391114 | fishcathu | F | Dec. 20, 2024, 6:03 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 312 | 113868800 | ||
| 297391424 | fishcathu | F | Dec. 20, 2024, 6:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 328 | 113766400 | ||
| 297360352 | Hori | F | Dec. 19, 2024, 8:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 35 | 358 | 126464000 | ||
| 297360715 | Hori | F | Dec. 19, 2024, 8:14 p.m. | OK | C++20 (GCC 13-64) | TESTS | 35 | 359 | 126771200 | ||
| 297377310 | DogSeven | F | Dec. 20, 2024, 2:49 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 374 | 117452800 | ||
| 297380509 | Ivan_len | F | Dec. 20, 2024, 3:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 374 | 130969600 | ||
| 297359377 | GOTKAKO | F | Dec. 19, 2024, 7:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 35 | 390 | 92774400 | ||
| 297382822 | AgafonovArtem | F | Dec. 20, 2024, 4:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 405 | 135987200 | ||
| 297377710 | __baozii__ | F | Dec. 20, 2024, 2:57 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 343 | 119296000 | ||
| 297381214 | Srginit286 | F | Dec. 20, 2024, 3:59 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 359 | 125542400 | ||
| 297354026 | rgnerdplayer | F | Dec. 19, 2024, 7 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 374 | 131891200 | ||
| 297376396 | Trial_light | F | Dec. 20, 2024, 2:31 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 374 | 236851200 | ||
| 297333322 | OIer_kzc | F | Dec. 19, 2024, 4:54 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 375 | 132096000 | ||
| 297373567 | dinosaurs | F | Dec. 20, 2024, 1:22 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 390 | 132198400 | ||
| 297354254 | rgnerdplayer | F | Dec. 19, 2024, 7:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 390 | 132198400 | ||
| 297376731 | Anonyme | F | Dec. 20, 2024, 2:38 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 406 | 133529600 | ||
| 297362958 | basebillions | F | Dec. 19, 2024, 8:45 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 35 | 406 | 155238400 | ||
| 297376937 | cooluo | F | Dec. 20, 2024, 2:41 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 452 | 127488000 | ||
| 297372695 | lyongwolf | F | Dec. 20, 2024, 12:56 a.m. | OK | Java 21 | TESTS | 36 | 703 | 191590400 | ||
| 297333133 | Dukkha | F | Dec. 19, 2024, 4:54 p.m. | OK | Java 21 | TESTS | 34 | 1265 | 614400 | ||
| 297342840 | Egor | F | Dec. 19, 2024, 5:26 p.m. | OK | Rust 2021 | TESTS | 34 | 202 | 78950400 | ||
| 297353366 | titia | F | Dec. 19, 2024, 6:54 p.m. | OK | Rust 2021 | TESTS | 34 | 1562 | 114483200 |
Back to search problems