Codeforces Round 769 (Div. 2)

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
1632 Codeforces Round 769 (Div. 2) FINISHED False 7200 93626663 Jan. 30, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4799 ) D New Year Concert PROGRAMMING binary search data structures dp greedy math number theory two pointers

B"New Year is just around the corner, which means that in School 179, preparations for the concert are in full swing. There are n classes in the school, numbered from 1 to n , the i -th class has prepared a scene of length a_i minutes. As the main one responsible for holding the concert, Idnar knows that if a concert has k scenes of lengths b_1 , b_2 , ldots , b_k minutes, then the audience will get bored if there exist two integers l and r such that 1 <= l <= r <= k and gcd(b_l, b_{l + 1}, ldots, b_{r - 1}, b_r) = r - l + 1 , where gcd(b_l, b_{l + 1}, ldots, b_{r - 1}, b_r) is equal to the greatest common divisor (GCD) of the numbers b_l , b_{l + 1} , ldots , b_{r - 1} , b_r . To avoid boring the audience, Idnar can ask any number of times (possibly zero) for the t -th class ( 1 <= t <= k ) to make a new scene d minutes in length, where d can be any positive integer. Thus, after this operation, b_t is equal to d . Note that t and d can be different for each operation. For a sequence of scene lengths b_1 , b_2 , ldots , b_{k} , let f(b) be the minimum number of classes Idnar has to ask to change their scene if he wants to avoid boring the audience. Idnar hasn't decided which scenes will be allowed for the concert, so he wants to know the value of f for each non-empty prefix of a . In other words, Idnar wants to know the values of f(a_1) , f(a_1 , a_2) , ldots , f(a_1 , a_2 , ldots , a_n) . The first line contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of classes in the school. The second line contains n positive integers a_1 , a_2 , ldots , a_n ( 1 <= a_i <= 10^9 ) -- the lengths of the class scenes. Print a sequence of n integers in a single line xe2"...

Tutorials

Editorial of Codeforces Round #769

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
144581849 chro4896 D Jan. 30, 2022, 4:33 p.m. OK GNU C11 TESTS 40 857 3174400
144610084 et3_tsy D Jan. 31, 2022, 4:03 a.m. OK GNU C++14 TESTS 41 108 307200
144584993 villash_992 D Jan. 30, 2022, 5:16 p.m. OK GNU C++14 TESTS 40 109 4812800
144608495 applese D Jan. 31, 2022, 3:24 a.m. OK GNU C++14 TESTS 41 124 1843200
144607330 JoesSR D Jan. 31, 2022, 2:49 a.m. OK GNU C++14 TESTS 41 124 19251200
144575413 MijPeter D Jan. 30, 2022, 4:18 p.m. OK GNU C++14 TESTS 40 139 3174400
144588299 FascTide D Jan. 30, 2022, 5:41 p.m. OK GNU C++14 TESTS 41 140 10444800
144607427 usrname0001125 D Jan. 31, 2022, 2:52 a.m. OK GNU C++14 TESTS 41 140 14540800
144594236 Mohammad.Nour D Jan. 30, 2022, 6:54 p.m. OK GNU C++14 TESTS 41 155 20172800
144584942 GB11 D Jan. 30, 2022, 5:16 p.m. OK GNU C++14 TESTS 40 156 1740800
144607318 tjd229 D Jan. 31, 2022, 2:48 a.m. OK GNU C++14 TESTS 41 156 4096000
144592654 jeroenodb D Jan. 30, 2022, 6:30 p.m. OK GNU C++17 TESTS 41 93 4915200
144591400 jeroenodb D Jan. 30, 2022, 6:14 p.m. OK GNU C++17 TESTS 41 93 5427200
144603749 31ballons D Jan. 30, 2022, 11:41 p.m. OK GNU C++17 TESTS 41 108 819200
144589996 jeroenodb D Jan. 30, 2022, 5:58 p.m. OK GNU C++17 TESTS 41 108 2764800
144579169 padfoot1717 D Jan. 30, 2022, 4:27 p.m. OK GNU C++17 TESTS 40 109 819200
144588902 D4nnyLee D Jan. 30, 2022, 5:47 p.m. OK GNU C++17 TESTS 41 109 819200
144607786 tyin D Jan. 31, 2022, 3:03 a.m. OK GNU C++17 TESTS 41 109 3584000
144590569 jeroenodb D Jan. 30, 2022, 6:04 p.m. OK GNU C++17 TESTS 41 109 5529600
144585967 1000cyans D Jan. 30, 2022, 5:22 p.m. OK GNU C++17 TESTS 40 124 102400
144611112 acwing_meow D Jan. 31, 2022, 4:24 a.m. OK GNU C++17 TESTS 41 124 819200
144611965 invaded D Jan. 31, 2022, 4:39 a.m. OK GNU C++17 (64) TESTS 41 78 1638400
144611270 1zhuxiaobaicai D Jan. 31, 2022, 4:27 a.m. OK GNU C++17 (64) TESTS 41 78 1638400
144609494 TomiokapEace D Jan. 31, 2022, 3:50 a.m. OK GNU C++17 (64) TESTS 41 93 819200
144590662 tourist D Jan. 30, 2022, 6:05 p.m. OK GNU C++17 (64) TESTS 41 93 819200
144611263 invaded D Jan. 31, 2022, 4:26 a.m. OK GNU C++17 (64) TESTS 41 93 1638400
144590228 1zhuxiaobaicai D Jan. 30, 2022, 6 p.m. OK GNU C++17 (64) TESTS 41 93 1638400
144615024 Retired_Isaunoya D Jan. 31, 2022, 5:31 a.m. OK GNU C++17 (64) TESTS 41 108 2355200
144578656 Qian_2333 D Jan. 30, 2022, 4:26 p.m. OK GNU C++17 (64) TESTS 40 108 10444800
144597094 dgupta0812 D Jan. 30, 2022, 7:44 p.m. OK GNU C++17 (64) TESTS 41 109 15052800
144597133 dgupta0812 D Jan. 30, 2022, 7:45 p.m. OK GNU C++17 (64) TESTS 41 109 15052800
144575091 Venia D Jan. 30, 2022, 4:17 p.m. OK GNU C++20 (64) TESTS 40 61 1638400
144582723 Acc_Robin D Jan. 30, 2022, 4:34 p.m. OK GNU C++20 (64) TESTS 40 62 1638400
144576513 Akrain D Jan. 30, 2022, 4:21 p.m. OK GNU C++20 (64) TESTS 40 77 1638400
144590029 brezhart D Jan. 30, 2022, 5:58 p.m. OK GNU C++20 (64) TESTS 41 78 3686400
144591890 STommydx D Jan. 30, 2022, 6:20 p.m. OK GNU C++20 (64) TESTS 41 78 16896000
144594284 dean.menezes D Jan. 30, 2022, 6:55 p.m. OK GNU C++20 (64) TESTS 41 93 819200
144575285 sqrfcy D Jan. 30, 2022, 4:18 p.m. OK GNU C++20 (64) TESTS 40 93 819200
144609448 keywet06 D Jan. 31, 2022, 3:48 a.m. OK GNU C++20 (64) TESTS 41 93 819200
144589825 Just_Josh D Jan. 30, 2022, 5:56 p.m. OK GNU C++20 (64) TESTS 41 93 1638400
144598316 Cosmo_police D Jan. 30, 2022, 8:09 p.m. OK GNU C++20 (64) TESTS 41 93 3686400
144604808 0x3F D Jan. 31, 2022, 12:50 a.m. OK Go TESTS 41 78 819200
144604795 0x3F D Jan. 31, 2022, 12:49 a.m. OK Go TESTS 41 217 3174400
144604222 0x3F D Jan. 31, 2022, 12:14 a.m. OK Go TESTS 41 218 4710400
144579408 kamranm D Jan. 30, 2022, 4:28 p.m. OK Java 11 TESTS 40 311 0
144613485 SavageClown007 D Jan. 31, 2022, 5:07 a.m. OK Java 11 TESTS 41 374 29184000
144587063 dzhi D Jan. 30, 2022, 5:30 p.m. OK Java 11 TESTS 40 545 0
144603505 Restricted D Jan. 30, 2022, 11:26 p.m. OK Java 11 TESTS 41 1185 0
144584803 naman5811 D Jan. 30, 2022, 5:16 p.m. OK Java 11 TESTS 40 1216 23142400
144576388 naman_23 D Jan. 30, 2022, 4:20 p.m. OK Java 11 TESTS 40 1216 23142400
144594352 SaberXpro D Jan. 30, 2022, 6:56 p.m. OK Java 11 TESTS 41 1232 23142400
144615629 __Serendipity D Jan. 31, 2022, 5:41 a.m. OK Java 11 TESTS 41 1325 4505600
144588623 MrOtter D Jan. 30, 2022, 5:44 p.m. OK Java 11 TESTS 41 1747 102400
144578661 zoro_hiyori D Jan. 30, 2022, 4:26 p.m. OK Java 11 TESTS 40 1762 3584000
144588386 ashanksingh1997 D Jan. 30, 2022, 5:42 p.m. OK Java 8 TESTS 41 342 39219200
144601591 golions D Jan. 30, 2022, 9:42 p.m. OK Java 8 TESTS 41 421 34611200
144601244 invincible777 D Jan. 30, 2022, 9:29 p.m. OK Java 8 TESTS 41 654 48844800
144609230 aggarwalanshul01 D Jan. 31, 2022, 3:43 a.m. OK Java 8 TESTS 41 1934 18636800
144586041 kkkkush D Jan. 30, 2022, 5:22 p.m. OK Java 8 TESTS 40 2448 2867200
144616954 Zahid_Hasan_Sahin D Jan. 31, 2022, 6 a.m. OK Java 8 TESTS 41 2464 0
144580936 Sergey.Bankevich D Jan. 30, 2022, 4:31 p.m. OK Kotlin 1.4 TESTS 40 607 20787200
144591981 r57shell D Jan. 30, 2022, 6:21 p.m. OK MS C++ 2017 TESTS 41 140 819200
144590811 r57shell D Jan. 30, 2022, 6:07 p.m. OK MS C++ 2017 TESTS 41 155 819200
144597806 P___ D Jan. 30, 2022, 7:59 p.m. OK MS C++ 2017 TESTS 41 717 1638400
144574445 Aroundthefur D Jan. 30, 2022, 4:16 p.m. OK MS C++ 2017 TESTS 40 1185 5632000
144578323 b643100 D Jan. 30, 2022, 4:25 p.m. OK MS C++ 2017 TESTS 40 1248 4812800
144598196 Alexey D Jan. 30, 2022, 8:06 p.m. OK MS C++ 2017 TESTS 41 1294 15769600
144588383 r57shell D Jan. 30, 2022, 5:42 p.m. OK MS C++ 2017 TESTS 41 2215 2457600
144601138 ItsNikolor D Jan. 30, 2022, 9:26 p.m. OK MS C++ 2017 TESTS 41 2683 5529600
144575459 SPD_9X2 D Jan. 30, 2022, 4:18 p.m. OK PyPy 3 TESTS 40 483 22835200
144597705 anishde85 D Jan. 30, 2022, 7:56 p.m. OK PyPy 3 TESTS 41 592 30822400
144579426 Het_Fadia D Jan. 30, 2022, 4:28 p.m. OK PyPy 3 TESTS 40 1574 21811200
144579215 Het_Fadia1814 D Jan. 30, 2022, 4:27 p.m. OK PyPy 3 TESTS 40 1731 18636800
144586001 Igorfardoc D Jan. 30, 2022, 5:22 p.m. OK PyPy 3 TESTS 40 1965 29184000
144593816 hxu10 D Jan. 30, 2022, 6:47 p.m. OK PyPy 3 TESTS 41 2464 24166400
144585532 FlakeLCR D Jan. 30, 2022, 5:19 p.m. OK PyPy 3-64 TESTS 40 436 30822400
144590157 vilhelmthorsson D Jan. 30, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 41 499 31641600
144590284 DBabichev D Jan. 30, 2022, 6:01 p.m. OK PyPy 3-64 TESTS 41 514 61030400
144589787 DBabichev D Jan. 30, 2022, 5:55 p.m. OK PyPy 3-64 TESTS 41 561 63283200
144607722 uttharapally.chandra D Jan. 31, 2022, 3:01 a.m. OK PyPy 3-64 TESTS 41 1310 69222400
144607614 uttharapally.chandra D Jan. 31, 2022, 2:58 a.m. OK PyPy 3-64 TESTS 41 1325 69120000
144588442 jaglike_makkar D Jan. 30, 2022, 5:42 p.m. OK PyPy 3-64 TESTS 41 1387 59289600
144588598 Het_Fadia D Jan. 30, 2022, 5:44 p.m. OK PyPy 3-64 TESTS 41 1466 36864000
144608004 uttharapally.chandra D Jan. 31, 2022, 3:10 a.m. OK PyPy 3-64 TESTS 41 2620 108032000
144587687 OLOGY D Jan. 30, 2022, 5:35 p.m. OK Python 2 TESTS 40 545 15564800
144585343 OLOGY D Jan. 30, 2022, 5:18 p.m. OK Python 2 TESTS 40 561 15667200
144595858 qwerty787788 D Jan. 30, 2022, 7:21 p.m. OK Rust 2021 TESTS 41 156 39424000
144606085 clause D Jan. 31, 2022, 2:03 a.m. OK Rust 2021 TESTS 41 1278 97792000
144575599 Russell_Emerine D Jan. 30, 2022, 4:18 p.m. OK Rust 2021 TESTS 40 1481 39014400

remove filters

Back to search problems