2026 ICPC Asia Pacific Championship - Online Mirror (Unrated, Online Mirror, ICPC Rules, Teams Preferred)

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
2206 2026 ICPC Asia Pacific Championship - Online Mirror (Unrated, Online Mirror, ICPC Rules, Teams Preferred) FINISHED False 18000 3471323 March 8, 2026, 1:45 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 359 ) E Parallel Sums PROGRAMMING data structures

You are given two integers (n) and (m). For a sequence of (n) integers (A=(a_1, a_2, \ldots, a_n)), the parallel sums of (A) are the (n-m+1) integers (s_1, s_2, \ldots, s_{n-m+1}) defined by (s_i = a_i + a_{i+1} + \ldots + a_{i+m-1}) for each (i) ((1 \leq i \leq n-m+1)). You are given the values of (s_1, s_2, \ldots, s_{n-m+1}). Your task is to answer (q) queries, described as follows. In the (j)-th query, you are given two integers (l_j) and (r_j), and you are asked to find the smallest possible value of (\max(a_{l_j}, a_{l_j+1}, \ldots, a_{r_j})) among all sequences (A=(a_1, a_2, \ldots, a_n)) of (n) integers (possibly negative) such that (s_1, s_2, \ldots, s_{n-m+1}) are the parallel sums of (A). Or determine if this value can be arbitrarily small. The first line of input contains two integers (n) and (m) ((1 \leq m \leq n \leq 200\,000)). The second line contains (n-m+1) integers (s_1, s_2, \ldots, s_{n-m+1}) ((-10^9 \leq s_i \leq 10^9)). The third line contains a single integer (q) ((1 \leq q \leq 100\,000)). The (j)-th of the next (q) lines contains two integers (l_j) and (r_j) ((1 \leq l_j \leq r_j \leq n)). Output (q) lines. The (j)-th line should contain the smallest possible value of (\max(a_{l_j}, a_{l_j+1}, \ldots, a_{r_j})). If that value can be arbitrarily small, output unbounded instead. Explanation for the sample input/output #1 For the first query, take (A = (9, -4, -3, 2, 1, 2, 1, 1)). The parallel sums of (A) are ((4, -4, 2, 6, 5)) as required. Then (\max(a_3, \ldots, a_7) = \max(-3, 2, 1, 2, 1) = 2). It can be shown that (2) is the smallest possible value. For the second query, you can make the value arbitrarily small. For the third query, take (A = (4, -3, 0, 3, -4, 3, 4, 2)). Then (\max(4, -3, 0, 3, -4, 3, 4, 2) = 4), which is the smallest possible value.

Tutorials

Tutorial (PDF)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
365797008 mtsd potato167 toam E March 8, 2026, 3:26 a.m. OK C++17 (GCC 7-32) TESTS 73 234 129536000
365804234 hngwlog Miraclehehe nmhai E March 8, 2026, 5:22 a.m. OK C++17 (GCC 7-32) TESTS 73 625 6144000
365802225 AK589 LucZha E March 8, 2026, 4:58 a.m. OK C++17 (GCC 7-32) TESTS 73 796 10956800
365801377 gs12117 E March 8, 2026, 4:44 a.m. OK C++17 (GCC 7-32) TESTS 73 1296 10854400
365803126 Yaronicee. E March 8, 2026, 5:09 a.m. OK C++17 (GCC 7-32) TESTS 73 1484 32153600
365820353 CrossFire1 E March 8, 2026, 8:13 a.m. OK C++17 (GCC 7-32) TESTS 73 1531 35123200
365804588 hiteshjakhar__29 E March 8, 2026, 5:26 a.m. OK C++17 (GCC 7-32) TESTS 73 1781 33484800
365806230 zoryn E March 8, 2026, 5:46 a.m. OK C++17 (GCC 7-32) TESTS 73 2046 289894400
365805228 pinerush pinterestlover123 E March 8, 2026, 5:34 a.m. OK C++17 (GCC 7-32) TESTS 73 2265 37171200
365798244 mo0dman Arsentii OneCyborg E March 8, 2026, 3:50 a.m. OK C++17 (GCC 7-32) TESTS 73 2437 16588800
365804060 hint908 E March 8, 2026, 5:20 a.m. OK C++20 (GCC 13-64) TESTS 73 171 10956800
365801806 YeongTree 16silver Karuna E March 8, 2026, 4:51 a.m. OK C++20 (GCC 13-64) TESTS 73 171 17305600
365792664 Xerxes E March 8, 2026, 2:11 a.m. OK C++20 (GCC 13-64) TESTS 73 187 21504000
365805034 hieua3xyz thinguyen2351 _VNND E March 8, 2026, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 73 218 23244800
365809222 guodong2005 Toap E March 8, 2026, 6:18 a.m. OK C++20 (GCC 13-64) TESTS 73 218 181452800
365928209 czjxyz E March 9, 2026, 12:38 a.m. OK C++20 (GCC 13-64) TESTS 73 312 14643200
365800175 onbert tosivanmak shqrky E March 8, 2026, 4:23 a.m. OK C++20 (GCC 13-64) TESTS 73 359 154931200
365795622 LanceTheDragonTrainer E March 8, 2026, 3:03 a.m. OK C++20 (GCC 13-64) TESTS 73 468 366284800
365797228 prantogoswamee E March 8, 2026, 3:30 a.m. OK C++20 (GCC 13-64) TESTS 73 578 166809600
365896149 islingr E March 8, 2026, 5:01 p.m. OK C++20 (GCC 13-64) TESTS 73 796 87347200
365793293 VHPro Kuroni fextivity E March 8, 2026, 2:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 171 18432000
365805806 ahyeon Wansur E March 8, 2026, 5:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 187 19148800
365801193 415411 E March 8, 2026, 4:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 187 51814400
365813379 ItsJerr E March 8, 2026, 7 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 203 150937600
365798529 Khaled_the27th ma3karona_blba4amil E March 8, 2026, 3:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 218 21504000
365800251 foolishgoat E March 8, 2026, 4:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 218 256716800
365813511 ItsJerr E March 8, 2026, 7:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 234 150937600
365799729 User-Unauthorized youiaOO E March 8, 2026, 4:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 250 150016000
365799594 kylin0610 E March 8, 2026, 4:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 73 281 21606400
365857136 didxga E March 8, 2026, 1:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 73 296 33996800
365795823 Chayanine E March 8, 2026, 3:06 a.m. OK PyPy 3-64 TESTS 73 1140 115507200
365798340 mikelou E March 8, 2026, 3:51 a.m. OK PyPy 3-64 TESTS 73 2906 78745600
365856592 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856545 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856536 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856519 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856497 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856430 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856425 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856405 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856392 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0
365856390 E March 8, 2026, 1:52 p.m. OK Unknown TESTS 0 0 0

remove filters

Back to search problems