Codeforces Round 634 (Div. 3)

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
1335 Codeforces Round 634 (Div. 3) FINISHED False 7200 150564311 April 13, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8462 ) E2 Three Blocks Palindrome (hard version) PROGRAMMING brute force data structures dp two pointers 2000

B"The only difference between easy and hard versions is constraints. You are given a sequence a consisting of n positive integers. Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are a and b , a can be equal b ) and is as follows: [ underbrace{a, a, ... , a}_{x}, underbrace{b, b, ... , b}_{y}, underbrace{a, a, ... , a}_{x}] . There x, y are integers greater than or equal to 0 . For example, sequences [] , [2] , [1, 1] , [1, 2, 1] , [1, 2, 2, 1] and [1, 1, 2, 1, 1] are three block palindromes but [1, 2, 3, 2, 1] , [1, 2, 1, 2, 1] and [1, 2] are not. Your task is to choose the maximum by length subsequence of a that is a three blocks palindrome. You have to answer t independent test cases. Recall that the sequence t is a a subsequence of the sequence s if t can be derived from s by removing zero or more elements without changing the order of the remaining elements. For example, if s=[1, 2, 1, 3, 1, 2, 1] , then possible subsequences are: [1, 1, 1, 1] , [3] and [1, 2, 1, 3, 1, 2, 1] , but not [3, 2, 3] and [1, 1, 1, 1, 2] . The first line of the input contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of a . The second line of the test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 200 ), where a_i is the i -th element of a . Note that the maximum value of a_i can be up to 200 . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 ( sum n <= 2 cdot 10^5 ). For each test case, print the answer -- the maximum possible length of some subseque"...

Tutorials

75993

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
77608901 vjudge2 E2 April 22, 2020, 5:19 a.m. OK Clang++17 Diagnostics TESTS 58 1638 181964800 2000
76655008 ruban E2 April 14, 2020, 3:55 a.m. OK Delphi TESTS 54 920 196198400 2000
76747759 _b612_ E2 April 15, 2020, 12:53 a.m. OK GNU C++11 TESTS 58 78 3891200 2000
76724064 wang9897 E2 April 14, 2020, 5:45 p.m. OK GNU C++11 TESTS 58 78 14438400 2000
76675723 zzhzzh E2 April 14, 2020, 9:54 a.m. OK GNU C++11 TESTS 58 93 3584000 2000
77449543 yanying E2 April 21, 2020, 9:26 a.m. OK GNU C++11 TESTS 58 93 169164800 2000
76713402 Josephus E2 April 14, 2020, 3:55 p.m. OK GNU C++11 TESTS 58 108 3584000 2000
76656553 luogu_bot5 E2 April 14, 2020, 4:23 a.m. OK GNU C++11 TESTS 54 108 166912000 2000
76654345 _lph E2 April 14, 2020, 3:44 a.m. OK GNU C++11 TESTS 54 124 167833600 2000
77378064 EncodeTalker E2 April 20, 2020, 3:23 p.m. OK GNU C++11 TESTS 58 139 172748800 2000
76758101 sonhv3112 E2 April 15, 2020, 5:02 a.m. OK GNU C++11 TESTS 58 140 7475200 2000
76794323 sonhv3112 E2 April 15, 2020, 12:35 p.m. OK GNU C++11 TESTS 58 140 12492800 2000
77030885 _FlyingColor_ E2 April 17, 2020, 3:17 a.m. OK GNU C++14 TESTS 58 93 3686400 2000
76709614 MoMo E2 April 14, 2020, 3:20 p.m. OK GNU C++14 TESTS 58 93 6144000 2000
76784574 AC_Crush E2 April 15, 2020, 10:22 a.m. OK GNU C++14 TESTS 58 108 3686400 2000
76918046 Luzivanlt E2 April 16, 2020, 1:32 a.m. OK GNU C++14 TESTS 58 109 819200 2000
76677208 Basharo E2 April 14, 2020, 10:10 a.m. OK GNU C++14 TESTS 58 109 3686400 2000
77140429 vjudge2 E2 April 18, 2020, 4:17 a.m. OK GNU C++14 TESTS 58 109 3686400 2000
76652404 Huangzzzzz E2 April 14, 2020, 3:08 a.m. OK GNU C++14 TESTS 54 124 3686400 2000
76948392 swapnil07 E2 April 16, 2020, 8:47 a.m. OK GNU C++14 TESTS 58 155 6758400 2000
77445484 Yash_Jain E2 April 21, 2020, 8:32 a.m. OK GNU C++14 TESTS 58 155 164761600 2000
76693312 Vishwa_02 E2 April 14, 2020, 12:48 p.m. OK GNU C++14 TESTS 58 155 164864000 2000
77255776 LayCurse E2 April 19, 2020, 8:39 a.m. OK GNU C++17 TESTS 58 77 2969600 2000
76703208 Cpp_Rookie E2 April 14, 2020, 2:20 p.m. OK GNU C++17 TESTS 58 93 3686400 2000
76648560 xuyifeng E2 April 14, 2020, 1:32 a.m. OK GNU C++17 TESTS 54 93 3686400 2000
76668633 Jetiaime E2 April 14, 2020, 8:34 a.m. OK GNU C++17 TESTS 54 93 3686400 2000
76939516 ADJA E2 April 16, 2020, 7:10 a.m. OK GNU C++17 TESTS 58 108 3686400 2000
76694040 txuw E2 April 14, 2020, 12:55 p.m. OK GNU C++17 TESTS 58 108 3686400 2000
76658431 lakergo E2 April 14, 2020, 4:59 a.m. OK GNU C++17 TESTS 54 108 3686400 2000
76698296 jintiandun E2 April 14, 2020, 1:34 p.m. OK GNU C++17 TESTS 58 108 165171200 2000
76714158 FAIRYTAIL E2 April 14, 2020, 4:03 p.m. OK GNU C++17 TESTS 58 109 819200 2000
76682913 rrezahatam E2 April 14, 2020, 11:09 a.m. OK GNU C++17 TESTS 58 109 819200 2000
76668614 sharmajatin741 E2 April 14, 2020, 8:34 a.m. OK GNU C++17 (64) TESTS 54 93 6963200 2000
76669167 Bassel E2 April 14, 2020, 8:42 a.m. OK GNU C++17 (64) TESTS 54 109 2457600 2000
76739644 OsmanliTokadi E2 April 14, 2020, 9:09 p.m. OK GNU C++17 (64) TESTS 58 156 5939200 2000
76773648 uruuru8888 E2 April 15, 2020, 8:18 a.m. OK GNU C++17 (64) TESTS 58 156 165478400 2000
77068331 nico123 E2 April 17, 2020, 11:40 a.m. OK GNU C++17 (64) TESTS 58 171 164659200 2000
76760127 thtsshz_bgwrswh E2 April 15, 2020, 5:36 a.m. OK GNU C++17 (64) TESTS 58 171 167936000 2000
77271822 tianrensy E2 April 19, 2020, 12:02 p.m. OK GNU C++17 (64) TESTS 58 171 171929600 2000
76696341 hltk E2 April 14, 2020, 1:17 p.m. OK GNU C++17 (64) TESTS 58 186 163942400 2000
76686237 conan1024hao E2 April 14, 2020, 11:41 a.m. OK GNU C++17 (64) TESTS 58 186 169164800 2000
76779066 Shaitan_Machine E2 April 15, 2020, 9:15 a.m. OK GNU C++17 (64) TESTS 58 187 164352000 2000
77177877 amit_839 E2 April 18, 2020, 11:54 a.m. OK Go TESTS 58 748 175718400 2000
76651174 avijit_agarwal E2 April 14, 2020, 2:41 a.m. OK Java 11 TESTS 54 546 259891200 2000
77155871 nithin_bharathi E2 April 18, 2020, 7:50 a.m. OK Java 11 TESTS 58 561 259891200 2000
76692550 14visheshjain E2 April 14, 2020, 12:39 p.m. OK Java 11 TESTS 58 576 260096000 2000
76979021 p_unit E2 April 16, 2020, 1:59 p.m. OK Java 11 TESTS 58 639 259891200 2000
77018923 Ahmed_Hosssam E2 April 16, 2020, 9:20 p.m. OK Java 11 TESTS 58 639 259891200 2000
76779419 kostasanemozalis E2 April 15, 2020, 9:19 a.m. OK Java 11 TESTS 58 655 259891200 2000
76775881 abhi123valani E2 April 15, 2020, 8:43 a.m. OK Java 11 TESTS 58 655 259993600 2000
77012158 ykabaran E2 April 16, 2020, 7:33 p.m. OK Java 11 TESTS 58 670 261427200 2000
76778700 pankajpoply45 E2 April 15, 2020, 9:11 a.m. OK Java 11 TESTS 58 685 260096000 2000
77010477 mikkk E2 April 16, 2020, 7:12 p.m. OK Java 11 TESTS 58 795 239718400 2000
76920577 Jonathan1234 E2 April 16, 2020, 2:32 a.m. OK Java 8 TESTS 58 483 258764800 2000
76700387 pixel7367 E2 April 14, 2020, 1:54 p.m. OK Java 8 TESTS 58 499 258867200 2000
76801798 tahasin E2 April 15, 2020, 1:54 p.m. OK Java 8 TESTS 58 499 259072000 2000
77162254 ravan E2 April 18, 2020, 9 a.m. OK Java 8 TESTS 58 577 258867200 2000
76752725 lzhang E2 April 15, 2020, 3:10 a.m. OK Java 8 TESTS 58 577 258867200 2000
76748897 lzhang E2 April 15, 2020, 1:27 a.m. OK Java 8 TESTS 58 592 258764800 2000
76731812 sgt E2 April 14, 2020, 7:10 p.m. OK Java 8 TESTS 58 592 259072000 2000
76676684 tsumit023 E2 April 14, 2020, 10:05 a.m. OK Java 8 TESTS 58 592 259072000 2000
77209568 dyhu083 E2 April 18, 2020, 5:35 p.m. OK Java 8 TESTS 58 607 258662400 2000
77072637 pulkit14 E2 April 17, 2020, 12:23 p.m. OK Java 8 TESTS 58 623 259174400 2000
76673345 Inspired E2 April 14, 2020, 9:31 a.m. OK JavaScript TESTS 55 1279 27545600 2000
77008826 tvvister E2 April 16, 2020, 6:51 p.m. OK Mono C# TESTS 58 530 191692800 2000
76654392 camypaper E2 April 14, 2020, 3:45 a.m. OK Mono C# TESTS 54 811 171110400 2000
76771606 mban259 E2 April 15, 2020, 7:56 a.m. OK Mono C# TESTS 58 1138 177254400 2000
77626046 szzz- E2 April 22, 2020, 9:04 a.m. OK Mono C# TESTS 58 1201 174489600 2000
77031819 blackmart E2 April 17, 2020, 3:39 a.m. OK MS C++ TESTS 58 920 163430400 2000
76685311 SPOON796 E2 April 14, 2020, 11:32 a.m. OK MS C++ 2017 TESTS 58 187 819200 2000
76677319 zhabuye E2 April 14, 2020, 10:11 a.m. OK MS C++ 2017 TESTS 58 311 167731200 2000
76682326 2018030402032 E2 April 14, 2020, 11:04 a.m. OK MS C++ 2017 TESTS 58 327 164454400 2000
77101091 pikachan14 E2 April 17, 2020, 4:35 p.m. OK MS C++ 2017 TESTS 58 343 174796800 2000
77205054 ASIXER E2 April 18, 2020, 4:36 p.m. OK MS C++ 2017 TESTS 58 529 163635200 2000
76750659 hwqconceptnick E2 April 15, 2020, 2:19 a.m. OK MS C++ 2017 TESTS 58 529 178892800 2000
76727406 GK_Ebbaka E2 April 14, 2020, 6:19 p.m. OK MS C++ 2017 TESTS 58 577 2560000 2000
76649501 dundae E2 April 14, 2020, 1:57 a.m. OK MS C++ 2017 TESTS 54 608 165273600 2000
76935012 kernel.bin E2 April 16, 2020, 6:21 a.m. OK MS C++ 2017 TESTS 58 732 161894400 2000
76762740 naitsabes.ezluhcs E2 April 15, 2020, 6:13 a.m. OK MS C++ 2017 TESTS 58 733 166809600 2000
76673357 ram_bharose_jindgi_bitao E2 April 14, 2020, 9:31 a.m. OK PyPy 2 TESTS 55 467 188518400 2000
76746377 lebron87 E2 April 15, 2020, 12:09 a.m. OK PyPy 2 TESTS 58 623 185139200 2000
77312291 yumtam E2 April 19, 2020, 8:57 p.m. OK PyPy 2 TESTS 58 1279 183500800 2000
77967090 beethoven97 E2 April 25, 2020, 1:25 a.m. OK PyPy 2 TESTS 58 1341 172339200 2000
76965922 _MIT E2 April 16, 2020, 11:51 a.m. OK PyPy 2 TESTS 58 1590 185753600 2000
76966419 _MIT E2 April 16, 2020, 11:56 a.m. OK PyPy 2 TESTS 58 1824 185753600 2000
76755428 nikhilkimakichut E2 April 15, 2020, 4:10 a.m. OK PyPy 2 TESTS 58 1933 172748800 2000
77762063 jha_saurav E2 April 23, 2020, 2:07 p.m. OK PyPy 3 TESTS 58 561 186675200 2000
76694025 aaaaaaaaaa2230 E2 April 14, 2020, 12:55 p.m. OK PyPy 3 TESTS 58 561 189132800 2000
77713989 shanu_im E2 April 23, 2020, 5:17 a.m. OK PyPy 3 TESTS 58 592 187699200 2000
76651800 RaDaDiYaMoHiT E2 April 14, 2020, 2:55 a.m. OK PyPy 3 TESTS 54 639 184832000 2000
77767022 jha_saurav E2 April 23, 2020, 2:22 p.m. OK PyPy 3 TESTS 58 733 188416000 2000
76946821 cjc7373 E2 April 16, 2020, 8:29 a.m. OK PyPy 3 TESTS 58 779 185036800 2000
76717488 siyy E2 April 14, 2020, 4:34 p.m. OK PyPy 3 TESTS 58 795 184115200 2000
77013521 omarnvidia E2 April 16, 2020, 7:52 p.m. OK PyPy 3 TESTS 58 810 202547200 2000
76736888 Anuranjan_Pandey E2 April 14, 2020, 8:19 p.m. OK PyPy 3 TESTS 58 826 184012800 2000
77015796 omarnvidia E2 April 16, 2020, 8:27 p.m. OK PyPy 3 TESTS 58 857 199372800 2000
76653181 sansen E2 April 14, 2020, 3:23 a.m. OK Rust TESTS 54 514 3379200 2000
77062491 the.shank E2 April 17, 2020, 10:42 a.m. OK Rust TESTS 58 717 169984000 2000

remove filters

Back to search problems