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 |
|---|---|---|---|---|---|---|
| 2178 | Good Bye 2025 | FINISHED | False | 10800 | 9559523 | Dec. 27, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 3665 ) | E | Flatten or Concatenate | PROGRAMMING | binary search divide and conquer interactive |
This is an interactive problem. While procrastinating at work, Dilhan the elf stumbled upon two arrays (a) and (b). Initially, both of them consist of a single integer (2^k) (i.e., (a=b=2^k)), where (k) is a non-negative integer. Dilhan then applied the following two types of operations an arbitrary number of times (possibly zero), in any order: Flatten — Choose either (a) or (b), and select any element (x) that is maximal within that array ((x) does not need to be maximal in the other array). Then, replace (x) with two copies of (\frac x2) in the same position. This operation can only be applied if (x) is even. Concatenate — Set both (a) and (b) to be (a+b), where (+) denotes array concatenation. After performing these operations, Dilhan discards (b), hides (a) from you, and challenges you to a game. Let (n) be the length of the hidden array (a). You may make the following query: Choose an interval (l, r) ((1\le l\le r\le n)), and Dilhan will tell you the sum (a_l+a_{l+1}+\cdots+a_r). Determine the value of the maximum element of (a) by making at most (300) queries. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \le n \le 10^5)) — the length of (a). It is guaranteed that (1\le a_i\le 2^{30}), and the array (a) can be generated by the process described in the statements. It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each test case, you are first given an integer (n) — the length of the hidden array (a). You may then make up to (300) queries. To make a query, print a line in the following format: (?\;l\;r) ((1\le l\le r\le n)) — the indices chosen for the query. After you print a |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 355440309 | HardikAggarwal45 | E | Dec. 28, 2025, 4:47 a.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 31 | 0 | ||
| 355418559 | canthitmyprotein | E | Dec. 27, 2025, 8:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 31 | 0 | ||
| 355441194 | Worldwide_D | E | Dec. 28, 2025, 5:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355436843 | hs.xx | E | Dec. 28, 2025, 3:44 a.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355427597 | average_coder_09 | E | Dec. 27, 2025, 11:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355424083 | AhmedQassem_ | E | Dec. 27, 2025, 10:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355423022 | arvindr9 | E | Dec. 27, 2025, 9:43 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355422636 | kzrobin | E | Dec. 27, 2025, 9:35 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355422358 | TemporalBloom | E | Dec. 27, 2025, 9:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355421665 | vivid_stareium | E | Dec. 27, 2025, 9:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 37 | 46 | 0 | ||
| 355395915 | BUAA_bacon | E | Dec. 27, 2025, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 31 | 102400 | ||
| 355445713 | JCNotFound | E | Dec. 28, 2025, 5:59 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355444971 | qianwai | E | Dec. 28, 2025, 5:51 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355444850 | qianwai | E | Dec. 28, 2025, 5:50 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355443566 | TViu | E | Dec. 28, 2025, 5:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355440452 | lftroq | E | Dec. 28, 2025, 4:49 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355439922 | thisislike_fan | E | Dec. 28, 2025, 4:40 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355437729 | cxhscst2 | E | Dec. 28, 2025, 4:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355435813 | XKM_7 | E | Dec. 28, 2025, 3:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 | ||
| 355433712 | DangKhoizzzz | E | Dec. 28, 2025, 2:42 a.m. | OK | C++20 (GCC 13-64) | TESTS | 37 | 46 | 0 |
Back to search problems