Codeforces Round 794 (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
1686 Codeforces Round 794 (Div. 2) FINISHED False 8100 78323099 May 25, 2022, 5:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20520 ) A Everything Everywhere All But One PROGRAMMING greedy

B'You are given an array of n integers a_1, a_2, ldots, a_n . After you watched the amazing film "Everything Everywhere All At Once", you came up with the following operation. In one operation, you choose n-1 elements of the array and replace each of them with their arithmetic mean (which doesn 't have to be an integer). For example, from the array [1, 2, 3, 1] we can get the array [2, 2, 2, 1] , if we choose the first three elements, or we can get the array [ frac{4}{3}, frac{4}{3}, 3, frac{4}{3}] , if we choose all elements except the third. Is it possible to make all elements of the array equal by performing a finite number of such operations? The first line of the input contains a single integer t ( 1 <= t <= 200 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 3 <= n <= 50 ) -- the number of integers. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 100 ). For each test case, if it is possible to make all elements equal after some number of operations, output texttt{YES} . Otherwise, output texttt{NO} . You can output texttt{YES} and texttt{NO} in any case (for example, strings texttt{yEs} , texttt{yes} , texttt{Yes} will be recognized as a positive response). In the first test case, all elements are already equal. In the second test case, you can choose all elements except the third, their average is frac{1 + 2 + 4 + 5}{4} = 3 , so the array will become [3, 3, 3, 3, 3] . It 's possible to show that it 's impossible to make all elements equal in the third and fourth test cases. '...

Tutorials

103198

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
158569745 bluemegane A May 26, 2022, 10:58 p.m. OK C# 8 TESTS 6 62 409600
158490411 tabibi A May 26, 2022, 4:56 a.m. OK C# 8 TESTS 6 93 512000
158543742 xelsink1 A May 26, 2022, 3:25 p.m. OK Clang++17 Diagnostics TESTS 6 31 3174400
158527154 fzkhzk A May 26, 2022, 12:38 p.m. OK Clang++17 Diagnostics TESTS 6 46 0
158512488 hardhardharder A May 26, 2022, 9:49 a.m. OK GNU C11 TESTS 6 15 0
158516840 Yousef_ A May 26, 2022, 10:44 a.m. OK GNU C11 TESTS 6 15 0
158550179 ahad.cse8.bu A May 26, 2022, 4:44 p.m. OK GNU C11 TESTS 6 15 0
158489839 karwalharshit A May 26, 2022, 4:46 a.m. OK GNU C11 TESTS 6 15 0
158562350 ashu2002anand A May 26, 2022, 7:32 p.m. OK GNU C11 TESTS 6 15 0
158567654 hope.s.killed A May 26, 2022, 9:40 p.m. OK GNU C11 TESTS 6 15 0
158555052 Yogender_2021505 A May 26, 2022, 5:45 p.m. OK GNU C11 TESTS 6 15 0
158492107 nrm A May 26, 2022, 5:23 a.m. OK GNU C11 TESTS 6 15 0
158500754 SP2003 A May 26, 2022, 7:17 a.m. OK GNU C11 TESTS 6 15 0
158511151 akshat211103 A May 26, 2022, 9:32 a.m. OK GNU C11 TESTS 6 15 0
158509791 Yazan_SA A May 26, 2022, 9:15 a.m. OK GNU C++14 TESTS 6 0 0
158578310 pryanshu31 A May 27, 2022, 4:07 a.m. OK GNU C++14 TESTS 6 0 0
158539159 extcfygvuhbjn A May 26, 2022, 2:41 p.m. OK GNU C++14 TESTS 6 0 0
158531893 LostStar_99 A May 26, 2022, 1:27 p.m. OK GNU C++14 TESTS 6 0 0
158527231 zhangkd3 A May 26, 2022, 12:38 p.m. OK GNU C++14 TESTS 6 0 0
158521353 fredreicc A May 26, 2022, 11:34 a.m. OK GNU C++14 TESTS 6 0 0
158521082 Cassie_Solves A May 26, 2022, 11:31 a.m. OK GNU C++14 TESTS 6 0 0
158518337 ishitgarg1231 A May 26, 2022, 11:01 a.m. OK GNU C++14 TESTS 6 0 0
158509934 MahmoudSerag A May 26, 2022, 9:17 a.m. OK GNU C++14 TESTS 6 0 0
158505460 shashank_mangal A May 26, 2022, 8:19 a.m. OK GNU C++14 TESTS 6 0 0
158583463 furiousluck A May 27, 2022, 5:54 a.m. OK GNU C++17 TESTS 6 0 0
158580510 Pangbai A May 27, 2022, 5 a.m. OK GNU C++17 TESTS 6 0 0
158577195 Darthrider212 A May 27, 2022, 3:34 a.m. OK GNU C++17 TESTS 6 0 0
158576689 anuj631 A May 27, 2022, 3:21 a.m. OK GNU C++17 TESTS 6 0 0
158572972 tarponTMR A May 27, 2022, 1:27 a.m. OK GNU C++17 TESTS 6 0 0
158572218 DapplingDot721 A May 27, 2022, 12:56 a.m. OK GNU C++17 TESTS 6 0 0
158559168 akk2000 A May 26, 2022, 6:42 p.m. OK GNU C++17 TESTS 6 0 0
158557126 sunny_02 A May 26, 2022, 6:13 p.m. OK GNU C++17 TESTS 6 0 0
158557089 the_Ouroboros A May 26, 2022, 6:12 p.m. OK GNU C++17 TESTS 6 0 0
158555930 furious__ A May 26, 2022, 5:56 p.m. OK GNU C++17 TESTS 6 0 0
158571777 euoao A May 27, 2022, 12:35 a.m. OK GNU C++17 (64) TESTS 6 0 0
158552041 rishit3234 A May 26, 2022, 5:08 p.m. OK GNU C++17 (64) TESTS 6 0 0
158552003 ninja_ankit A May 26, 2022, 5:07 p.m. OK GNU C++17 (64) TESTS 6 0 0
158544791 blue_cheetah27 A May 26, 2022, 3:38 p.m. OK GNU C++17 (64) TESTS 6 0 0
158537557 sm_shivam A May 26, 2022, 2:29 p.m. OK GNU C++17 (64) TESTS 6 0 0
158523391 vjudge1 A May 26, 2022, 11:56 a.m. OK GNU C++17 (64) TESTS 6 0 0
158523297 RoWan_Hamada A May 26, 2022, 11:55 a.m. OK GNU C++17 (64) TESTS 6 0 0
158521385 korokseeds YYYLLL2021 Laevatain A May 26, 2022, 11:34 a.m. OK GNU C++17 (64) TESTS 6 0 0
158518588 iCatOH A May 26, 2022, 11:03 a.m. OK GNU C++17 (64) TESTS 6 0 0
158518520 Akhil_Rautela A May 26, 2022, 11:03 a.m. OK GNU C++17 (64) TESTS 6 0 0
158566396 OmarNasrMohamed A May 26, 2022, 9:05 p.m. OK GNU C++20 (64) TESTS 6 0 0
158566883 Ghieath A May 26, 2022, 9:17 p.m. OK GNU C++20 (64) TESTS 6 0 0
158569800 Ali_Tarek10 A May 26, 2022, 11:01 p.m. OK GNU C++20 (64) TESTS 6 0 0
158570166 sasu2003 A May 26, 2022, 11:19 p.m. OK GNU C++20 (64) TESTS 6 0 0
158572390 kalp-77 A May 27, 2022, 1:04 a.m. OK GNU C++20 (64) TESTS 6 0 0
158573461 ASKiceLu0922 A May 27, 2022, 1:44 a.m. OK GNU C++20 (64) TESTS 6 0 0
158574981 Leonardo16 A May 27, 2022, 2:32 a.m. OK GNU C++20 (64) TESTS 6 0 0
158575121 HaccerKat A May 27, 2022, 2:36 a.m. OK GNU C++20 (64) TESTS 6 0 0
158579301 Vamshi_2503 A May 27, 2022, 4:33 a.m. OK GNU C++20 (64) TESTS 6 0 0
158581677 sine_and_cosine A May 27, 2022, 5:23 a.m. OK GNU C++20 (64) TESTS 6 0 0
158493409 camt_bot A May 26, 2022, 5:43 a.m. OK Java 11 TESTS 6 155 0
158568083 nirvana_rsc A May 26, 2022, 9:53 p.m. OK Java 11 TESTS 6 155 0
158506902 amitmandal A May 26, 2022, 8:36 a.m. OK Java 11 TESTS 6 155 0
158496165 aditya2024 A May 26, 2022, 6:19 a.m. OK Java 11 TESTS 6 155 0
158491216 Subh_Liz A May 26, 2022, 5:09 a.m. OK Java 11 TESTS 6 155 0
158491054 x21svage A May 26, 2022, 5:07 a.m. OK Java 11 TESTS 6 155 0
158488751 parascoding1 A May 26, 2022, 4:26 a.m. OK Java 11 TESTS 6 155 0
158486913 dhruvil8804 A May 26, 2022, 3:51 a.m. OK Java 11 TESTS 6 155 0
158482257 Darsh_102 A May 26, 2022, 2:10 a.m. OK Java 11 TESTS 6 155 0
158471168 srikanthreddy691 A May 25, 2022, 8:36 p.m. OK Java 11 TESTS 6 155 0
158553985 qlf9 A May 26, 2022, 5:32 p.m. OK Java 8 TESTS 6 77 0
158510885 20r11a6729 A May 26, 2022, 9:29 a.m. OK Java 8 TESTS 6 78 0
158487012 govindrajput A May 26, 2022, 3:52 a.m. OK Java 8 TESTS 6 78 0
158486771 kewosihuzuobudao A May 26, 2022, 3:48 a.m. OK Java 8 TESTS 6 78 0
158485516 Koka A May 26, 2022, 3:23 a.m. OK Java 8 TESTS 6 78 0
158518885 Zicode A May 26, 2022, 11:07 a.m. OK Java 8 TESTS 6 92 0
158478834 Kegure A May 26, 2022, 12:18 a.m. OK Java 8 TESTS 6 92 0
158570138 aswad2 A May 26, 2022, 11:18 p.m. OK Java 8 TESTS 6 93 0
158568865 Sussykin A May 26, 2022, 10:19 p.m. OK Java 8 TESTS 6 93 0
158560658 WalrusRamen21 A May 26, 2022, 7:05 p.m. OK Java 8 TESTS 6 93 0
158526183 WildTan A May 26, 2022, 12:27 p.m. OK Kotlin 1.6 TESTS 6 218 0
158480405 vvbhandare A May 26, 2022, 1:14 a.m. OK Kotlin 1.6 TESTS 6 218 0
158558231 Tangerine A May 26, 2022, 6:27 p.m. OK MS C++ 2017 TESTS 6 15 0
158548538 navin_yadav A May 26, 2022, 4:24 p.m. OK MS C++ 2017 TESTS 6 15 0
158520132 zhang_yan A May 26, 2022, 11:21 a.m. OK MS C++ 2017 TESTS 6 15 0
158537437 Lakii A May 26, 2022, 2:28 p.m. OK MS C++ 2017 TESTS 6 31 0
158472205 Damirca A May 25, 2022, 8:52 p.m. OK MS C++ 2017 TESTS 6 31 0
158526093 Kanata369 A May 26, 2022, 12:26 p.m. OK MS C++ 2017 TESTS 6 31 2457600
158538803 Inspired A May 26, 2022, 2:39 p.m. OK Node.js TESTS 6 46 614400
158486829 yoralbayev A May 26, 2022, 3:49 a.m. OK PHP TESTS 6 31 0
158516852 burita083 A May 26, 2022, 10:44 a.m. OK PyPy 3 TESTS 6 77 1433600
158496958 whatshisbucket A May 26, 2022, 6:29 a.m. OK PyPy 3 TESTS 6 77 1638400
158488764 ambs_ A May 26, 2022, 4:26 a.m. OK PyPy 3 TESTS 6 77 1638400
158556001 Milok A May 26, 2022, 5:57 p.m. OK PyPy 3 TESTS 6 92 1433600
158497323 pranay_28 A May 26, 2022, 6:33 a.m. OK PyPy 3 TESTS 6 92 1433600
158483267 rainap A May 26, 2022, 2:34 a.m. OK PyPy 3 TESTS 6 92 1433600
158490217 misorin A May 26, 2022, 4:52 a.m. OK PyPy 3 TESTS 6 92 1536000
158524346 mrSTARK007 A May 26, 2022, 12:07 p.m. OK PyPy 3 TESTS 6 93 1433600
158499844 shashwat10 A May 26, 2022, 7:05 a.m. OK PyPy 3 TESTS 6 93 1433600
158480182 JUBHAI A May 26, 2022, 1:07 a.m. OK PyPy 3 TESTS 6 93 1433600
158479044 sharingan000 A May 26, 2022, 12:26 a.m. OK PyPy 3-64 TESTS 6 61 2252800
158538861 queme A May 26, 2022, 2:39 p.m. OK PyPy 3-64 TESTS 6 61 2355200
158488186 abineth A May 26, 2022, 4:15 a.m. OK PyPy 3-64 TESTS 6 61 2457600
158479834 gustavofadel A May 26, 2022, 12:54 a.m. OK PyPy 3-64 TESTS 6 62 2252800
158549512 Maltsev_Kir A May 26, 2022, 4:36 p.m. OK PyPy 3-64 TESTS 6 62 2355200
158540327 Nan-Do A May 26, 2022, 2:51 p.m. OK PyPy 3-64 TESTS 6 62 2355200
158534948 jcai972 A May 26, 2022, 1:59 p.m. OK PyPy 3-64 TESTS 6 62 2355200
158474375 El_Gemmy A May 25, 2022, 9:39 p.m. OK PyPy 3-64 TESTS 6 62 2355200
158469565 shobonvip A May 25, 2022, 8:18 p.m. OK PyPy 3-64 TESTS 6 62 2355200
158555654 ss0507 A May 26, 2022, 5:52 p.m. OK PyPy 3-64 TESTS 6 62 2457600
158571688 LittleBoxJie A May 27, 2022, 12:30 a.m. OK Python 3 TESTS 6 30 0
158486751 vetri A May 26, 2022, 3:47 a.m. OK Python 3 TESTS 6 30 0
158481522 Ebtisam_Elahi A May 26, 2022, 1:50 a.m. OK Python 3 TESTS 6 30 0
158548157 Harsha3408 A May 26, 2022, 4:19 p.m. OK Python 3 TESTS 6 31 0
158546464 sakshisingh7 A May 26, 2022, 3:59 p.m. OK Python 3 TESTS 6 31 0
158542966 shandyabhi31 A May 26, 2022, 3:17 p.m. OK Python 3 TESTS 6 31 0
158513535 NitinArya1234 A May 26, 2022, 10:02 a.m. OK Python 3 TESTS 6 31 0
158506650 Alhambra_007 A May 26, 2022, 8:33 a.m. OK Python 3 TESTS 6 31 0
158501013 abhipandey9315 A May 26, 2022, 7:21 a.m. OK Python 3 TESTS 6 31 0
158500605 Akash2325 A May 26, 2022, 7:15 a.m. OK Python 3 TESTS 6 31 0
158516708 Death_on_2_Legs A May 26, 2022, 10:43 a.m. OK Rust 2021 TESTS 6 15 0

remove filters

Back to search problems