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 |
---|---|---|---|---|---|---|
1223 | Technocup 2020 - Elimination Round 1 | FINISHED | False | 7200 | 166805663 | Oct. 6, 2019, 3:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2097 ) | F | Stack Exterminable Arrays | PROGRAMMING | data structures divide and conquer dp hashing | 2600 |
B"Let's look at the following process: initially you have an empty stack and an array s of the length l . You are trying to push array elements to the stack in the order s_1, s_2, s_3, ... s_{l} . Moreover, if the stack is empty or the element at the top of this stack is not equal to the current element, then you just push the current element to the top of the stack. Otherwise, you don't push the current element to the stack and, moreover, pop the top element of the stack. If after this process the stack remains empty, the array s is considered stack exterminable. There are samples of stack exterminable arrays: Let's consider the changing of stack more details if s = [5, 1, 2, 2, 1, 4, 4, 5] (the top of stack is highlighted). You are given an array a_1, a_2, ldots, a_n . You have to calculate the number of its subarrays which are stack exterminable. Note, that you have to answer q independent queries. The first line contains one integer q ( 1 <= q <= 3 cdot 10^5 ) -- the number of queries. The first line of each query contains one integer n ( 1 <= n <= 3 cdot 10^5 ) -- the length of array a . The second line of each query contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- the elements. It is guaranteed that the sum of all n over all queries does not exceed 3 cdot 10^5 . For each test case print one integer in single line -- the number of stack exterminable subarrays of the array a . In the first query there are four stack exterminable subarrays: a_{1 ldots 4} = [2, 1, 1, 2], a_{2 ldots 3} = [1, 1], a_{2 ldots 5} = [1, 1, 2, 2], a_{4 ldots 5} = [2, 2] . In the second query, only one subarray is exterminable subarray -- a_{3 ldots 4} . In the third query, there are eight stack exterminable subarrays: a_{1 ldots 8}, a_{2 ldots 5}, a_{2 ldots 7}, a_{2 ldots 9}, a_{3 ldots 4}, a_{6 ldots 7}, a_{6 ldots 9}, a_"... |
Сodeforces Round 591 (and Technocup 2020 — Elimination Round 1) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
62065604 | LJC00118 | F | Oct. 7, 2019, 3:06 p.m. | OK | GNU C++11 | TESTS | 20 | 93 | 20480000 | 2600 | |
62095496 | BeNoble | F | Oct. 8, 2019, 7:23 a.m. | OK | GNU C++11 | TESTS | 20 | 109 | 21811200 | 2600 | |
63723723 | _twilight | F | Oct. 29, 2019, 12:06 p.m. | OK | GNU C++11 | TESTS | 20 | 124 | 6041600 | 2600 | |
63079933 | x_faraway_x | F | Oct. 21, 2019, 2:48 p.m. | OK | GNU C++11 | TESTS | 20 | 124 | 9625600 | 2600 | |
64022945 | Dream-chasing_Juvenile | F | Nov. 1, 2019, 3:44 p.m. | OK | GNU C++11 | TESTS | 20 | 124 | 20480000 | 2600 | |
63724459 | Fubuki | F | Oct. 29, 2019, 12:18 p.m. | OK | GNU C++11 | TESTS | 20 | 124 | 20480000 | 2600 | |
62085410 | cy1999 | F | Oct. 8, 2019, 1:16 a.m. | OK | GNU C++11 | TESTS | 20 | 124 | 28160000 | 2600 | |
62049213 | kdh | F | Oct. 7, 2019, 8:55 a.m. | OK | GNU C++11 | TESTS | 20 | 140 | 19353600 | 2600 | |
62055434 | ruogu | F | Oct. 7, 2019, 11:54 a.m. | OK | GNU C++11 | TESTS | 20 | 140 | 20480000 | 2600 | |
62046884 | kdh | F | Oct. 7, 2019, 7:51 a.m. | OK | GNU C++11 | TESTS | 20 | 140 | 20480000 | 2600 | |
62033058 | liouzhou_101 | F | Oct. 7, 2019, 2:12 a.m. | OK | GNU C++14 | TESTS | 20 | 109 | 25292800 | 2600 | |
62032953 | liouzhou_101 | F | Oct. 7, 2019, 2:07 a.m. | OK | GNU C++14 | TESTS | 20 | 109 | 28876800 | 2600 | |
62552008 | NotNight | F | Oct. 14, 2019, 9:02 a.m. | OK | GNU C++14 | TESTS | 20 | 155 | 16998400 | 2600 | |
62322387 | Mint_Dentifrice | F | Oct. 10, 2019, 5:11 p.m. | OK | GNU C++14 | TESTS | 20 | 155 | 16998400 | 2600 | |
62964131 | daudbhai | F | Oct. 20, 2019, 3:20 a.m. | OK | GNU C++14 | TESTS | 20 | 155 | 20684800 | 2600 | |
62339650 | 2005 | F | Oct. 11, 2019, 4:08 a.m. | OK | GNU C++14 | TESTS | 20 | 156 | 28979200 | 2600 | |
63240186 | faculty | F | Oct. 23, 2019, 1:16 p.m. | OK | GNU C++14 | TESTS | 20 | 170 | 24268800 | 2600 | |
62059605 | HideoSatou | F | Oct. 7, 2019, 1:13 p.m. | OK | GNU C++14 | TESTS | 20 | 186 | 20684800 | 2600 | |
62562329 | doped.silicon | F | Oct. 14, 2019, 12:21 p.m. | OK | GNU C++14 | TESTS | 20 | 186 | 28467200 | 2600 | |
68723132 | thebes | F | Jan. 13, 2020, 4:58 p.m. | OK | GNU C++14 | TESTS | 20 | 187 | 20684800 | 2600 | |
62017823 | UnstoppableChillMachine | F | Oct. 6, 2019, 4:17 p.m. | OK | GNU C++17 | TESTS | 20 | 140 | 3891200 | 2600 | |
68979349 | ngfam | F | Jan. 17, 2020, 10:06 a.m. | OK | GNU C++17 | TESTS | 20 | 155 | 14540800 | 2600 | |
62217548 | y_men9_dva_po_fizike | F | Oct. 9, 2019, 4:26 p.m. | OK | GNU C++17 | TESTS | 20 | 155 | 21913600 | 2600 | |
62905034 | duckladydinh | F | Oct. 19, 2019, 5:33 a.m. | OK | GNU C++17 | TESTS | 20 | 156 | 20684800 | 2600 | |
65594786 | chikibambonator | F | Nov. 23, 2019, 3:27 p.m. | OK | GNU C++17 | TESTS | 20 | 171 | 15769600 | 2600 | |
64644446 | _overrated_ | F | Nov. 10, 2019, 2:25 p.m. | OK | GNU C++17 | TESTS | 20 | 171 | 16691200 | 2600 | |
62182573 | EmilConst | F | Oct. 9, 2019, 6:58 a.m. | OK | GNU C++17 | TESTS | 20 | 171 | 17100800 | 2600 | |
62028663 | Ari | F | Oct. 6, 2019, 9:53 p.m. | OK | GNU C++17 | TESTS | 20 | 186 | 16998400 | 2600 | |
62059424 | babin74 | F | Oct. 7, 2019, 1:09 p.m. | OK | GNU C++17 | TESTS | 20 | 187 | 18227200 | 2600 | |
64621022 | limabeans | F | Nov. 10, 2019, 6:52 a.m. | OK | GNU C++17 | TESTS | 20 | 187 | 21811200 | 2600 | |
62242471 | shaurya024 | F | Oct. 10, 2019, 2:30 a.m. | OK | Java 8 | TESTS | 20 | 685 | 74444800 | 2600 | |
63432506 | ElliLittleFox | F | Oct. 26, 2019, 9:33 a.m. | OK | MS C++ 2017 | TESTS | 20 | 1621 | 35020800 | 2600 |
Back to search problems