EPIC Institute of Technology Round Summer 2025 (Codeforces Round 1036, Div. 1 + Div. 2)

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
2124 EPIC Institute of Technology Round Summer 2025 (Codeforces Round 1036, Div. 1 + Div. 2) FINISHED False 10800 24593123 July 6, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3800 ) E Make it Zero PROGRAMMING constructive algorithms math

You are given an array (a), consisting of (n) positive integers. You are allowed to do the following operation: Select an array (b) of size (n) such that the following properties hold: (0 \leq b_i \leq a_i) for each (1 \leq i \leq n) There exists an index (1\leq i < n) such that (b_1+b_2+\ldots+b_i=b_{i+1}+b_{i+2}+\ldots+b_n). That is, the sum of the prefix of length (i) is equal to the sum of the suffix of length (n-i). (0 \leq b_i \leq a_i) for each (1 \leq i \leq n) There exists an index (1\leq i < n) such that (b_1+b_2+\ldots+b_i=b_{i+1}+b_{i+2}+\ldots+b_n). That is, the sum of the prefix of length (i) is equal to the sum of the suffix of length (n-i). Then, subtract (b_i) from (a_i) for each (1 \leq i \leq n). Your task is to change all the elements to (0). Find the minimum number of operations required. Then, output a way to perform the operations. If it is impossible to change all the elements of (a) to (0) no matter how many operations are used, print (-1) instead. It can be shown that under the constraints of this problem, the smallest number of operations required is at most (17). 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 an integer (n) ((2 \leq n \leq 5\cdot 10^4)) — the length of the array (a). The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((1 \leq a_i \leq 10^{12})) — denoting the array (a). It is guaranteed that the sum of (n) over all test cases does not exceed (5\cdot 10^4). For each test case, output (-1) if there is no solution. Otherwise, first output an integer (s) ((1 \leq s \leq 17)) – the minimum number of operations to change all the elements of (a) to (0). Then, in the next (s) lines,

Tutorials

EPIC Institute of Technology Round Summer 2025 (Codeforces Round 1036, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
327819100 stupidnessplusplus E July 6, 2025, 5:12 p.m. OK C# 10 TESTS 30 187 13209600
327867005 yzljy E July 7, 2025, 4:38 a.m. OK C++17 (GCC 7-32) TESTS 30 62 10854400
327841149 close_fish E July 6, 2025, 8:43 p.m. OK C++17 (GCC 7-32) TESTS 30 77 0
327812240 ShadowPhoenix E July 6, 2025, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 30 77 0
327876310 surajbhan99 E July 7, 2025, 5:54 a.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327875483 yuanmouren E July 7, 2025, 5:45 a.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327858023 JohnHei E July 7, 2025, 2:44 a.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327857567 vrooooom E July 7, 2025, 2:38 a.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327853874 explorerxx E July 7, 2025, 1:40 a.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327848911 bubbarob19 E July 6, 2025, 11:43 p.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327839197 LennartF22 E July 6, 2025, 8:14 p.m. OK C++17 (GCC 7-32) TESTS 30 77 102400
327862369 slmhh E July 7, 2025, 3:38 a.m. OK C++20 (GCC 13-64) TESTS 30 61 102400
327832780 enar E July 6, 2025, 7:05 p.m. OK C++20 (GCC 13-64) TESTS 30 62 0
327872233 moonshy E July 7, 2025, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327859682 shiinamashiro_ E July 7, 2025, 3:05 a.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327858167 travel. E July 7, 2025, 2:45 a.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327851655 X0rpr1se E July 7, 2025, 12:52 a.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327850823 Xh_QwQ E July 7, 2025, 12:37 a.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327836200 MrPerson E July 6, 2025, 7:38 p.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327833373 Yan233_ E July 6, 2025, 7:10 p.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327833120 bebopboi E July 6, 2025, 7:08 p.m. OK C++20 (GCC 13-64) TESTS 30 62 102400
327876177 maspy E July 7, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 46 307200
327859879 lfx-9877 E July 7, 2025, 3:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 61 1638400
327855473 xly_tyty E July 7, 2025, 2:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 61 1638400
327843413 whiitex E July 6, 2025, 9:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 0
327836576 temperature E July 6, 2025, 7:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 0
327833984 anhkha1004 E July 6, 2025, 7:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 0
327876295 YangJ1an E July 7, 2025, 5:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 102400
327875930 TWlLlGHT E July 7, 2025, 5:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 102400
327874933 nifeshe E July 7, 2025, 5:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 102400
327874067 PQ2876 E July 7, 2025, 5:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 102400
327813426 pengin_2000 E July 6, 2025, 4:52 p.m. OK GNU C11 TESTS 30 140 1638400
327848031 rainboy E July 6, 2025, 11:17 p.m. OK GNU C11 TESTS 30 484 921600
327817446 lyongwolf E July 6, 2025, 5:06 p.m. OK Java 21 TESTS 30 280 2150400
327820495 WrongAnswerOnTestCase2 E July 6, 2025, 5:17 p.m. OK Java 21 TESTS 30 327 921600
327848255 wddd E July 6, 2025, 11:23 p.m. OK Java 21 TESTS 30 327 1024000
327866240 man-ray E July 7, 2025, 4:26 a.m. OK Java 21 TESTS 30 327 1228800
327810069 redreoicy E July 6, 2025, 4:42 p.m. OK Java 21 TESTS 30 343 1740800
327846853 testtest111ksjfrdvn E July 6, 2025, 10:41 p.m. OK Java 21 TESTS 30 437 921600
327819334 golions E July 6, 2025, 5:13 p.m. OK Java 8 TESTS 30 234 409600
327817258 kasiru_69 E July 6, 2025, 5:06 p.m. OK Java 8 TESTS 30 374 409600
327810798 blu_bird E July 6, 2025, 4:44 p.m. OK Kotlin 1.7 TESTS 30 1092 106393600
327824793 L-S-S E July 6, 2025, 5:32 p.m. OK Kotlin 1.9 TESTS 30 343 921600
327821126 ckuhn222 E July 6, 2025, 5:19 p.m. OK Kotlin 1.9 TESTS 30 405 2662400
327817711 ultron513 E July 6, 2025, 5:07 p.m. OK PHP TESTS 30 437 117862400
327812478 vlk0 E July 6, 2025, 4:49 p.m. OK PyPy 3-64 TESTS 30 218 9011200
327853739 Little_Sheep_Yawn E July 7, 2025, 1:38 a.m. OK PyPy 3-64 TESTS 30 233 14336000
327821902 mbial E July 6, 2025, 5:22 p.m. OK PyPy 3-64 TESTS 30 249 12185600
327862710 dalgu_py E July 7, 2025, 3:42 a.m. OK PyPy 3-64 TESTS 30 249 33177600
327809438 Mukundan314 E July 6, 2025, 4:40 p.m. OK PyPy 3-64 TESTS 30 264 10752000
327812445 Shri_874 E July 6, 2025, 4:49 p.m. OK PyPy 3-64 TESTS 30 264 11366400
327842748 min_worked E July 6, 2025, 9:11 p.m. OK PyPy 3-64 TESTS 30 265 10547200
327815176 monocrap E July 6, 2025, 4:58 p.m. OK PyPy 3-64 TESTS 30 265 11366400
327840762 Vespasian_1 E July 6, 2025, 8:37 p.m. OK PyPy 3-64 TESTS 30 280 13209600
327837690 GeeTransit E July 6, 2025, 7:54 p.m. OK PyPy 3-64 TESTS 30 281 11059200
327818362 chayan381 E July 6, 2025, 5:09 p.m. OK Python 3 TESTS 30 139 13004800
327824502 Cannonbolt2704 E July 6, 2025, 5:31 p.m. OK Python 3 TESTS 30 171 10035200
327812933 Khushi_jain_222001 E July 6, 2025, 4:51 p.m. OK Python 3 TESTS 30 233 33382400
327824411 ParvatKhattak E July 6, 2025, 5:31 p.m. OK Python 3 TESTS 30 281 28569600
327817917 Jyoti. E July 6, 2025, 5:08 p.m. OK Python 3 TESTS 30 531 36147200
327809566 darkkcyan E July 6, 2025, 4:40 p.m. OK Rust 2021 TESTS 30 93 1126400
327821467 justkarsh E July 6, 2025, 5:21 p.m. OK Rust 2021 TESTS 30 108 1331200
327815281 hillhill E July 6, 2025, 4:58 p.m. OK Rust 2021 TESTS 30 124 6860800
327824732 NagisaF E July 6, 2025, 5:32 p.m. OK Rust 2021 TESTS 30 140 102400

remove filters

Back to search problems