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 |
|---|---|---|---|---|---|---|
| 2057 | Hello 2025 | FINISHED | False | 9000 | 40404322 | Jan. 4, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 246 ) | F | Formation | PROGRAMMING | dp sortings |
One day, the teachers of "T-generation" decided to instill discipline in the pupils, so they lined them up and made them calculate in order. There are a total of (n) pupils, the height of the (i)-th pupil in line is (a_i). The line is comfortable , if for each (i) from (1) to (n - 1), the following condition holds: (a_i \cdot 2 \ge a_{i + 1}). Initially, the line is comfortable. The teachers do not like that the maximum height in the line is too small, so they want to feed the pupils pizza. You know that when a pupil eats one pizza, their height increases by (1). One pizza can only be eaten by only one pupil, but each pupil can eat an unlimited number of pizzas. It is important that after all the pupils have eaten their pizzas, the line is comfortable. The teachers have (q) options for how many pizzas they will order. For each option (k_i), answer the question: what is the maximum height (\max(a_1, a_2, \ldots, a_n)) that can be achieved if the pupils eat at most (k_i) pizzas. Each test contains multiple test cases. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The description of the test cases follows. The first line of each set of test case contains two integers (n) and (q) ((1 \le n, q \le 5 \cdot 10^4)) — the number of pupils and the number of options for how many pizzas the teachers will order. The second line of each set of test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^9)) — the heights of the pupils.It is guaranteed that initially, the line is comfortable. Each of the following (q) lines of each set of input data contains one integer (k_i) ((1 \le k_i \le 10^9)) — the next limit for how many pizzas the pupils can eat. It is guaranteed that the sum of the values of (n) across all sets of input data does not exceed (5 \cdot 10^4). It is guaranteed that the sum of the values of |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 299730334 | skywalkert | F | Jan. 5, 2025, 5:53 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 265 | 9523200 | ||
| 299698262 | vlomaczk | F | Jan. 4, 2025, 6:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 749 | 6348800 | ||
| 299695227 | Az3ar | F | Jan. 4, 2025, 6:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 1452 | 61644800 | ||
| 299702963 | peltorator | F | Jan. 4, 2025, 7:48 p.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 1874 | 125337600 | ||
| 299715049 | A_G | F | Jan. 5, 2025, 12:49 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 577 | 25395200 | ||
| 299686395 | Ormlis | F | Jan. 4, 2025, 5 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 655 | 4300800 | ||
| 299713225 | kaiboy | F | Jan. 4, 2025, 11:38 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 1140 | 19865600 | ||
| 299714990 | A_G | F | Jan. 5, 2025, 12:46 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 1156 | 25600000 | ||
| 299684598 | isaf27 | F | Jan. 4, 2025, 4:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 1374 | 145612800 | ||
| 299695818 | hhhgjyismine | F | Jan. 4, 2025, 6:38 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 1593 | 20889600 | ||
| 299696011 | Tlatoani | F | Jan. 4, 2025, 6:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 1655 | 454963200 | ||
| 299711989 | Golovanov399 | F | Jan. 4, 2025, 10:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 2030 | 71987200 | ||
| 299686296 | oleh1421 | F | Jan. 4, 2025, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 2093 | 47923200 | ||
| 299717433 | qiuzx | F | Jan. 5, 2025, 2:09 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 2686 | 50995200 | ||
| 299695381 | dorijanlendvaj | F | Jan. 4, 2025, 6:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 624 | 530841600 | ||
| 299682137 | maspy | F | Jan. 4, 2025, 4:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 656 | 47513600 | ||
| 299711047 | rainboy | F | Jan. 4, 2025, 10:22 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 671 | 20275200 | ||
| 299718620 | tkacper | F | Jan. 5, 2025, 2:41 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1124 | 1228800 | ||
| 299704805 | Endagorion | F | Jan. 4, 2025, 8:11 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1265 | 105984000 | ||
| 299724667 | AgafonovArtem | F | Jan. 5, 2025, 4:43 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1327 | 9830400 | ||
| 299698399 | Petr | F | Jan. 4, 2025, 7 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1327 | 89907200 | ||
| 299689121 | noimi | F | Jan. 4, 2025, 5:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1468 | 51916800 | ||
| 299716407 | NetSpeed1 | F | Jan. 5, 2025, 1:39 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1562 | 49049600 | ||
| 299679174 | Kevin114514 | F | Jan. 4, 2025, 4:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 1655 | 61235200 | ||
| 299707474 | rainboy | F | Jan. 4, 2025, 8:55 p.m. | OK | GNU C11 | TESTS | 17 | 906 | 20377600 | ||
| 299709912 | Dukkha | F | Jan. 4, 2025, 9:50 p.m. | OK | Java 21 | TESTS | 17 | 2671 | 76800000 | ||
| 299683776 | arvindf232 | F | Jan. 4, 2025, 4:54 p.m. | OK | Kotlin 1.9 | TESTS | 17 | 2999 | 9011200 | ||
| 299694976 | Maksim1744 | F | Jan. 4, 2025, 6:32 p.m. | OK | Rust 2021 | TESTS | 17 | 1171 | 118988800 |
Back to search problems