Educational Codeforces Round 164 (Rated for 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
1954 Educational Codeforces Round 164 (Rated for Div. 2) FINISHED False 7200 18890699 April 12, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18654 ) B Make It Ugly PROGRAMMING implementation math

B"Let's call an array a beautiful if you can make all its elements the same by using the following operation an arbitrary number of times (possibly, zero): You are given a beautiful array a_1, a_2, ... , a_n . What is the minimum number of elements you have to remove from it in order for it to stop being beautiful? Swapping elements is prohibited. If it is impossible to do so, then output -1. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 3 cdot 10^5 ). The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ). Additional constraints on the input: For each test case, output a single integer -- the minimum number of elements you have to remove from the array a in order for it to stop being beautiful. If it is impossible, then output -1. In the first testcase, it is impossible to modify the array in such a way that it stops being beautiful. An array consisting of identical numbers will remain beautiful no matter how many numbers we remove from it. In the second testcase, you can remove the number at the index 5 , for example. The resulting array will be [1, 2, 1, 2] . Let's check if it is beautiful. Two operations are available: Thus, the array [1, 2, 1, 2] is not beautiful. In the fourth testcase, you can remove the first three elements, for example. The resulting array [5, 3, 3, 3] is not beautiful. "...

Tutorials

Educational Codeforces Round 164 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
256399947 karamkontar B April 13, 2024, 3:27 a.m. OK C# 10 TESTS 4 202 29696000
256368736 expertcoderhk B April 12, 2024, 6:30 p.m. OK C++14 (GCC 6-32) TESTS 4 62 0
256398816 negetive_iq B April 13, 2024, 3:08 a.m. OK C++14 (GCC 6-32) TESTS 4 77 0
256381316 TanishqChauhan8 B April 12, 2024, 8:51 p.m. OK C++14 (GCC 6-32) TESTS 4 78 0
256363241 dark_horse_029 B April 12, 2024, 5:43 p.m. OK C++14 (GCC 6-32) TESTS 4 78 1228800
256353350 LDM0116 B April 12, 2024, 4:39 p.m. OK C++14 (GCC 6-32) TESTS 4 92 1228800
256397319 _mirupi. B April 13, 2024, 2:40 a.m. OK C++14 (GCC 6-32) TESTS 4 93 0
256408834 hem_patel_02 B April 13, 2024, 5:34 a.m. OK C++14 (GCC 6-32) TESTS 4 93 0
256406327 Friday_night B April 13, 2024, 5:04 a.m. OK C++14 (GCC 6-32) TESTS 4 93 0
256395963 Monir-Hossain B April 13, 2024, 2:13 a.m. OK C++14 (GCC 6-32) TESTS 4 93 0
256385766 satoru.gojo B April 12, 2024, 10:03 p.m. OK C++14 (GCC 6-32) TESTS 4 93 0
256363153 Arvi_saleque B April 12, 2024, 5:42 p.m. OK C++17 (GCC 7-32) TESTS 4 61 0
256360375 trodrigueza B April 12, 2024, 5:19 p.m. OK C++17 (GCC 7-32) TESTS 4 62 0
256403013 Dreadwing B April 13, 2024, 4:14 a.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256411131 Lechaa009 B April 13, 2024, 6 a.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256409220 Junaid. B April 13, 2024, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256399458 simonsimple305 B April 13, 2024, 3:18 a.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256389806 signorino B April 12, 2024, 11:39 p.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256383972 spacedate_xacs B April 12, 2024, 9:32 p.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256381780 MohamedG4 B April 12, 2024, 8:57 p.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256379983 Kunal_Kashyap B April 12, 2024, 8:32 p.m. OK C++17 (GCC 7-32) TESTS 4 77 0
256394597 Dr.Alfred B April 13, 2024, 1:43 a.m. OK C++20 (GCC 13-64) TESTS 4 46 1228800
256403500 lansan69 B April 13, 2024, 4:22 a.m. OK C++20 (GCC 13-64) TESTS 4 61 0
256376356 Anybub B April 12, 2024, 7:49 p.m. OK C++20 (GCC 13-64) TESTS 4 61 0
256366912 mogamal17 B April 12, 2024, 6:14 p.m. OK C++20 (GCC 13-64) TESTS 4 61 0
256391656 Saptak3315 B April 13, 2024, 12:31 a.m. OK C++20 (GCC 13-64) TESTS 4 62 0
256371383 Enhanced. B April 12, 2024, 6:55 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
256381910 _ABDO_ B April 12, 2024, 8:59 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
256369226 ShahdMazen B April 12, 2024, 6:35 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
256410887 Naikwad27 B April 13, 2024, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 4 62 0
256409291 scotchtape B April 13, 2024, 5:39 a.m. OK C++20 (GCC 13-64) TESTS 4 62 0
256393008 bluemegane B April 13, 2024, 1:07 a.m. OK C# 8 TESTS 4 156 29388800
256361505 tkddn5623 B April 12, 2024, 5:28 p.m. OK GNU C11 TESTS 4 77 1638400
256361625 tkddn5623 B April 12, 2024, 5:29 p.m. OK GNU C11 TESTS 4 93 1638400
256364194 mobrei B April 12, 2024, 5:50 p.m. OK GNU C11 TESTS 4 108 1228800
256363905 aa122ws2 B April 12, 2024, 5:48 p.m. OK GNU C11 TESTS 4 109 1228800
256363979 Ashar-Usmani B April 12, 2024, 5:48 p.m. OK GNU C11 TESTS 4 140 1228800
256365102 prsto_pavel B April 12, 2024, 5:58 p.m. OK Go TESTS 4 1484 6348800
256378720 Kenzhezhan B April 12, 2024, 8:14 p.m. OK Java 21 TESTS 4 202 0
256384111 SD125 B April 12, 2024, 9:34 p.m. OK Java 21 TESTS 4 265 3788800
256360114 amigomaster B April 12, 2024, 5:17 p.m. OK Java 21 TESTS 4 265 5017600
256360185 saksham294 B April 12, 2024, 5:18 p.m. OK Java 21 TESTS 4 280 6553600
256368033 Tjha B April 12, 2024, 6:24 p.m. OK Java 21 TESTS 4 281 3072000
256352894 mohit1510 B April 12, 2024, 4:37 p.m. OK Java 21 TESTS 4 296 3584000
256405551 powervic08 B April 13, 2024, 4:54 a.m. OK Java 21 TESTS 4 296 3788800
256370907 raja1102 B April 12, 2024, 6:50 p.m. OK Java 21 TESTS 4 296 3788800
256406750 mdasifhu B April 13, 2024, 5:09 a.m. OK Java 21 TESTS 4 296 4403200
256367881 mayank.nichlani22 B April 12, 2024, 6:22 p.m. OK Java 21 TESTS 4 296 4608000
256408226 ILoveBitches B April 13, 2024, 5:27 a.m. OK Java 8 TESTS 4 155 9318400
256372349 pranavpatil9876 B April 12, 2024, 7:04 p.m. OK Java 8 TESTS 4 187 11878400
256350972 y_a_s B April 12, 2024, 4:32 p.m. OK Java 8 TESTS 4 187 11980800
256407080 bommidilaxman1017 B April 13, 2024, 5:13 a.m. OK Java 8 TESTS 4 187 12083200
256375980 Sumitsingh7 B April 12, 2024, 7:44 p.m. OK Java 8 TESTS 4 202 8499200
256357730 Yousef_Badr B April 12, 2024, 5:02 p.m. OK Java 8 TESTS 4 202 11878400
256352608 vrishabshetty B April 12, 2024, 4:36 p.m. OK Java 8 TESTS 4 202 15360000
256410739 kasiru_69 B April 13, 2024, 5:56 a.m. OK Java 8 TESTS 4 233 12083200
256396729 hanekaeru B April 13, 2024, 2:29 a.m. OK Java 8 TESTS 4 234 12902400
256363195 Safawt B April 12, 2024, 5:42 p.m. OK Java 8 TESTS 4 234 24678400
256351347 Ramamoorthy B April 12, 2024, 4:33 p.m. OK Kotlin 1.9 TESTS 4 390 26726400
256352228 seif_karoui B April 12, 2024, 4:34 p.m. OK Kotlin 1.9 TESTS 4 656 2457600
256373331 swapnil_diganta B April 12, 2024, 7:14 p.m. OK PHP TESTS 4 109 46182400
256370752 jvatsal0709 B April 12, 2024, 6:49 p.m. OK PyPy 3 TESTS 4 280 20992000
256391471 rasheed_ashen_one B April 13, 2024, 12:25 a.m. OK PyPy 3 TESTS 4 280 23449600
256360927 Kefrov B April 12, 2024, 5:24 p.m. OK PyPy 3 TESTS 4 405 21913600
256382702 masterWaiter B April 12, 2024, 9:10 p.m. OK PyPy 3 TESTS 4 421 21811200
256362004 Samyak_15 B April 12, 2024, 5:32 p.m. OK PyPy 3 TESTS 4 437 22220800
256349217 _oO_Oo_ B April 12, 2024, 4:29 p.m. OK PyPy 3 TESTS 4 530 18636800
256390573 MaxValgen_ B April 13, 2024, midnight OK PyPy 3-64 TESTS 4 140 29593600
256352239 Repsaj21o B April 12, 2024, 4:34 p.m. OK PyPy 3-64 TESTS 4 140 30208000
256355963 RobinFromTheHood B April 12, 2024, 4:51 p.m. OK PyPy 3-64 TESTS 4 140 35635200
256402989 voicon B April 13, 2024, 4:14 a.m. OK PyPy 3-64 TESTS 4 155 29593600
256356916 Tinky1224 B April 12, 2024, 4:57 p.m. OK PyPy 3-64 TESTS 4 155 30208000
256398886 Nullz B April 13, 2024, 3:09 a.m. OK PyPy 3-64 TESTS 4 156 39526400
256394657 MdAshrafuzzaman_Sunny02 B April 13, 2024, 1:45 a.m. OK PyPy 3-64 TESTS 4 156 39731200
256404423 master_JD B April 13, 2024, 4:37 a.m. OK PyPy 3-64 TESTS 4 171 29491200
256361424 OmarMoBadr B April 12, 2024, 5:28 p.m. OK PyPy 3-64 TESTS 4 171 31334400
256361036 yertugan06 B April 12, 2024, 5:24 p.m. OK PyPy 3-64 TESTS 4 171 33689600
256377860 eugalt B April 12, 2024, 8:05 p.m. OK Python 3 TESTS 4 125 29286400
256363067 spoofy_rAnsomWARe B April 12, 2024, 5:41 p.m. OK Python 3 TESTS 4 155 37273600
256368486 Pythonnoob B April 12, 2024, 6:28 p.m. OK Python 3 TESTS 4 156 25804800
256374182 eugalt B April 12, 2024, 7:23 p.m. OK Python 3 TESTS 4 156 29798400
256349721 snehasahu B April 12, 2024, 4:30 p.m. OK Python 3 TESTS 4 171 36556800
256362664 sakshamt24 B April 12, 2024, 5:38 p.m. OK Python 3 TESTS 4 171 37273600
256352874 HACKERCRECKER B April 12, 2024, 4:37 p.m. OK Python 3 TESTS 4 186 36556800
256356937 saikiranreddymekala28 B April 12, 2024, 4:57 p.m. OK Python 3 TESTS 4 186 37683200
256372121 Imran32 B April 12, 2024, 7:02 p.m. OK Python 3 TESTS 4 187 36454400
256359830 OLOGY B April 12, 2024, 5:15 p.m. OK Python 3 TESTS 4 187 36556800
256358654 0x81 B April 12, 2024, 5:08 p.m. OK Ruby 3 TESTS 4 499 33280000
256351417 toor B April 12, 2024, 4:33 p.m. OK Rust 2021 TESTS 4 62 5734400
256399367 gkawa B April 13, 2024, 3:17 a.m. OK Rust 2021 TESTS 4 93 102400

remove filters

Back to search problems