Codeforces Round 700 (Div. 1)

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
1479 Codeforces Round 700 (Div. 1) FINISHED False 8100 124471463 Feb. 7, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4129 ) B2 Painting the Array II PROGRAMMING data structures dp greedy implementation

B'The only difference between the two versions is that this version asks the minimal possible answer. Homer likes arrays a lot. Today he is painting an array a_1, a_2, ... , a_n with two kinds of colors, white and black. A painting assignment for a_1, a_2, ... , a_n is described by an array b_1, b_2, ... , b_n that b_i indicates the color of a_i ( 0 for white and 1 for black). According to a painting assignment b_1, b_2, ... , b_n , the array a is split into two new arrays a^{(0)} and a^{(1)} , where a^{(0)} is the sub-sequence of all white elements in a and a^{(1)} is the sub-sequence of all black elements in a . For example, if a = [1,2,3,4,5,6] and b = [0,1,0,1,0,0] , then a^{(0)} = [1,3,5,6] and a^{(1)} = [2,4] . The number of segments in an array c_1, c_2, ... , c_k , denoted mathit{seg}(c) , is the number of elements if we merge all adjacent elements with the same value in c . For example, the number of segments in [1,1,2,2,3,3,3,2] is 4 , because the array will become [1,2,3,2] after merging adjacent elements with the same value. Especially, the number of segments in an empty array is 0 . Homer wants to find a painting assignment b , according to which the number of segments in both a^{(0)} and a^{(1)} , i.e. mathit{seg}(a^{(0)})+ mathit{seg}(a^{(1)}) , is as small as possible. Find this number. The first line contains an integer n ( 1 <= q n <= q 10^5 ). The second line contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q n ). Output a single integer, indicating the minimal possible total number of segments. In the first example, we can choose a^{(0)} = [1,1,2,2] , a^{(1)} = [2,3] and mathit{seg}(a^{(0)}) = mathit{seg}(a^{(1)}) = 2 . So the answer is 2+2 = 4 . In the second example, we can choose a^{(0)} = [1,1,1,1] , '...

Tutorials

Editorial of Codeforces Round #700

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
106834434 hos.lyric B2 Feb. 7, 2021, 4:36 p.m. OK D TESTS 40 46 6144000
106823592 Gassa B2 Feb. 7, 2021, 4:17 p.m. OK D TESTS 40 62 6144000
106864755 N_xiongyx B2 Feb. 8, 2021, 2:05 a.m. OK GNU C++11 TESTS 41 15 1638400
106787338 ezoilearner B2 Feb. 7, 2021, 3:21 p.m. OK GNU C++11 TESTS 40 15 2764800
106818440 hlhhlhhlh B2 Feb. 7, 2021, 4:08 p.m. OK GNU C++11 TESTS 40 30 2048000
106865082 comld B2 Feb. 8, 2021, 2:14 a.m. OK GNU C++11 TESTS 41 30 16076800
106861721 bluefi B2 Feb. 8, 2021, 12:14 a.m. OK GNU C++11 TESTS 41 31 819200
106828951 epic01 B2 Feb. 7, 2021, 4:26 p.m. OK GNU C++11 TESTS 40 31 819200
106812350 Biadocy B2 Feb. 7, 2021, 3:58 p.m. OK GNU C++11 TESTS 40 31 1228800
106868532 vandoor B2 Feb. 8, 2021, 3:27 a.m. OK GNU C++11 TESTS 41 31 1228800
106803413 Yukikaze_ B2 Feb. 7, 2021, 3:44 p.m. OK GNU C++11 TESTS 40 31 1228800
106872965 little_brush B2 Feb. 8, 2021, 4:40 a.m. OK GNU C++11 TESTS 41 31 1228800
106798248 Zetr0 B2 Feb. 7, 2021, 3:36 p.m. OK GNU C++14 TESTS 40 46 512000
106788282 receed B2 Feb. 7, 2021, 3:22 p.m. OK GNU C++14 TESTS 40 46 819200
106774890 SongC B2 Feb. 7, 2021, 3:04 p.m. OK GNU C++14 TESTS 40 46 1228800
106876055 CunFu_ZhuGe B2 Feb. 8, 2021, 5:25 a.m. OK GNU C++14 TESTS 41 46 1228800
106774423 lucaperju B2 Feb. 7, 2021, 3:04 p.m. OK GNU C++14 TESTS 40 46 1638400
106839624 antguz B2 Feb. 7, 2021, 4:46 p.m. OK GNU C++14 TESTS 40 46 1638400
106799870 lovemathboy B2 Feb. 7, 2021, 3:39 p.m. OK GNU C++14 TESTS 40 46 1638400
106798541 Devil B2 Feb. 7, 2021, 3:37 p.m. OK GNU C++14 TESTS 40 46 1740800
106850626 marcOS B2 Feb. 7, 2021, 7:20 p.m. OK GNU C++14 TESTS 41 46 1740800
106829772 habara-k B2 Feb. 7, 2021, 4:28 p.m. OK GNU C++14 TESTS 40 46 1740800
106812694 He_Ren B2 Feb. 7, 2021, 3:58 p.m. OK GNU C++17 TESTS 40 46 819200
106779215 SHZhang2 B2 Feb. 7, 2021, 3:10 p.m. OK GNU C++17 TESTS 40 46 819200
106811917 yogahmad77 B2 Feb. 7, 2021, 3:57 p.m. OK GNU C++17 TESTS 40 46 1126400
106833601 jereyes4 B2 Feb. 7, 2021, 4:35 p.m. OK GNU C++17 TESTS 40 46 1228800
106822671 AlexanderL B2 Feb. 7, 2021, 4:15 p.m. OK GNU C++17 TESTS 40 46 1228800
106833207 amethyst0 B2 Feb. 7, 2021, 4:34 p.m. OK GNU C++17 TESTS 40 46 1228800
106878618 Andy01_ B2 Feb. 8, 2021, 5:59 a.m. OK GNU C++17 TESTS 41 46 1228800
106873739 liouzhou_101 B2 Feb. 8, 2021, 4:53 a.m. OK GNU C++17 TESTS 41 46 1228800
106867683 Werner_Yin B2 Feb. 8, 2021, 3:11 a.m. OK GNU C++17 TESTS 41 46 1228800
106857088 Aaeria B2 Feb. 7, 2021, 9:17 p.m. OK GNU C++17 TESTS 41 46 1228800
106792073 Swistakk B2 Feb. 7, 2021, 3:28 p.m. OK GNU C++17 (64) TESTS 40 31 819200
106851426 concamap B2 Feb. 7, 2021, 7:31 p.m. OK GNU C++17 (64) TESTS 41 31 1228800
106856704 jc713 B2 Feb. 7, 2021, 9:07 p.m. OK GNU C++17 (64) TESTS 41 31 1228800
106786383 UnstoppableChillMachine B2 Feb. 7, 2021, 3:20 p.m. OK GNU C++17 (64) TESTS 40 31 1228800
106875804 LiChenKoh B2 Feb. 8, 2021, 5:22 a.m. OK GNU C++17 (64) TESTS 41 31 1433600
106806429 burnoutag B2 Feb. 7, 2021, 3:48 p.m. OK GNU C++17 (64) TESTS 40 31 1638400
106807980 keko37 B2 Feb. 7, 2021, 3:51 p.m. OK GNU C++17 (64) TESTS 40 31 1843200
106855184 Hile_Meow B2 Feb. 7, 2021, 8:35 p.m. OK GNU C++17 (64) TESTS 41 31 2252800
106763469 IsraelWinningIOI2021 B2 Feb. 7, 2021, 2:50 p.m. OK GNU C++17 (64) TESTS 40 31 2457600
106859547 Noam13 B2 Feb. 7, 2021, 10:37 p.m. OK GNU C++17 (64) TESTS 41 31 2457600
106795255 ASoboll B2 Feb. 7, 2021, 3:32 p.m. OK Java 11 TESTS 40 218 0
106821750 saptarshi1729 B2 Feb. 7, 2021, 4:14 p.m. OK Java 11 TESTS 40 264 4608000
106832635 Apfeloxid B2 Feb. 7, 2021, 4:33 p.m. OK Java 11 TESTS 40 327 66764800
106802033 LNB B2 Feb. 7, 2021, 3:42 p.m. OK Java 11 TESTS 40 374 18329600
106784020 uwi B2 Feb. 7, 2021, 3:16 p.m. OK Java 11 TESTS 40 421 0
106818074 sarthakmanna B2 Feb. 7, 2021, 4:07 p.m. OK Java 11 TESTS 40 576 27238400
106862620 YahiaSherif B2 Feb. 8, 2021, 12:51 a.m. OK Java 8 TESTS 41 139 0
106810376 fetetriste B2 Feb. 7, 2021, 3:55 p.m. OK Java 8 TESTS 40 140 0
106828009 polyakoff B2 Feb. 7, 2021, 4:25 p.m. OK Java 8 TESTS 40 140 0
106825318 awesomelemonade B2 Feb. 7, 2021, 4:20 p.m. OK Java 8 TESTS 40 140 0
106846930 hu_tao B2 Feb. 7, 2021, 6:51 p.m. OK Java 8 TESTS 41 155 0
106804191 golions B2 Feb. 7, 2021, 3:45 p.m. OK Java 8 TESTS 40 155 0
106784873 iakovlev.zakhar B2 Feb. 7, 2021, 3:18 p.m. OK Java 8 TESTS 40 155 0
106771242 dalt B2 Feb. 7, 2021, 2:59 p.m. OK Java 8 TESTS 40 202 0
106811298 DarLam B2 Feb. 7, 2021, 3:56 p.m. OK Java 8 TESTS 40 202 0
106812001 shilov B2 Feb. 7, 2021, 3:57 p.m. OK Java 8 TESTS 40 265 6144000
106772651 Tlatoani B2 Feb. 7, 2021, 3:01 p.m. OK Kotlin TESTS 40 140 0
106820265 terry_u16 B2 Feb. 7, 2021, 4:11 p.m. OK .NET Core C# TESTS 40 109 1945600
106799680 keymoon B2 Feb. 7, 2021, 3:38 p.m. OK .NET Core C# TESTS 40 109 10240000
106813736 Arnyev B2 Feb. 7, 2021, 4 p.m. OK .NET Core C# TESTS 40 155 25190400
106809426 pineriver B2 Feb. 7, 2021, 3:53 p.m. OK PyPy 3 TESTS 40 140 11673600
106829550 nimiranio B2 Feb. 7, 2021, 4:27 p.m. OK PyPy 3 TESTS 40 155 11673600
106864388 mkawa2 B2 Feb. 8, 2021, 1:52 a.m. OK PyPy 3 TESTS 41 155 76800000
106794517 Kiri8128 B2 Feb. 7, 2021, 3:31 p.m. OK PyPy 3 TESTS 40 156 10342400
106851680 jimm89 B2 Feb. 7, 2021, 7:34 p.m. OK PyPy 3 TESTS 41 171 9728000
106808435 Tomii9273 B2 Feb. 7, 2021, 3:52 p.m. OK PyPy 3 TESTS 40 171 11264000
106867615 Kira_1234 B2 Feb. 8, 2021, 3:09 a.m. OK PyPy 3 TESTS 41 202 17305600
106825376 titia B2 Feb. 7, 2021, 4:20 p.m. OK PyPy 3 TESTS 40 280 12902400
106848216 Melmetal B2 Feb. 7, 2021, 6:59 p.m. OK PyPy 3 TESTS 41 280 15564800
106850238 FireBird23 B2 Feb. 7, 2021, 7:16 p.m. OK PyPy 3 TESTS 41 311 30822400
106780548 nwi B2 Feb. 7, 2021, 3:12 p.m. OK Python 2 TESTS 40 155 5324800
106805230 sansen B2 Feb. 7, 2021, 3:47 p.m. OK Rust TESTS 40 109 3584000

remove filters

Back to search problems