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 |
---|---|---|---|---|---|---|
1631 | Codeforces Round 768 (Div. 2) | FINISHED | False | 7200 | 88529099 | Jan. 27, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 20569 ) | B | Fun with Even Subarrays | PROGRAMMING | dp greedy |
B'You are given an array a of n elements. You can apply the following operation to it any number of times: For example, if a = [2, 1, 3, 4, 5, 3] , then choose l = 1 and k = 2 , applying this operation the array will become a = [3, 4, 3, 4, 5, 3] . Find the minimum number of operations (possibly zero) needed to make all the elements of the array equal. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains an integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the length of the array. The second line of each test case consists of n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q n ) -- the elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . Print t lines, each line containing the answer to the corresponding test case -- the minimum number of operations needed to make equal all the elements of the array with the given operation. In the first test, all elements are equal, therefore no operations are needed. In the second test, you can apply one operation with k=1 and l=1 , set a_1 := a_2 , and the array becomes [1, 1] with 1 operation. In the third test, you can apply one operation with k=1 and l=4 , set a_4 := a_5 , and the array becomes [4, 4, 4, 4, 4] . In the fourth test, you can apply one operation with k=1 and l=3 , set a_3 := a_4 , and the array becomes [4, 2, 3, 3] , then you can apply another operation with k=2 and l=1 , set a_1 := a_3 , a_2 := a_4 , and the array becomes [3, 3, 3, 3] . In the fifth test, there is only one element, therefore no operations are needed. '... |
Editorial of Codeforces Round #768 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
144284033 | ruban | B | Jan. 28, 2022, 5:31 a.m. | OK | FPC | TESTS | 30 | 77 | 33792000 | ||
144243170 | YOMAN39 | B | Jan. 27, 2022, 4:24 p.m. | OK | GNU C11 | TESTS | 30 | 93 | 819200 | ||
144244539 | rudransh.agarwal | B | Jan. 27, 2022, 4:27 p.m. | OK | GNU C11 | TESTS | 30 | 108 | 819200 | ||
144239710 | hnust_zhangsheng | B | Jan. 27, 2022, 4:17 p.m. | OK | GNU C11 | TESTS | 30 | 108 | 819200 | ||
144280562 | asutkarayush | B | Jan. 28, 2022, 4:41 a.m. | OK | GNU C11 | TESTS | 30 | 108 | 819200 | ||
144268014 | Murli_33 | B | Jan. 27, 2022, 10:45 p.m. | OK | GNU C11 | TESTS | 30 | 109 | 819200 | ||
144247886 | MinerAndy | B | Jan. 27, 2022, 4:34 p.m. | OK | GNU C11 | TESTS | 30 | 109 | 819200 | ||
144243670 | f0000 | B | Jan. 27, 2022, 4:25 p.m. | OK | GNU C11 | TESTS | 30 | 124 | 819200 | ||
144259411 | Nemesis2004 | B | Jan. 27, 2022, 7:22 p.m. | OK | GNU C11 | TESTS | 30 | 124 | 819200 | ||
144273112 | yybs | B | Jan. 28, 2022, 2:19 a.m. | OK | GNU C11 | TESTS | 30 | 530 | 819200 | ||
144280624 | walk_alone | B | Jan. 28, 2022, 4:43 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144279563 | AsishKumar | B | Jan. 28, 2022, 4:26 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144277884 | i_not_taukir | B | Jan. 28, 2022, 3:58 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144277309 | ShreyasTheOne | B | Jan. 28, 2022, 3:48 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144284229 | saltine_salad | B | Jan. 28, 2022, 5:34 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144283767 | Lomer | B | Jan. 28, 2022, 5:28 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144282293 | BrAin | B | Jan. 28, 2022, 5:07 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144281689 | ANTICLOCKS | B | Jan. 28, 2022, 4:58 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144281480 | sha-ily | B | Jan. 28, 2022, 4:56 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144281450 | usx21405 | B | Jan. 28, 2022, 4:55 a.m. | OK | GNU C++14 | TESTS | 30 | 46 | 819200 | ||
144245709 | hnust_zhuayang | B | Jan. 27, 2022, 4:30 p.m. | OK | GNU C++17 | TESTS | 30 | 31 | 819200 | ||
144246281 | kingmessi | B | Jan. 27, 2022, 4:31 p.m. | OK | GNU C++17 | TESTS | 30 | 31 | 819200 | ||
144286482 | Bateman.Patrick | B | Jan. 28, 2022, 6:02 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144286348 | unordered_map | B | Jan. 28, 2022, 6 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144286109 | omi_farhan | B | Jan. 28, 2022, 5:57 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144285937 | kr_vishal | B | Jan. 28, 2022, 5:55 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144285803 | vinith_katariya | B | Jan. 28, 2022, 5:54 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144285734 | vinith_katariya | B | Jan. 28, 2022, 5:53 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144285756 | Mandrake01 | B | Jan. 28, 2022, 5:53 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144285241 | PrafulSinghal | B | Jan. 28, 2022, 5:48 a.m. | OK | GNU C++17 | TESTS | 30 | 46 | 819200 | ||
144270852 | w23c3c3 | B | Jan. 28, 2022, 1:09 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144284549 | Asif732 | B | Jan. 28, 2022, 5:39 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144283063 | prathamnagpure | B | Jan. 28, 2022, 5:18 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144282318 | anhkha1004 | B | Jan. 28, 2022, 5:08 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144276865 | parth_sak12 | B | Jan. 28, 2022, 3:40 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144276180 | Z1J5Y | B | Jan. 28, 2022, 3:27 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144273787 | archit.bikram | B | Jan. 28, 2022, 2:36 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144267770 | kushagra3288 | B | Jan. 27, 2022, 10:33 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144267201 | emthrm | B | Jan. 27, 2022, 10:10 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144261852 | prasantkpatel | B | Jan. 27, 2022, 7:58 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 819200 | ||
144277515 | adityam1 | B | Jan. 28, 2022, 3:52 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144274735 | royboylab | B | Jan. 28, 2022, 2:59 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144278307 | yashp_ | B | Jan. 28, 2022, 4:05 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144279118 | anonymous_dexter | B | Jan. 28, 2022, 4:19 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144279436 | MagicQ | B | Jan. 28, 2022, 4:24 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144280833 | Dhruv_24 | B | Jan. 28, 2022, 4:46 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144281306 | viraldoshi | B | Jan. 28, 2022, 4:53 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144282123 | Dhruv_24 | B | Jan. 28, 2022, 5:05 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144282609 | himanshu222 | B | Jan. 28, 2022, 5:12 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144282801 | horizon__ | B | Jan. 28, 2022, 5:14 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 819200 | ||
144278004 | koqo | B | Jan. 28, 2022, 4 a.m. | OK | Go | TESTS | 30 | 109 | 2355200 | ||
144265441 | codelegend | B | Jan. 27, 2022, 9:16 p.m. | OK | Haskell | TESTS | 30 | 998 | 139673600 | ||
144277293 | naman5811 | B | Jan. 28, 2022, 3:48 a.m. | OK | Java 11 | TESTS | 30 | 186 | 0 | ||
144257452 | Andwerp | B | Jan. 27, 2022, 7 p.m. | OK | Java 11 | TESTS | 30 | 187 | 0 | ||
144271648 | Satyaa | B | Jan. 28, 2022, 1:37 a.m. | OK | Java 11 | TESTS | 30 | 187 | 0 | ||
144271296 | anixudh | B | Jan. 28, 2022, 1:24 a.m. | OK | Java 11 | TESTS | 30 | 187 | 0 | ||
144261673 | CrinklyGolem | B | Jan. 27, 2022, 7:55 p.m. | OK | Java 11 | TESTS | 30 | 202 | 0 | ||
144274494 | KarMa_ | B | Jan. 28, 2022, 2:53 a.m. | OK | Java 11 | TESTS | 30 | 202 | 0 | ||
144274090 | Ishwar_749 | B | Jan. 28, 2022, 2:44 a.m. | OK | Java 11 | TESTS | 30 | 202 | 0 | ||
144272026 | 17821147 | B | Jan. 28, 2022, 1:48 a.m. | OK | Java 11 | TESTS | 30 | 202 | 0 | ||
144239208 | T_Chakrawarty | B | Jan. 27, 2022, 4:16 p.m. | OK | Java 11 | TESTS | 30 | 202 | 0 | ||
144279866 | GuptaJi | B | Jan. 28, 2022, 4:31 a.m. | OK | Java 11 | TESTS | 30 | 202 | 23244800 | ||
144265141 | DEMO23 | B | Jan. 27, 2022, 9:07 p.m. | OK | Java 8 | TESTS | 30 | 109 | 0 | ||
144257197 | niknaks | B | Jan. 27, 2022, 6:57 p.m. | OK | Java 8 | TESTS | 30 | 124 | 1843200 | ||
144255057 | YahiaSherif | B | Jan. 27, 2022, 6:37 p.m. | OK | Java 8 | TESTS | 30 | 124 | 1843200 | ||
144255567 | ruchir28 | B | Jan. 27, 2022, 6:42 p.m. | OK | Java 8 | TESTS | 30 | 124 | 1945600 | ||
144247443 | gtheoden42 | B | Jan. 27, 2022, 4:33 p.m. | OK | Java 8 | TESTS | 30 | 140 | 1843200 | ||
144254675 | VishuTomar | B | Jan. 27, 2022, 6:34 p.m. | OK | Java 8 | TESTS | 30 | 140 | 1843200 | ||
144239788 | kishan963 | B | Jan. 27, 2022, 4:17 p.m. | OK | Java 8 | TESTS | 30 | 140 | 12390400 | ||
144279010 | hacker_157 | B | Jan. 28, 2022, 4:17 a.m. | OK | Java 8 | TESTS | 30 | 156 | 2560000 | ||
144261710 | SangramH123 | B | Jan. 27, 2022, 7:56 p.m. | OK | Java 8 | TESTS | 30 | 171 | 12390400 | ||
144239924 | O_E | B | Jan. 27, 2022, 4:17 p.m. | OK | Java 8 | TESTS | 30 | 171 | 12595200 | ||
144280262 | Hakiobo | B | Jan. 28, 2022, 4:37 a.m. | OK | Kotlin 1.4 | TESTS | 30 | 155 | 1024000 | ||
144283128 | shuitishashou | B | Jan. 28, 2022, 5:19 a.m. | OK | MS C++ 2017 | TESTS | 30 | 171 | 819200 | ||
144261068 | Tangerine | B | Jan. 27, 2022, 7:46 p.m. | OK | MS C++ 2017 | TESTS | 30 | 171 | 1638400 | ||
144238451 | edfearay11 | B | Jan. 27, 2022, 4:14 p.m. | OK | MS C++ 2017 | TESTS | 30 | 186 | 3276800 | ||
144277770 | mishra-aayush | B | Jan. 28, 2022, 3:56 a.m. | OK | MS C++ 2017 | TESTS | 30 | 187 | 1228800 | ||
144276252 | Ir0nic_Joker | B | Jan. 28, 2022, 3:28 a.m. | OK | MS C++ 2017 | TESTS | 30 | 202 | 819200 | ||
144244623 | n4Make | B | Jan. 27, 2022, 4:27 p.m. | OK | MS C++ 2017 | TESTS | 30 | 202 | 819200 | ||
144261255 | M7md3sam070 | B | Jan. 27, 2022, 7:49 p.m. | OK | MS C++ 2017 | TESTS | 30 | 202 | 1638400 | ||
144240913 | DikshantAvi | B | Jan. 27, 2022, 4:19 p.m. | OK | MS C++ 2017 | TESTS | 30 | 218 | 819200 | ||
144239361 | Oleja123 | B | Jan. 27, 2022, 4:16 p.m. | OK | MS C++ 2017 | TESTS | 30 | 218 | 1740800 | ||
144274183 | Tagaki | B | Jan. 28, 2022, 2:46 a.m. | OK | MS C++ 2017 | TESTS | 30 | 561 | 819200 | ||
144262664 | tabibi | B | Jan. 27, 2022, 8:14 p.m. | OK | .NET Core C# | TESTS | 30 | 187 | 16486400 | ||
144274241 | Salamander_ | B | Jan. 28, 2022, 2:47 a.m. | OK | Node.js | TESTS | 30 | 265 | 14336000 | ||
144276520 | 1_2_3_4_5_9 | B | Jan. 28, 2022, 3:33 a.m. | OK | PyPy 2 | TESTS | 30 | 124 | 15564800 | ||
144257443 | Aksnov | B | Jan. 27, 2022, 7 p.m. | OK | PyPy 3 | TESTS | 30 | 140 | 14848000 | ||
144261217 | ACoder_25 | B | Jan. 27, 2022, 7:48 p.m. | OK | PyPy 3 | TESTS | 30 | 140 | 15769600 | ||
144280913 | Preetmodh_13 | B | Jan. 28, 2022, 4:47 a.m. | OK | PyPy 3 | TESTS | 30 | 171 | 16281600 | ||
144256146 | tarun_aren | B | Jan. 27, 2022, 6:47 p.m. | OK | PyPy 3 | TESTS | 30 | 202 | 15667200 | ||
144259604 | Dre_Russ | B | Jan. 27, 2022, 7:24 p.m. | OK | PyPy 3 | TESTS | 30 | 202 | 15769600 | ||
144259289 | Dre_Russ | B | Jan. 27, 2022, 7:20 p.m. | OK | PyPy 3 | TESTS | 30 | 202 | 15769600 | ||
144286240 | ON_THE_EDGE | B | Jan. 28, 2022, 5:58 a.m. | OK | PyPy 3 | TESTS | 30 | 202 | 15974400 | ||
144285356 | misorin | B | Jan. 28, 2022, 5:49 a.m. | OK | PyPy 3 | TESTS | 30 | 217 | 15667200 | ||
144254521 | Ayushman_123 | B | Jan. 27, 2022, 6:33 p.m. | OK | PyPy 3 | TESTS | 30 | 265 | 19148800 | ||
144239264 | Mr._Oogway | B | Jan. 27, 2022, 4:16 p.m. | OK | PyPy 3 | TESTS | 30 | 343 | 19148800 | ||
144258658 | lemiao12 | B | Jan. 27, 2022, 7:13 p.m. | OK | PyPy 3-64 | TESTS | 30 | 124 | 22118400 | ||
144280645 | mayank35 | B | Jan. 28, 2022, 4:43 a.m. | OK | PyPy 3-64 | TESTS | 30 | 140 | 20992000 | ||
144262417 | Multibala | B | Jan. 27, 2022, 8:08 p.m. | OK | PyPy 3-64 | TESTS | 30 | 171 | 24166400 | ||
144240002 | epoweripi | B | Jan. 27, 2022, 4:17 p.m. | OK | PyPy 3-64 | TESTS | 30 | 186 | 24780800 | ||
144279990 | Code_Breaker101 | B | Jan. 28, 2022, 4:33 a.m. | OK | PyPy 3-64 | TESTS | 30 | 202 | 21708800 | ||
144255433 | AbnerShen | B | Jan. 27, 2022, 6:40 p.m. | OK | PyPy 3-64 | TESTS | 30 | 202 | 24985600 | ||
144254896 | titia | B | Jan. 27, 2022, 6:36 p.m. | OK | PyPy 3-64 | TESTS | 30 | 202 | 25497600 | ||
144274697 | aman404found | B | Jan. 28, 2022, 2:58 a.m. | OK | PyPy 3-64 | TESTS | 30 | 233 | 25190400 | ||
144278609 | sakshatmali | B | Jan. 28, 2022, 4:11 a.m. | OK | PyPy 3-64 | TESTS | 30 | 311 | 26726400 | ||
144271781 | DippleThree | B | Jan. 28, 2022, 1:41 a.m. | OK | PyPy 3-64 | TESTS | 30 | 358 | 18944000 | ||
144255776 | OLOGY | B | Jan. 27, 2022, 6:44 p.m. | OK | Python 2 | TESTS | 30 | 140 | 12492800 | ||
144268592 | OLOGY | B | Jan. 27, 2022, 11:17 p.m. | OK | Python 2 | TESTS | 30 | 156 | 12492800 | ||
144279196 | Dahoas | B | Jan. 28, 2022, 4:20 a.m. | OK | Python 3 | TESTS | 30 | 124 | 13824000 | ||
144277640 | mkawa2 | B | Jan. 28, 2022, 3:54 a.m. | OK | Python 3 | TESTS | 30 | 124 | 14233600 | ||
144272312 | Nams_95 | B | Jan. 28, 2022, 1:57 a.m. | OK | Python 3 | TESTS | 30 | 140 | 14233600 | ||
144242359 | oneku | B | Jan. 27, 2022, 4:23 p.m. | OK | Python 3 | TESTS | 30 | 155 | 14233600 | ||
144260318 | jayeshkumavat42 | B | Jan. 27, 2022, 7:35 p.m. | OK | Python 3 | TESTS | 30 | 156 | 14233600 | ||
144255764 | vadlamani19100 | B | Jan. 27, 2022, 6:44 p.m. | OK | Python 3 | TESTS | 30 | 249 | 14233600 | ||
144255060 | utukphd | B | Jan. 27, 2022, 6:37 p.m. | OK | Python 3 | TESTS | 30 | 264 | 13926400 | ||
144284973 | sbs2001 | B | Jan. 28, 2022, 5:44 a.m. | OK | Python 3 | TESTS | 30 | 264 | 14233600 | ||
144256060 | C-12 | B | Jan. 27, 2022, 6:47 p.m. | OK | Python 3 | TESTS | 30 | 264 | 14233600 | ||
144254826 | himadribhakta | B | Jan. 27, 2022, 6:35 p.m. | OK | Python 3 | TESTS | 30 | 264 | 14233600 | ||
144271043 | Spheniscine | B | Jan. 28, 2022, 1:16 a.m. | OK | Rust 2021 | TESTS | 30 | 31 | 921600 | ||
144270910 | Spheniscine | B | Jan. 28, 2022, 1:11 a.m. | OK | Rust 2021 | TESTS | 30 | 31 | 921600 |
Back to search problems