Codeforces Round 716 (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
1514 Codeforces Round 716 (Div. 2) FINISHED False 8100 112983899 April 19, 2021, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4357 ) D Cut and Stick PROGRAMMING binary search data structures greedy probabilities sortings

B"Baby Ehab has a piece of Cut and Stick with an array a of length n written on it. He plans to grab a pair of scissors and do the following to it: More formally, he partitions the sequence a_l , a_{l + 1} , ..., a_r into subsequences. He thinks a partitioning is beautiful if for every piece (subsequence) it holds that, if it has length x , then no value occurs strictly more than lceil frac{x}{2} rceil times in it. He didn't pick a range yet, so he's wondering: for q ranges (l, r) , what is the minimum number of pieces he needs to partition the elements a_l , a_{l + 1} , ..., a_r into so that the partitioning is beautiful. A sequence b is a subsequence of an array a if b can be obtained from a by deleting some (possibly zero) elements. Note that it does not have to be contiguous. The first line contains two integers n and q ( 1 <= n,q <= 3 cdot 10^5 ) -- the length of the array a and the number of queries. The second line contains n integers a_1 , a_2 , ..., a_{n} ( 1 <= a_i <= n ) -- the elements of the array a . Each of the next q lines contains two integers l and r ( 1 <= l <= r <= n ) -- the range of this query. For each query, print the minimum number of subsequences you need to partition this range into so that the partitioning is beautiful. We can prove such partitioning always exists. In the first query, you can just put the whole array in one subsequence, since its length is 6 , and no value occurs more than 3 times in it. In the second query, the elements of the query range are [3,2,3,3] . You can't put them all in one subsequence, since its length is 4 , and 3 occurs more than 2 times. However, you can partition it into two subsequences: [3] and [2,3,3] . "...

Tutorials

Codeforces round #716 editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
113565503 jasonfan D April 20, 2021, 12:04 a.m. OK GNU C++11 TESTS 56 311 85401600
113565567 zzctommy D April 20, 2021, 12:06 a.m. OK GNU C++11 TESTS 56 343 74547200
113529014 void_basic_learner D April 19, 2021, 3:24 p.m. OK GNU C++11 TESTS 43 358 78233600
113572040 lanChe D April 20, 2021, 2:52 a.m. OK GNU C++11 TESTS 56 374 19251200
113531731 zhaosongwen D April 19, 2021, 3:36 p.m. OK GNU C++11 TESTS 43 405 117862400
113533851 1919 D April 19, 2021, 3:44 p.m. OK GNU C++11 TESTS 43 405 128307200
113537775 acrn D April 19, 2021, 4:31 p.m. OK GNU C++11 TESTS 43 405 128307200
113530631 zhujunchao D April 19, 2021, 3:31 p.m. OK GNU C++11 TESTS 43 405 488960000
113563200 Huanlin_ D April 19, 2021, 11:08 p.m. OK GNU C++11 TESTS 56 420 91443200
113530380 iuiou D April 19, 2021, 3:30 p.m. OK GNU C++11 TESTS 43 421 19251200
113542817 primy D April 19, 2021, 5:12 p.m. OK GNU C++14 TESTS 47 467 91340800
113566960 ye2000song D April 20, 2021, 12:48 a.m. OK GNU C++14 TESTS 56 483 122265600
113538573 lmhoang D April 19, 2021, 4:35 p.m. OK GNU C++14 TESTS 43 498 32665600
113570870 Bedo_Sayed D April 20, 2021, 2:25 a.m. OK GNU C++14 TESTS 56 514 19456000
113543227 primy D April 19, 2021, 5:16 p.m. OK GNU C++14 TESTS 47 529 91443200
113576842 Potassium D April 20, 2021, 4:28 a.m. OK GNU C++14 TESTS 56 545 21196800
113529449 hnust_guanxin D April 19, 2021, 3:25 p.m. OK GNU C++14 TESTS 43 545 122265600
113538604 littlechai D April 19, 2021, 4:35 p.m. OK GNU C++14 TESTS 43 545 248524800
113529142 ShubhamAvasthi D April 19, 2021, 3:24 p.m. OK GNU C++14 TESTS 43 561 31436800
113533419 _Subrata D April 19, 2021, 3:42 p.m. OK GNU C++14 TESTS 43 623 17920000
113575515 lifehappiness D April 20, 2021, 4:01 a.m. OK GNU C++17 TESTS 56 436 151552000
113566375 Yang_Lin D April 20, 2021, 12:31 a.m. OK GNU C++17 TESTS 56 436 151552000
113580503 dongdziz D April 20, 2021, 5:29 a.m. OK GNU C++17 TESTS 59 436 184012800
113537399 Zhang_acmer D April 19, 2021, 4:29 p.m. OK GNU C++17 TESTS 43 452 80588800
113576770 cwhao D April 20, 2021, 4:27 a.m. OK GNU C++17 TESTS 56 468 19456000
113542900 yan.silva D April 19, 2021, 5:13 p.m. OK GNU C++17 TESTS 47 468 19456000
113533668 wjmsxbd D April 19, 2021, 3:43 p.m. OK GNU C++17 TESTS 43 468 110592000
113565192 Yang_Lin D April 19, 2021, 11:57 p.m. OK GNU C++17 TESTS 56 468 151552000
113539202 31901179 D April 19, 2021, 4:40 p.m. OK GNU C++17 TESTS 44 482 122265600
113570273 Zhang_acmer D April 20, 2021, 2:10 a.m. OK GNU C++17 TESTS 56 499 80588800
113546647 neal D April 19, 2021, 5:51 p.m. OK GNU C++17 (64) TESTS 50 187 20582400
113546285 neal D April 19, 2021, 5:48 p.m. OK GNU C++17 (64) TESTS 50 327 20480000
113571756 generic_placeholder_name D April 20, 2021, 2:46 a.m. OK GNU C++17 (64) TESTS 56 389 22937600
113553685 kaiboy D April 19, 2021, 7:31 p.m. OK GNU C++17 (64) TESTS 53 405 18739200
113547941 rainboy D April 19, 2021, 6:06 p.m. OK GNU C++17 (64) TESTS 50 405 22220800
113571977 tomato_potato D April 20, 2021, 2:51 a.m. OK GNU C++17 (64) TESTS 56 405 62976000
113530286 Francium D April 19, 2021, 3:29 p.m. OK GNU C++17 (64) TESTS 43 421 22937600
113566189 Thallium54 D April 20, 2021, 12:25 a.m. OK GNU C++17 (64) TESTS 56 436 31334400
113569980 tom0727 D April 20, 2021, 2:02 a.m. OK GNU C++17 (64) TESTS 56 436 241664000
113566331 tom0727 D April 20, 2021, 12:29 a.m. OK GNU C++17 (64) TESTS 56 452 241664000
113571697 0x3F D April 20, 2021, 2:45 a.m. OK Go TESTS 56 483 41574400
113553684 Dukkha D April 19, 2021, 7:31 p.m. OK Java 11 TESTS 53 561 20684800
113549004 Dukkha D April 19, 2021, 6:20 p.m. OK Java 11 TESTS 50 654 32870400
113551083 Dukkha D April 19, 2021, 6:50 p.m. OK Java 11 TESTS 51 1606 21401600
113551843 Dukkha D April 19, 2021, 7:02 p.m. OK Java 11 TESTS 51 1715 21504000
113545426 nirvana_rsc D April 19, 2021, 5:38 p.m. OK Java 11 TESTS 50 1965 23347200
113551772 Dukkha D April 19, 2021, 7:01 p.m. OK Java 11 TESTS 51 2246 21504000
113545519 nirvana_rsc D April 19, 2021, 5:39 p.m. OK Java 11 TESTS 50 2246 23347200
113542788 R3KT D April 19, 2021, 5:12 p.m. OK Java 11 TESTS 47 2542 18534400
113532815 java. D April 19, 2021, 3:40 p.m. OK Java 11 TESTS 43 2589 55398400
113547692 Apfeloxid D April 19, 2021, 6:03 p.m. OK Java 11 TESTS 50 2916 81715200
113541052 Agnimandur D April 19, 2021, 4:56 p.m. OK Java 8 TESTS 44 919 17203200
113540975 Agnimandur D April 19, 2021, 4:55 p.m. OK Java 8 TESTS 44 1060 17203200
113541015 Agnimandur D April 19, 2021, 4:55 p.m. OK Java 8 TESTS 44 1372 17203200
113538295 EndlessVoid D April 19, 2021, 4:33 p.m. OK Java 8 TESTS 43 1731 15872000
113537456 SlowLegendaryNoobMaster D April 19, 2021, 4:29 p.m. OK Java 8 TESTS 43 1965 21606400
113550566 Dstoical D April 19, 2021, 6:43 p.m. OK Java 8 TESTS 50 1980 22528000
113562125 hu_tao D April 19, 2021, 10:37 p.m. OK Java 8 TESTS 56 2729 6451200
113562139 hu_tao D April 19, 2021, 10:37 p.m. OK Java 8 TESTS 56 2917 6451200
113559320 TheSawan D April 19, 2021, 9:21 p.m. OK Java 8 TESTS 56 2948 22016000
113559183 TheSawan D April 19, 2021, 9:18 p.m. OK Java 8 TESTS 56 2963 22016000
113549125 r57shell D April 19, 2021, 6:22 p.m. OK MS C++ TESTS 50 530 20480000
113548085 r57shell D April 19, 2021, 6:08 p.m. OK MS C++ TESTS 50 1731 13312000
113532573 youx D April 19, 2021, 3:39 p.m. OK MS C++ 2017 TESTS 43 982 8396800
113538819 Seyaua D April 19, 2021, 4:37 p.m. OK MS C++ 2017 TESTS 43 1606 8396800
113531399 tarattata1 D April 19, 2021, 3:34 p.m. OK MS C++ 2017 TESTS 43 1887 12083200
113569420 P___ D April 20, 2021, 1:46 a.m. OK MS C++ 2017 TESTS 56 2620 9625600
113538204 jonitox D April 19, 2021, 4:33 p.m. OK MS C++ 2017 TESTS 43 2636 14438400
113547195 Arnyev D April 19, 2021, 5:57 p.m. OK .NET Core C# TESTS 50 2511 103014400
113544879 sky D April 19, 2021, 5:32 p.m. OK Node.js TESTS 50 2168 92262400
113545259 sky D April 19, 2021, 5:36 p.m. OK Node.js TESTS 50 2230 85299200
113544723 sky D April 19, 2021, 5:31 p.m. OK Node.js TESTS 49 2230 102297600
113543107 sky D April 19, 2021, 5:15 p.m. OK Node.js TESTS 47 2308 85504000
113545985 sky D April 19, 2021, 5:44 p.m. OK Node.js TESTS 50 2308 90214400
113545427 sky D April 19, 2021, 5:38 p.m. OK Node.js TESTS 50 2308 90419200
113542503 pajenegod D April 19, 2021, 5:09 p.m. OK PyPy 2 TESTS 46 2183 61952000
113578480 eepsilon D April 20, 2021, 4:56 a.m. OK PyPy 3 TESTS 59 2526 47923200
113553613 titia D April 19, 2021, 7:30 p.m. OK PyPy 3 TESTS 53 2651 57344000
113574447 SF-Manman D April 20, 2021, 3:40 a.m. OK PyPy 3 TESTS 56 2729 48435200
113546060 Tashiqi D April 19, 2021, 5:45 p.m. OK PyPy 3 TESTS 50 2869 48537600
113549693 weak-chicken D April 19, 2021, 6:30 p.m. OK PyPy 3 TESTS 50 2870 43212800
113545387 EPrebet D April 19, 2021, 5:37 p.m. OK PyPy 3 TESTS 50 2885 50688000
113540436 hxu10 D April 19, 2021, 4:50 p.m. OK PyPy 3 TESTS 44 2917 50892800
113549106 hxu10 D April 19, 2021, 6:22 p.m. OK PyPy 3 TESTS 50 2947 52428800
113548946 hxu10 D April 19, 2021, 6:20 p.m. OK PyPy 3 TESTS 50 2948 53043200
113550829 weak-chicken D April 19, 2021, 6:47 p.m. OK PyPy 3 TESTS 51 2978 45977600
113538686 toomer D April 19, 2021, 4:36 p.m. OK Rust TESTS 43 2979 20480000

remove filters

Back to search problems