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
( 7074 ) B1 Painting the Array I PROGRAMMING constructive algorithms data structures dp greedy implementation

B'The only difference between the two versions is that this version asks the maximal 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 large 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 maximal possible total number of segments. In the first example, we can choose a^{(0)} = [1,2,3,3] , a^{(1)} = [1,2,3] and mathit{seg}(a^{(0)}) = mathit{seg}(a^{(1)}) = 3 . So the answer is 3+3 = 6 . In the second example, we can choose a^{(0)} = [1,2,3,4,5,6,7]'...

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
106836216 hos.lyric B1 Feb. 7, 2021, 4:40 p.m. OK D TESTS 40 46 13516800
106813423 Gassa B1 Feb. 7, 2021, 3:59 p.m. OK D TESTS 40 218 6144000
106853514 fishcathu. B1 Feb. 7, 2021, 8 p.m. OK GNU C++11 TESTS 41 15 409600
106785233 Daas B1 Feb. 7, 2021, 3:18 p.m. OK GNU C++11 TESTS 40 30 819200
106821206 Pointy B1 Feb. 7, 2021, 4:13 p.m. OK GNU C++11 TESTS 40 30 1228800
106808511 hlhhlhhlh B1 Feb. 7, 2021, 3:52 p.m. OK GNU C++11 TESTS 40 30 1638400
106817627 skydogli B1 Feb. 7, 2021, 4:06 p.m. OK GNU C++11 TESTS 40 30 3174400
106787706 _Viole_ B1 Feb. 7, 2021, 3:22 p.m. OK GNU C++11 TESTS 40 30 5632000
106803767 fefe B1 Feb. 7, 2021, 3:44 p.m. OK GNU C++11 TESTS 40 31 0
106765366 ig-Rookie B1 Feb. 7, 2021, 2:52 p.m. OK GNU C++11 TESTS 40 31 0
106823019 WDCnew B1 Feb. 7, 2021, 4:16 p.m. OK GNU C++11 TESTS 40 31 204800
106808258 dqa2021 B1 Feb. 7, 2021, 3:51 p.m. OK GNU C++11 TESTS 40 31 409600
106791525 Motarack B1 Feb. 7, 2021, 3:27 p.m. OK GNU C++14 TESTS 40 46 0
106834009 SuperJ6 B1 Feb. 7, 2021, 4:36 p.m. OK GNU C++14 TESTS 40 46 0
106848252 sped7 B1 Feb. 7, 2021, 7 p.m. OK GNU C++14 TESTS 40 46 0
106820175 yingtix B1 Feb. 7, 2021, 4:11 p.m. OK GNU C++14 TESTS 40 46 409600
106802371 wzyeustia B1 Feb. 7, 2021, 3:42 p.m. OK GNU C++14 TESTS 40 46 409600
106803134 zhanggengchen B1 Feb. 7, 2021, 3:43 p.m. OK GNU C++14 TESTS 40 46 409600
106807264 antguz B1 Feb. 7, 2021, 3:50 p.m. OK GNU C++14 TESTS 40 46 409600
106857819 SuperJ6 B1 Feb. 7, 2021, 9:38 p.m. OK GNU C++14 TESTS 42 46 409600
106850369 xt0r3 B1 Feb. 7, 2021, 7:17 p.m. OK GNU C++14 TESTS 40 46 409600
106815490 DeaphetS B1 Feb. 7, 2021, 4:03 p.m. OK GNU C++14 TESTS 40 46 409600
106793975 Sutaner B1 Feb. 7, 2021, 3:30 p.m. OK GNU C++17 TESTS 40 31 4608000
106774015 matt64 B1 Feb. 7, 2021, 3:03 p.m. OK GNU C++17 TESTS 40 46 0
106779938 pashka B1 Feb. 7, 2021, 3:11 p.m. OK GNU C++17 TESTS 40 46 0
106785445 Hyperbolic B1 Feb. 7, 2021, 3:18 p.m. OK GNU C++17 TESTS 40 46 0
106800980 Double_B B1 Feb. 7, 2021, 3:40 p.m. OK GNU C++17 TESTS 40 46 0
106838600 tejas10p B1 Feb. 7, 2021, 4:44 p.m. OK GNU C++17 TESTS 40 46 409600
106820564 Azunya B1 Feb. 7, 2021, 4:11 p.m. OK GNU C++17 TESTS 40 46 409600
106828714 hjj B1 Feb. 7, 2021, 4:26 p.m. OK GNU C++17 TESTS 40 46 409600
106838515 kolina B1 Feb. 7, 2021, 4:44 p.m. OK GNU C++17 TESTS 40 46 409600
106856734 Aaeria B1 Feb. 7, 2021, 9:08 p.m. OK GNU C++17 TESTS 42 46 409600
106783515 -is-this-fft- B1 Feb. 7, 2021, 3:16 p.m. OK GNU C++17 (64) TESTS 40 31 0
106790766 smax B1 Feb. 7, 2021, 3:26 p.m. OK GNU C++17 (64) TESTS 40 31 409600
106873640 LiChenKoh B1 Feb. 8, 2021, 4:51 a.m. OK GNU C++17 (64) TESTS 42 31 409600
106863724 misir B1 Feb. 8, 2021, 1:32 a.m. OK GNU C++17 (64) TESTS 42 31 409600
106780525 Delfad0r B1 Feb. 7, 2021, 3:12 p.m. OK GNU C++17 (64) TESTS 40 31 409600
106763487 hitonanode B1 Feb. 7, 2021, 2:50 p.m. OK GNU C++17 (64) TESTS 40 31 409600
106864830 yuzhechuan B1 Feb. 8, 2021, 2:07 a.m. OK GNU C++17 (64) TESTS 42 31 819200
106768198 Lemonade255 B1 Feb. 7, 2021, 2:56 p.m. OK GNU C++17 (64) TESTS 40 31 819200
106774379 egekabas B1 Feb. 7, 2021, 3:04 p.m. OK GNU C++17 (64) TESTS 40 31 819200
106795244 taulant B1 Feb. 7, 2021, 3:32 p.m. OK GNU C++17 (64) TESTS 40 31 819200
106808926 Apfeloxid B1 Feb. 7, 2021, 3:52 p.m. OK Java 11 TESTS 40 202 0
106810749 saptarshi1729 B1 Feb. 7, 2021, 3:55 p.m. OK Java 11 TESTS 40 217 0
106814787 ASoboll B1 Feb. 7, 2021, 4:02 p.m. OK Java 11 TESTS 40 218 0
106813907 nick_301 B1 Feb. 7, 2021, 4 p.m. OK Java 11 TESTS 40 218 1638400
106798617 sarthakmanna B1 Feb. 7, 2021, 3:37 p.m. OK Java 11 TESTS 40 233 512000
106856310 skittles1412 B1 Feb. 7, 2021, 8:59 p.m. OK Java 11 TESTS 42 280 18944000
106800206 LNB B1 Feb. 7, 2021, 3:39 p.m. OK Java 11 TESTS 40 342 18329600
106776874 uwi B1 Feb. 7, 2021, 3:07 p.m. OK Java 11 TESTS 40 374 0
106830962 hu_tao B1 Feb. 7, 2021, 4:30 p.m. OK Java 8 TESTS 40 124 0
106783542 golions B1 Feb. 7, 2021, 3:16 p.m. OK Java 8 TESTS 40 124 0
106797030 shilov B1 Feb. 7, 2021, 3:35 p.m. OK Java 8 TESTS 40 140 0
106803673 awesomelemonade B1 Feb. 7, 2021, 3:44 p.m. OK Java 8 TESTS 40 140 0
106802966 fetetriste B1 Feb. 7, 2021, 3:43 p.m. OK Java 8 TESTS 40 140 0
106794845 polyakoff B1 Feb. 7, 2021, 3:32 p.m. OK Java 8 TESTS 40 140 0
106837722 YahiaSherif B1 Feb. 7, 2021, 4:42 p.m. OK Java 8 TESTS 40 171 0
106781288 iakovlev.zakhar B1 Feb. 7, 2021, 3:13 p.m. OK Java 8 TESTS 40 171 0
106813781 DarLam B1 Feb. 7, 2021, 4 p.m. OK Java 8 TESTS 40 202 0
106773559 dalt B1 Feb. 7, 2021, 3:02 p.m. OK Java 8 TESTS 40 218 0
106784015 Tlatoani B1 Feb. 7, 2021, 3:16 p.m. OK Kotlin TESTS 40 155 0
106878363 jonitox B1 Feb. 8, 2021, 5:55 a.m. OK MS C++ 2017 TESTS 42 124 2662400
106816632 Yupiteru B1 Feb. 7, 2021, 4:05 p.m. OK .NET Core C# TESTS 40 93 819200
106811271 terry_u16 B1 Feb. 7, 2021, 3:56 p.m. OK .NET Core C# TESTS 40 109 3481600
106791859 keymoon B1 Feb. 7, 2021, 3:27 p.m. OK .NET Core C# TESTS 40 109 7884800
106795729 Arnyev B1 Feb. 7, 2021, 3:33 p.m. OK .NET Core C# TESTS 40 124 8294400
106798431 not_tehlka B1 Feb. 7, 2021, 3:37 p.m. OK PyPy 3 TESTS 40 140 9011200
106878479 tamato B1 Feb. 8, 2021, 5:57 a.m. OK PyPy 3 TESTS 42 155 9830400
106816000 qwertz73355a B1 Feb. 7, 2021, 4:04 p.m. OK PyPy 3 TESTS 40 155 11980800
106793052 Tomii9273 B1 Feb. 7, 2021, 3:29 p.m. OK PyPy 3 TESTS 40 155 12083200
106796635 mkawa2 B1 Feb. 7, 2021, 3:34 p.m. OK PyPy 3 TESTS 40 155 76595200
106782903 pineriver B1 Feb. 7, 2021, 3:15 p.m. OK PyPy 3 TESTS 40 170 13107200
106878856 phuocchubeo B1 Feb. 8, 2021, 6:01 a.m. OK PyPy 3 TESTS 42 171 9216000
106803503 titia B1 Feb. 7, 2021, 3:44 p.m. OK PyPy 3 TESTS 40 171 11673600
106868100 Stephan B1 Feb. 8, 2021, 3:19 a.m. OK PyPy 3 TESTS 42 171 11878400
106817592 nimiranio B1 Feb. 7, 2021, 4:06 p.m. OK PyPy 3 TESTS 40 171 12697600
106814973 nwi B1 Feb. 7, 2021, 4:02 p.m. OK Python 2 TESTS 40 202 9318400
106848415 r57shell B1 Feb. 7, 2021, 7:01 p.m. OK Python 3 TESTS 40 109 7168000
106781758 sansen B1 Feb. 7, 2021, 3:13 p.m. OK Rust TESTS 40 93 3584000

remove filters

Back to search problems