Technocup 2022 - Elimination Round 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
1584 Technocup 2022 - Elimination Round 2 FINISHED False 8100 100396463 Nov. 14, 2021, 6:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1317 ) E Game with Stones PROGRAMMING binary search data structures games greedy 2300

B"Bob decided to take a break from calculus homework and designed a game for himself. The game is played on a sequence of piles of stones, which can be described with a sequence of integers s_1, ldots, s_k , where s_i is the number of stones in the i -th pile. On each turn, Bob picks a pair of non-empty adjacent piles i and i+1 and takes one stone from each. If a pile becomes empty, its adjacent piles do not become adjacent. The game ends when Bob can't make turns anymore. Bob considers himself a winner if at the end all piles are empty. We consider a sequence of piles winning if Bob can start with it and win with some sequence of moves. You are given a sequence a_1, ldots, a_n , count the number of subsegments of a that describe a winning sequence of piles. In other words find the number of segments [l, r] ( 1 <= q l <= q r <= q n ), such that the sequence a_l, a_{l+1}, ldots, a_r is winning. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 3 cdot 10^5 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 3 cdot 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 3 cdot 10^5 . Print a single integer for each test case -- the answer to the problem. In the first test case, Bob can't win on subsegments of length 1 , as there is no pair of adjacent piles in an array of length 1 . In the second test case, every subsegment is not winning. In the fourth test case, the subsegment [1, 4] is winning, because Bob can make moves with pairs of adjacent piles: (2, 3) , (1, 2) , (3, 4) . Another winning subsegment is [2, 3] . "...

Tutorials

Editorial for Technocup 2022 — Elimination Round 2 and Codeforces Round #755 (Div. 1, Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
135491869 FANAT_MORGENSHTERNA E Nov. 14, 2021, 3:20 p.m. OK GNU C++14 TESTS 39 186 14643200 2300
135382804 expwmh E Nov. 14, 2021, 7:44 a.m. OK GNU C++14 TESTS 36 280 65024000 2300
135411858 xiahongyu01 E Nov. 14, 2021, 11:16 a.m. OK GNU C++14 TESTS 37 358 21708800 2300
135410954 xiahongyu01 E Nov. 14, 2021, 11:08 a.m. OK GNU C++14 TESTS 37 358 21708800 2300
135532296 Alex_Wei E Nov. 15, 2021, 1:44 a.m. OK GNU C++14 TESTS 40 1544 31129600 2300
135532346 Alex_Wei E Nov. 15, 2021, 1:45 a.m. OK GNU C++14 TESTS 40 1575 12288000 2300
135370222 Kapt E Nov. 14, 2021, 7:03 a.m. OK GNU C++17 TESTS 36 296 135782400 2300
135387995 Grigori E Nov. 14, 2021, 8:03 a.m. OK GNU C++17 TESTS 36 561 61235200 2300
135382677 cat998__ E Nov. 14, 2021, 7:44 a.m. OK GNU C++17 TESTS 36 904 2662400 2300
135501144 Dart-Xeyter E Nov. 14, 2021, 5:03 p.m. OK GNU C++17 TESTS 39 1044 13721600 2300
135511606 Rip_robot E Nov. 14, 2021, 7:34 p.m. OK GNU C++17 TESTS 40 1325 178892800 2300
135376136 LevinaMO E Nov. 14, 2021, 7:21 a.m. OK GNU C++17 TESTS 36 1418 12083200 2300
135395791 Agnimandur E Nov. 14, 2021, 8:58 a.m. OK GNU C++17 TESTS 36 1419 227225600 2300
135389725 ilaburkov E Nov. 14, 2021, 8:10 a.m. OK GNU C++17 TESTS 36 1559 216678400 2300
135398617 pooty E Nov. 14, 2021, 9:18 a.m. OK GNU C++17 TESTS 37 1996 155340800 2300
135391167 macneil E Nov. 14, 2021, 8:14 a.m. OK GNU C++17 (64) TESTS 36 140 3584000 2300
135532103 devinqu E Nov. 15, 2021, 1:37 a.m. OK GNU C++17 (64) TESTS 40 249 21708800 2300
135381615 stepanov.aa E Nov. 14, 2021, 7:40 a.m. OK GNU C++17 (64) TESTS 36 264 25497600 2300
135387643 imachug E Nov. 14, 2021, 8:02 a.m. OK GNU C++17 (64) TESTS 36 327 6041600 2300
135395928 artem_safin67 E Nov. 14, 2021, 8:59 a.m. OK GNU C++17 (64) TESTS 36 358 61337600 2300
135386030 alegsandyr E Nov. 14, 2021, 7:56 a.m. OK GNU C++17 (64) TESTS 36 374 45977600 2300
135424904 ducati E Nov. 14, 2021, 1:16 p.m. OK GNU C++17 (64) TESTS 37 421 105984000 2300
135390139 crazyilian E Nov. 14, 2021, 8:11 a.m. OK GNU C++17 (64) TESTS 36 545 77721600 2300
135370116 Kirill22 E Nov. 14, 2021, 7:03 a.m. OK GNU C++17 (64) TESTS 36 545 217702400 2300
135387257 Vladithur E Nov. 14, 2021, 8:01 a.m. OK GNU C++17 (64) TESTS 36 748 127692800 2300
135399726 igorfardoc E Nov. 14, 2021, 9:27 a.m. OK GNU C++20 (64) TESTS 37 234 36249600 2300
135418267 deutlay E Nov. 14, 2021, 12:17 p.m. OK GNU C++20 (64) TESTS 37 295 39936000 2300
135432689 deutlay E Nov. 14, 2021, 1:44 p.m. OK GNU C++20 (64) TESTS 37 327 38707200 2300
135374726 Artyom123 E Nov. 14, 2021, 7:17 a.m. OK GNU C++20 (64) TESTS 36 607 216780800 2300
135383486 Qwerty1232 E Nov. 14, 2021, 7:47 a.m. OK GNU C++20 (64) TESTS 36 639 54886400 2300
135380747 devid E Nov. 14, 2021, 7:37 a.m. OK GNU C++20 (64) TESTS 36 654 67891200 2300
135516705 definitelynotmee E Nov. 14, 2021, 9:21 p.m. OK GNU C++20 (64) TESTS 40 670 158412800 2300
135389292 FairyWinx E Nov. 14, 2021, 8:08 a.m. OK GNU C++20 (64) TESTS 36 686 251187200 2300
135390869 Kotehok3 E Nov. 14, 2021, 8:13 a.m. OK GNU C++20 (64) TESTS 36 748 133427200 2300
135378141 sevlll E Nov. 14, 2021, 7:27 a.m. OK GNU C++20 (64) TESTS 36 841 87552000 2300

remove filters

Back to search problems