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 |
|---|---|---|---|---|---|---|
| 2229 | Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) | FINISHED | False | 10800 | 833086 | May 23, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 856 ) | F | Load Unbalancing | PROGRAMMING | binary search bitmasks dp greedy implementation |
Note the unusually low time limit. You are given a sequence (a) of length (n), as well as an integer (k). You may first reorder the elements of (a) however you like. Then, define (f(a)) as follows: Let (b) be an array of length (k) which is initially all zeros. For each (1 \le i \le n) in order, add (a_i) to any minimum element of (b). At the end of this process, (f(a) = \max(b)). Find the maximum possible value of (f(a)) among all rearrangements of (a). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1 \le k \le n \le 18)). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^9)). It is guaranteed that the sum of (2^n) over all test cases does not exceed (2^{18}). For each test case, output a single integer — the maximum possible value of (f(a)) among all rearrangements of (a). In the first test case of the second example, one optimal rearrangement of (a) is (1, 4, 2, 5). (f(a)) is computed as follows: After this, (f(a) = \max(8,4) = 8). It can be shown that the maximum achievable (f(a)) is (8). In the third test case of the second example, one optimal rearrangement of (a) is (3, 1, 2, 3, 5, 4, 3, 4). |
| Spectral::Cup 2026 Round 2 (Codeforces Round 1100, 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 375842409 | ashutoshkumarjaiswal461 | F | May 23, 2026, 5:05 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 46 | 102400 | ||
| 375834746 | exoworldgd | F | May 23, 2026, 4:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 46 | 2457600 | ||
| 375847096 | Moatazoleq | F | May 23, 2026, 5:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 62 | 102400 | ||
| 375845675 | BurningBeast | F | May 23, 2026, 5:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 62 | 102400 | ||
| 375837398 | GlacierWolf | F | May 23, 2026, 4:43 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 93 | 3174400 | ||
| 375838169 | sbt214 | F | May 23, 2026, 4:46 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 93 | 26316800 | ||
| 375832396 | zddtuus | F | May 23, 2026, 4:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 125 | 102400 | ||
| 375833399 | Ice_man2.0 | F | May 23, 2026, 4:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 125 | 7475200 | ||
| 375855784 | jeetganatra | F | May 23, 2026, 6:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 187 | 102400 | ||
| 375840980 | kalimm | F | May 23, 2026, 4:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 234 | 1638400 |
Back to search problems