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 145034699 April 13, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10895 ) E1 Three Blocks Palindrome (easy version) PROGRAMMING binary search brute force data structures dp two pointers 1700

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 <= 2000 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 2000 ) -- the length of a . The second line of the test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 26 ), where a_i is the i -th element of a . Note that the maximum value of a_i can be up to 26 . It is guaranteed that the sum of n over all test cases does not exceed 2000 ( sum n <= 2000 ). For each test case, print the answer -- the maximum possible length of some subsequence of a that is a t"...

Tutorials

75993

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
77609032 vjudge1 E1 April 22, 2020, 5:21 a.m. OK Clang++17 Diagnostics TESTS 39 46 33484800 1700
76773041 skysoon02 E1 April 15, 2020, 8:11 a.m. OK GNU C11 TESTS 39 31 0 1700
77263754 ananaygupta70 E1 April 19, 2020, 10:23 a.m. OK GNU C11 TESTS 39 140 204800 1700
77916418 serialcoder E1 April 24, 2020, 1:38 p.m. OK GNU C11 TESTS 39 140 512000 1700
77124620 Moonflower E1 April 17, 2020, 8:49 p.m. OK GNU C11 TESTS 39 1482 16076800 1700
77096011 SONGYJ9 E1 April 17, 2020, 3:49 p.m. OK GNU C++11 TESTS 39 30 307200 1700
76764077 rg_99 E1 April 15, 2020, 6:31 a.m. OK GNU C++11 TESTS 39 31 0 1700
76645614 searcher769 E1 April 14, 2020, 12:07 a.m. OK GNU C++11 TESTS 39 31 0 1700
77070154 Dinu_ E1 April 17, 2020, 11:58 a.m. OK GNU C++11 TESTS 39 31 0 1700
76774628 hellcat9 E1 April 15, 2020, 8:30 a.m. OK GNU C++11 TESTS 39 31 0 1700
77305327 knandy E1 April 19, 2020, 6:48 p.m. OK GNU C++11 TESTS 39 31 102400 1700
77864214 vjudge5 E1 April 24, 2020, 1:02 a.m. OK GNU C++11 TESTS 39 31 102400 1700
77967561 vjudge3 E1 April 25, 2020, 1:38 a.m. OK GNU C++11 TESTS 39 31 102400 1700
77475447 chenchichi222 E1 April 21, 2020, 2:07 p.m. OK GNU C++11 TESTS 39 31 102400 1700
77356899 Darth_vader_dark E1 April 20, 2020, noon OK GNU C++11 TESTS 39 31 102400 1700
76667261 Chakshu_Gupta E1 April 14, 2020, 8:14 a.m. OK GNU C++14 TESTS 39 15 512000 1700
76687605 meliodas873 E1 April 14, 2020, 11:53 a.m. OK GNU C++14 TESTS 39 30 0 1700
76643409 mamba7 E1 April 13, 2020, 10:55 p.m. OK GNU C++14 TESTS 39 30 204800 1700
76684530 S_Aditya E1 April 14, 2020, 11:25 a.m. OK GNU C++14 TESTS 39 30 204800 1700
76652336 Huangzzzzz E1 April 14, 2020, 3:07 a.m. OK GNU C++14 TESTS 39 30 204800 1700
77091575 vikarna E1 April 17, 2020, 3:12 p.m. OK GNU C++14 TESTS 39 30 409600 1700
77215579 Hridoy23 E1 April 18, 2020, 6:49 p.m. OK GNU C++14 TESTS 39 30 409600 1700
76784652 mohitm12 E1 April 15, 2020, 10:23 a.m. OK GNU C++14 TESTS 39 30 1843200 1700
77100093 Moufmahmalat E1 April 17, 2020, 4:25 p.m. OK GNU C++14 TESTS 39 30 2764800 1700
76700707 ujjwalmittal E1 April 14, 2020, 1:59 p.m. OK GNU C++14 TESTS 39 30 3481600 1700
77423787 igortakeo E1 April 21, 2020, 3:46 a.m. OK GNU C++17 TESTS 39 15 1843200 1700
76654106 AshwatthamA_2 E1 April 14, 2020, 3:40 a.m. OK GNU C++17 TESTS 39 30 204800 1700
76652183 Arnab_the_mallu_coder E1 April 14, 2020, 3:04 a.m. OK GNU C++17 TESTS 39 30 204800 1700
76748761 BUCT_18_ChengYijun E1 April 15, 2020, 1:23 a.m. OK GNU C++17 TESTS 39 30 204800 1700
77423803 registe E1 April 21, 2020, 3:47 a.m. OK GNU C++17 TESTS 39 30 204800 1700
77700722 montermoner E1 April 22, 2020, 11:28 p.m. OK GNU C++17 TESTS 39 30 204800 1700
77044910 un_block E1 April 17, 2020, 7:15 a.m. OK GNU C++17 TESTS 39 30 204800 1700
76752135 fenwick123 E1 April 15, 2020, 2:55 a.m. OK GNU C++17 TESTS 39 30 512000 1700
76980958 msporyshev E1 April 16, 2020, 2:18 p.m. OK GNU C++17 TESTS 39 30 614400 1700
76645863 Andros_ E1 April 14, 2020, 12:15 a.m. OK GNU C++17 TESTS 39 30 614400 1700
76761265 AndyR E1 April 15, 2020, 5:53 a.m. OK GNU C++17 (64) TESTS 39 30 102400 1700
76688977 ir_1st_vil E1 April 14, 2020, 12:07 p.m. OK GNU C++17 (64) TESTS 39 31 102400 1700
77044972 pseuda E1 April 17, 2020, 7:16 a.m. OK GNU C++17 (64) TESTS 39 31 102400 1700
76697939 hltk E1 April 14, 2020, 1:31 p.m. OK GNU C++17 (64) TESTS 39 31 307200 1700
76794992 AndyR E1 April 15, 2020, 12:46 p.m. OK GNU C++17 (64) TESTS 39 31 307200 1700
76762373 Bondo E1 April 15, 2020, 6:08 a.m. OK GNU C++17 (64) TESTS 39 31 409600 1700
77964897 Omar_medhat099 E1 April 25, 2020, 12:12 a.m. OK GNU C++17 (64) TESTS 39 31 614400 1700
77964914 vjudge3 E1 April 25, 2020, 12:12 a.m. OK GNU C++17 (64) TESTS 39 31 614400 1700
76797921 YESMAths E1 April 15, 2020, 1:20 p.m. OK GNU C++17 (64) TESTS 39 31 614400 1700
76779030 Shaitan_Machine E1 April 15, 2020, 9:15 a.m. OK GNU C++17 (64) TESTS 39 31 1638400 1700
77162174 amit_839 E1 April 18, 2020, 8:59 a.m. OK Go TESTS 39 217 102400 1700
77162416 amit_839 E1 April 18, 2020, 9:02 a.m. OK Go TESTS 39 249 102400 1700
76744392 rcpc-master E1 April 14, 2020, 11:03 p.m. OK Go TESTS 39 343 102400 1700
76667265 pohzipohzi E1 April 14, 2020, 8:14 a.m. OK Go TESTS 39 733 5324800 1700
76775069 kostasanemozalis E1 April 15, 2020, 8:35 a.m. OK Java 11 TESTS 39 187 0 1700
77042226 saurabh0611 E1 April 17, 2020, 6:42 a.m. OK Java 11 TESTS 39 202 0 1700
76978713 p_unit E1 April 16, 2020, 1:55 p.m. OK Java 11 TESTS 39 202 0 1700
76682224 saiyam_88 E1 April 14, 2020, 11:03 a.m. OK Java 11 TESTS 39 202 0 1700
76769092 abhi123valani E1 April 15, 2020, 7:28 a.m. OK Java 11 TESTS 39 202 18329600 1700
77125692 XsLel E1 April 17, 2020, 9:08 p.m. OK Java 11 TESTS 39 218 0 1700
76733920 Kimo_Fathy E1 April 14, 2020, 7:36 p.m. OK Java 11 TESTS 39 218 0 1700
76674848 saiyam_88 E1 April 14, 2020, 9:46 a.m. OK Java 11 TESTS 39 218 0 1700
77121663 Maurelius E1 April 17, 2020, 8:06 p.m. OK Java 11 TESTS 39 233 0 1700
77012369 ykabaran E1 April 16, 2020, 7:36 p.m. OK Java 11 TESTS 39 233 0 1700
77266620 sunnycarlos E1 April 19, 2020, 10:59 a.m. OK Java 8 TESTS 39 124 0 1700
77742847 alibaba E1 April 23, 2020, 11:03 a.m. OK Java 8 TESTS 39 124 0 1700
77284676 nw_cpp E1 April 19, 2020, 2:31 p.m. OK Java 8 TESTS 39 124 0 1700
77254207 sourav2999 E1 April 19, 2020, 8:18 a.m. OK Java 8 TESTS 39 124 0 1700
77181479 impotentfuture E1 April 18, 2020, 12:35 p.m. OK Java 8 TESTS 39 124 0 1700
76979895 mandark27 E1 April 16, 2020, 2:09 p.m. OK Java 8 TESTS 39 124 0 1700
76906918 bluesky111 E1 April 15, 2020, 8:58 p.m. OK Java 8 TESTS 39 124 0 1700
76805053 saptarshim E1 April 15, 2020, 2:23 p.m. OK Java 8 TESTS 39 124 0 1700
76745851 lzhang E1 April 14, 2020, 11:51 p.m. OK Java 8 TESTS 39 124 0 1700
76741784 neelbhallabos E1 April 14, 2020, 9:54 p.m. OK Java 8 TESTS 39 124 0 1700
76673250 Inspired E1 April 14, 2020, 9:30 a.m. OK JavaScript TESTS 39 46 1740800 1700
77619688 szzz- E1 April 22, 2020, 7:55 a.m. OK Mono C# TESTS 39 77 4300800 1700
76654384 camypaper E1 April 14, 2020, 3:45 a.m. OK Mono C# TESTS 39 77 168550400 1700
77607629 szzz- E1 April 22, 2020, 4:50 a.m. OK Mono C# TESTS 39 78 512000 1700
77624035 szzz- E1 April 22, 2020, 8:41 a.m. OK Mono C# TESTS 39 93 6860800 1700
77842901 Nirushuu E1 April 23, 2020, 4:50 p.m. OK Mono C# TESTS 39 358 716800 1700
77614970 szzz- E1 April 22, 2020, 7:04 a.m. OK Mono C# TESTS 39 436 6860800 1700
76743435 blackmart E1 April 14, 2020, 10:36 p.m. OK MS C++ TESTS 39 155 204800 1700
77061971 jdb0ss E1 April 17, 2020, 10:37 a.m. OK MS C++ 2017 TESTS 39 31 102400 1700
76941713 Still_Theory E1 April 16, 2020, 7:33 a.m. OK MS C++ 2017 TESTS 39 31 409600 1700
76769111 Mad112233 E1 April 15, 2020, 7:28 a.m. OK MS C++ 2017 TESTS 39 31 409600 1700
76685274 SPOON796 E1 April 14, 2020, 11:32 a.m. OK MS C++ 2017 TESTS 39 31 819200 1700
76649410 dundae E1 April 14, 2020, 1:55 a.m. OK MS C++ 2017 TESTS 39 31 1638400 1700
76934973 kernel.bin E1 April 16, 2020, 6:21 a.m. OK MS C++ 2017 TESTS 39 31 161894400 1700
77458653 batyousef E1 April 21, 2020, 11:11 a.m. OK MS C++ 2017 TESTS 39 46 2048000 1700
76695864 DeaL57 E1 April 14, 2020, 1:13 p.m. OK MS C++ 2017 TESTS 39 61 102400 1700
77458717 batyousef E1 April 21, 2020, 11:12 a.m. OK MS C++ 2017 TESTS 39 62 2048000 1700
76668363 DmitryZ E1 April 14, 2020, 8:30 a.m. OK MS C++ 2017 TESTS 39 62 3891200 1700
77967037 beethoven97 E1 April 25, 2020, 1:24 a.m. OK PyPy 2 TESTS 39 155 1740800 1700
76797773 YESMAths E1 April 15, 2020, 1:18 p.m. OK PyPy 2 TESTS 39 171 1945600 1700
76920573 wolffd E1 April 16, 2020, 2:32 a.m. OK PyPy 2 TESTS 39 171 2150400 1700
76673381 ram_bharose_jindgi_bitao E1 April 14, 2020, 9:31 a.m. OK PyPy 2 TESTS 39 171 2662400 1700
76797614 YESMAths E1 April 15, 2020, 1:17 p.m. OK PyPy 2 TESTS 39 171 2764800 1700
76755247 nikhilgogiakimakabhosda E1 April 15, 2020, 4:07 a.m. OK PyPy 2 TESTS 39 218 4403200 1700
76747648 randjyoti E1 April 15, 2020, 12:49 a.m. OK PyPy 2 TESTS 39 218 4403200 1700
76961289 _MIT E1 April 16, 2020, 11:05 a.m. OK PyPy 2 TESTS 39 233 2150400 1700
77312320 yumtam E1 April 19, 2020, 8:57 p.m. OK PyPy 2 TESTS 39 233 4812800 1700
76737159 lebron87 E1 April 14, 2020, 8:24 p.m. OK PyPy 2 TESTS 39 280 3788800 1700
76736913 Anuranjan_Pandey E1 April 14, 2020, 8:20 p.m. OK PyPy 3 TESTS 39 186 3891200 1700
77361417 wattaihei E1 April 20, 2020, 12:51 p.m. OK PyPy 3 TESTS 39 186 3993600 1700
76803152 marcus.aure E1 April 15, 2020, 2:07 p.m. OK PyPy 3 TESTS 39 202 4300800 1700
77178454 codershuvo E1 April 18, 2020, noon OK PyPy 3 TESTS 39 202 4710400 1700
76656315 pedastrian57 E1 April 14, 2020, 4:19 a.m. OK PyPy 3 TESTS 39 217 4608000 1700
76672275 Lamborgini E1 April 14, 2020, 9:21 a.m. OK PyPy 3 TESTS 39 217 5324800 1700
76772028 nikeshthapa255 E1 April 15, 2020, 8:01 a.m. OK PyPy 3 TESTS 39 218 3891200 1700
77766938 jha_saurav E1 April 23, 2020, 2:21 p.m. OK PyPy 3 TESTS 39 218 4198400 1700
76648598 Blue_Gene E1 April 14, 2020, 1:33 a.m. OK PyPy 3 TESTS 39 218 4505600 1700
76771792 kit.shiron E1 April 15, 2020, 7:58 a.m. OK PyPy 3 TESTS 39 218 5836800 1700
77155796 buddy_0 E1 April 18, 2020, 7:49 a.m. OK Python 3 TESTS 39 124 307200 1700
76685940 jallllebi E1 April 14, 2020, 11:38 a.m. OK Python 3 TESTS 39 139 614400 1700
77654544 LeierKing E1 April 22, 2020, 1:36 p.m. OK Python 3 TESTS 39 140 614400 1700
77761409 jha_saurav E1 April 23, 2020, 2 p.m. OK Python 3 TESTS 39 140 716800 1700
76805820 dn6049949 E1 April 15, 2020, 2:30 p.m. OK Python 3 TESTS 39 155 409600 1700
76764811 Sunlight_sp E1 April 15, 2020, 6:40 a.m. OK Python 3 TESTS 39 155 716800 1700
76754747 st945306 E1 April 15, 2020, 3:55 a.m. OK Python 3 TESTS 39 170 307200 1700
76689508 ghoshashis545 E1 April 14, 2020, 12:12 p.m. OK Python 3 TESTS 39 170 614400 1700
76677414 Mirali E1 April 14, 2020, 10:11 a.m. OK Python 3 TESTS 39 327 307200 1700
76689503 aaaaaaaaaa2230 E1 April 14, 2020, 12:12 p.m. OK Python 3 TESTS 39 327 2969600 1700
76653189 sansen E1 April 14, 2020, 3:23 a.m. OK Rust TESTS 39 46 307200 1700
77062604 the.shank E1 April 17, 2020, 10:43 a.m. OK Rust TESTS 39 46 1843200 1700
77039525 the.shank E1 April 17, 2020, 6:05 a.m. OK Rust TESTS 39 280 512000 1700
77039330 the.shank E1 April 17, 2020, 6:02 a.m. OK Rust TESTS 39 311 512000 1700
76685041 bufistov E1 April 14, 2020, 11:30 a.m. OK Scala TESTS 39 2261 307200 1700

remove filters

Back to search problems