Codeforces Round 686 (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
1454 Codeforces Round 686 (Div. 3) FINISHED False 7200 125594699 Nov. 24, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21548 ) C Sequence Transformation PROGRAMMING greedy implementation

B'You are given a sequence a , initially consisting of n integers. You want to transform this sequence so that all elements in it are equal (i. e. it contains several occurrences of the same element). To achieve this, you choose some integer x that occurs at least once in a , and then perform the following operation any number of times (possibly zero): choose some segment [l, r] of the sequence and remove it. But there is one exception: you are not allowed to choose a segment that contains x . More formally, you choose some contiguous subsequence [a_l, a_{l + 1}, ... , a_r] such that a_i ne x if l <= i <= r , and remove it. After removal, the numbering of elements to the right of the removed segment changes: the element that was the (r+1) -th is now l -th, the element that was (r+2) -th is now (l+1) -th, and so on (i. e. the remaining sequence just collapses). Note that you can not change x after you chose it. For example, suppose n = 6 , a = [1, 3, 2, 4, 1, 2] . Then one of the ways to transform it in two operations is to choose x = 1 , then: Note that choosing x is not an operation. Also, note that you can not remove any occurrence of x . Your task is to find the minimum number of operations required to transform the sequence in a way described above. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 2 cdot 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 number of elements in a . The second line of the test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ), where a_i is the i -th element of a . It is guaranteed that the sum of n does not exceed 2 cdot 10^5 ( sum n <= 2 cdot 10^5 ).'...

Tutorials

Codeforces Round #686 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
99606039 mshiny_111 C Nov. 26, 2020, 4:03 a.m. OK GNU C11 TESTS 9 93 1536000
99517113 HuangJinYu C Nov. 25, 2020, 2:47 a.m. OK GNU C11 TESTS 9 93 1638400
99556253 ke_123 C Nov. 25, 2020, 12:05 p.m. OK GNU C11 TESTS 9 108 1638400
99515330 shakline_hossen C Nov. 25, 2020, 1:54 a.m. OK GNU C11 TESTS 9 109 1638400
99543536 Madeeyuth C Nov. 25, 2020, 9:30 a.m. OK GNU C++11 TESTS 9 30 1433600
99522289 MengWH C Nov. 25, 2020, 4:41 a.m. OK GNU C++11 TESTS 9 30 1638400
99516752 maskey C Nov. 25, 2020, 2:38 a.m. OK GNU C++11 TESTS 9 31 1638400
99537181 OI1314 C Nov. 25, 2020, 8:14 a.m. OK GNU C++11 TESTS 9 31 1638400
99537284 OI1314 C Nov. 25, 2020, 8:15 a.m. OK GNU C++11 TESTS 9 31 1638400
99601412 DWAE86 C Nov. 26, 2020, 1:30 a.m. OK GNU C++11 TESTS 9 31 2457600
99534459 Sakura-hero C Nov. 25, 2020, 7:39 a.m. OK GNU C++11 TESTS 9 31 16281600
99547956 _ShadowSong C Nov. 25, 2020, 10:26 a.m. OK GNU C++11 TESTS 9 46 1638400
99515166 Ufowoqqqo C Nov. 25, 2020, 1:49 a.m. OK GNU C++11 TESTS 9 46 1638400
99558808 Dreamfarer C Nov. 25, 2020, 12:32 p.m. OK GNU C++11 TESTS 9 46 1843200
99532526 sandeep415 C Nov. 25, 2020, 7:17 a.m. OK GNU C++14 TESTS 9 46 1638400
99528297 the_3rd_eye C Nov. 25, 2020, 6:27 a.m. OK GNU C++14 TESTS 9 46 1638400
99604633 Minh2409 C Nov. 26, 2020, 3:22 a.m. OK GNU C++14 TESTS 9 46 1638400
99562664 Debasish1610177113 C Nov. 25, 2020, 1:15 p.m. OK GNU C++14 TESTS 9 46 1638400
99551927 H7GhosT C Nov. 25, 2020, 11:14 a.m. OK GNU C++14 TESTS 9 46 1638400
99534143 iaish C Nov. 25, 2020, 7:35 a.m. OK GNU C++14 TESTS 9 46 1638400
99587502 Jamil_m_Faris C Nov. 25, 2020, 6:04 p.m. OK GNU C++14 TESTS 9 46 1843200
99512036 Temirulan C Nov. 24, 2020, 11:31 p.m. OK GNU C++14 TESTS 9 46 2457600
99515830 C14551C C Nov. 25, 2020, 2:12 a.m. OK GNU C++14 TESTS 9 46 2662400
99590733 paras199 C Nov. 25, 2020, 6:59 p.m. OK GNU C++14 TESTS 9 46 5324800
99558912 aniketsureshsasane C Nov. 25, 2020, 12:33 p.m. OK GNU C++17 TESTS 9 46 1638400
99509977 ernestlu C Nov. 24, 2020, 9:49 p.m. OK GNU C++17 TESTS 9 46 1638400
99517256 terrcota C Nov. 25, 2020, 2:50 a.m. OK GNU C++17 TESTS 9 46 1638400
99528838 suveen C Nov. 25, 2020, 6:34 a.m. OK GNU C++17 TESTS 9 46 1638400
99509156 uk_is_gay C Nov. 24, 2020, 9:19 p.m. OK GNU C++17 TESTS 9 46 2457600
99574078 Liviu2000 C Nov. 25, 2020, 3:19 p.m. OK GNU C++17 TESTS 9 46 2457600
99556320 haogee C Nov. 25, 2020, 12:06 p.m. OK GNU C++17 TESTS 9 46 2457600
99510458 uk_is_gay C Nov. 24, 2020, 10:10 p.m. OK GNU C++17 TESTS 9 46 2457600
99533347 aaradhya0707 C Nov. 25, 2020, 7:26 a.m. OK GNU C++17 TESTS 9 46 2662400
99572129 anshm C Nov. 25, 2020, 3:01 p.m. OK GNU C++17 TESTS 9 46 2662400
99609651 LethalPuppy C Nov. 26, 2020, 5:35 a.m. OK GNU C++17 (64) TESTS 9 46 1638400
99520728 RandomNumber C Nov. 25, 2020, 4:10 a.m. OK GNU C++17 (64) TESTS 9 46 1638400
99596970 Kregor C Nov. 25, 2020, 9:44 p.m. OK GNU C++17 (64) TESTS 9 46 1843200
99549828 Raafat_alaa C Nov. 25, 2020, 10:49 a.m. OK GNU C++17 (64) TESTS 9 46 1843200
99520823 RandomNumber C Nov. 25, 2020, 4:12 a.m. OK GNU C++17 (64) TESTS 9 46 1843200
99571849 Arif19 C Nov. 25, 2020, 2:59 p.m. OK GNU C++17 (64) TESTS 9 46 2457600
99509520 uk_is_gay C Nov. 24, 2020, 9:32 p.m. OK GNU C++17 (64) TESTS 9 46 2969600
99509667 uk_is_gay C Nov. 24, 2020, 9:37 p.m. OK GNU C++17 (64) TESTS 9 46 2969600
99509487 uk_is_gay C Nov. 24, 2020, 9:31 p.m. OK GNU C++17 (64) TESTS 9 46 2969600
99510063 uk_is_gay C Nov. 24, 2020, 9:53 p.m. OK GNU C++17 (64) TESTS 9 46 2969600
99547756 brijeshujcbm C Nov. 25, 2020, 10:22 a.m. OK Java 11 TESTS 9 217 5017600
99540501 kunalkatiyar9 C Nov. 25, 2020, 8:55 a.m. OK Java 11 TESTS 9 217 9728000
99509530 kostasanemozalis C Nov. 24, 2020, 9:32 p.m. OK Java 11 TESTS 9 218 4403200
99521455 aschugunov C Nov. 25, 2020, 4:24 a.m. OK Java 11 TESTS 9 218 4812800
99528876 devinguo C Nov. 25, 2020, 6:34 a.m. OK Java 11 TESTS 9 218 11468800
99608482 bishal141119 C Nov. 26, 2020, 5:11 a.m. OK Java 11 TESTS 9 233 12800000
99509067 mphillotry C Nov. 24, 2020, 9:17 p.m. OK Java 11 TESTS 9 248 7475200
99558826 bckslsh03 C Nov. 25, 2020, 12:32 p.m. OK Java 11 TESTS 9 264 0
99556113 Debojit219 C Nov. 25, 2020, 12:03 p.m. OK Java 11 TESTS 9 264 3686400
99584883 wifiiii C Nov. 25, 2020, 5:24 p.m. OK Java 11 TESTS 9 280 0
99554986 jakejase2 C Nov. 25, 2020, 11:49 a.m. OK Java 8 TESTS 9 109 0
99518163 kirubankamaraj C Nov. 25, 2020, 3:12 a.m. OK Java 8 TESTS 9 109 0
99527548 indsaiyan C Nov. 25, 2020, 6:19 a.m. OK Java 8 TESTS 9 124 1843200
99522724 Pranay2516 C Nov. 25, 2020, 4:50 a.m. OK Java 8 TESTS 9 124 2048000
99546560 jomanjo80 C Nov. 25, 2020, 10:07 a.m. OK Java 8 TESTS 9 139 2764800
99512114 RichardBot7000 C Nov. 24, 2020, 11:34 p.m. OK Java 8 TESTS 9 139 2969600
99596713 csullivan203 C Nov. 25, 2020, 9:35 p.m. OK Java 8 TESTS 9 140 0
99534542 godxpunk C Nov. 25, 2020, 7:40 a.m. OK Java 8 TESTS 9 140 1843200
99527762 O-infinity C Nov. 25, 2020, 6:21 a.m. OK Java 8 TESTS 9 140 1945600
99517642 robinz62 C Nov. 25, 2020, 3 a.m. OK Java 8 TESTS 9 155 2048000
99541231 Spheniscine C Nov. 25, 2020, 9:03 a.m. OK Kotlin TESTS 9 155 1126400
99562307 sid9406 C Nov. 25, 2020, 1:11 p.m. OK Kotlin TESTS 9 155 4710400
99515577 tscha C Nov. 25, 2020, 2:02 a.m. OK Kotlin TESTS 9 248 15769600
99536501 a1000 C Nov. 25, 2020, 8:05 a.m. OK Kotlin TESTS 9 326 15769600
99534100 Zordid C Nov. 25, 2020, 7:35 a.m. OK Kotlin TESTS 9 327 16691200
99548100 SlavaG C Nov. 25, 2020, 10:27 a.m. OK Kotlin TESTS 9 358 28569600
99588915 dopefresh C Nov. 25, 2020, 6:27 p.m. OK Kotlin TESTS 9 420 0
99554587 air_2 C Nov. 25, 2020, 11:45 a.m. OK MS C++ TESTS 9 109 3993600
99541018 SKeL C Nov. 25, 2020, 9:01 a.m. OK MS C++ 2017 TESTS 9 62 1638400
99600744 0319 C Nov. 26, 2020, 1 a.m. OK MS C++ 2017 TESTS 9 124 819200
99533228 Accumulate_gradually C Nov. 25, 2020, 7:25 a.m. OK MS C++ 2017 TESTS 9 139 5017600
99593818 PrideBlack C Nov. 25, 2020, 8:04 p.m. OK MS C++ 2017 TESTS 9 140 3379200
99558182 nohramnt C Nov. 25, 2020, 12:25 p.m. OK MS C++ 2017 TESTS 9 187 3174400
99558295 BrClaud C Nov. 25, 2020, 12:26 p.m. OK MS C++ 2017 TESTS 9 202 1638400
99513330 yugeeklab C Nov. 25, 2020, 12:34 a.m. OK MS C++ 2017 TESTS 9 202 4812800
99527675 Pratham_Kumar C Nov. 25, 2020, 6:20 a.m. OK MS C++ 2017 TESTS 9 218 4710400
99544320 TianZai C Nov. 25, 2020, 9:39 a.m. OK MS C++ 2017 TESTS 9 218 4915200
99535762 Alenochka C Nov. 25, 2020, 7:55 a.m. OK MS C++ 2017 TESTS 9 218 5427200
99581792 tutai C Nov. 25, 2020, 4:40 p.m. OK Node.js TESTS 9 280 14643200
99560107 SlowDecay C Nov. 25, 2020, 12:45 p.m. OK Node.js TESTS 9 311 16076800
99592929 Stephan C Nov. 25, 2020, 7:46 p.m. OK PyPy 3 TESTS 9 264 19251200
99512655 akantuni C Nov. 25, 2020, 12:03 a.m. OK PyPy 3 TESTS 9 280 19968000
99509004 strivetodeath C Nov. 24, 2020, 9:15 p.m. OK PyPy 3 TESTS 9 280 20275200
99520445 Anuranjan_Pandey C Nov. 25, 2020, 4:05 a.m. OK PyPy 3 TESTS 9 280 20377600
99558659 TheVan C Nov. 25, 2020, 12:30 p.m. OK PyPy 3 TESTS 9 295 18534400
99517707 stars_in_the_sky C Nov. 25, 2020, 3:01 a.m. OK PyPy 3 TESTS 9 296 19046400
99509050 strivetodeath C Nov. 24, 2020, 9:16 p.m. OK PyPy 3 TESTS 9 311 20275200
99585561 InvalidSyntax C Nov. 25, 2020, 5:35 p.m. OK PyPy 3 TESTS 9 311 21299200
99563448 Evil__Coder C Nov. 25, 2020, 1:25 p.m. OK PyPy 3 TESTS 9 327 20582400
99572291 codecunt7 C Nov. 25, 2020, 3:03 p.m. OK PyPy 3 TESTS 9 327 21401600
99569160 subhajitdas C Nov. 25, 2020, 2:34 p.m. OK Python 3 TESTS 9 296 14848000
99521144 e6ipxcosu C Nov. 25, 2020, 4:18 a.m. OK Python 3 TESTS 9 327 13516800
99610489 AdarshSrivastav C Nov. 26, 2020, 5:51 a.m. OK Python 3 TESTS 9 373 14643200
99515205 YvesYoshio C Nov. 25, 2020, 1:50 a.m. OK Python 3 TESTS 9 389 13824000
99511260 hazemhazozomanwa C Nov. 24, 2020, 10:47 p.m. OK Python 3 TESTS 9 389 13926400
99609699 deepcoder_B C Nov. 26, 2020, 5:36 a.m. OK Python 3 TESTS 9 389 16998400
99608385 maukaHAI C Nov. 26, 2020, 5:09 a.m. OK Python 3 TESTS 9 389 16998400
99521933 aman2000jaiswal14 C Nov. 25, 2020, 4:34 a.m. OK Python 3 TESTS 9 405 13824000
99516547 arnav2004 C Nov. 25, 2020, 2:32 a.m. OK Python 3 TESTS 9 420 13824000
99574774 prnb C Nov. 25, 2020, 3:26 p.m. OK Python 3 TESTS 9 436 13824000
99596985 utkarsh2102 C Nov. 25, 2020, 9:45 p.m. OK Ruby TESTS 9 701 21708800
99549236 koprus77 C Nov. 25, 2020, 10:41 a.m. OK Ruby TESTS 9 794 22118400
99562099 Strorkis C Nov. 25, 2020, 1:09 p.m. OK Rust TESTS 9 31 3891200
99511698 Slsvcn C Nov. 24, 2020, 11:13 p.m. OK Rust TESTS 9 62 4096000

remove filters

Back to search problems