Codeforces Round 896 (Div. 1)

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
1868 Codeforces Round 896 (Div. 1) FINISHED False 9000 42825263 Sept. 10, 2023, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7225 ) B1 Candy Party (Easy Version) PROGRAMMING bitmasks constructive algorithms graphs greedy implementation math

B'This is the easy version of the problem. The only difference is that in this version everyone must give candies to exactly one person and receive candies from exactly one person. Note that a submission cannot pass both versions of the problem at the same time. You can make hacks only if both versions of the problem are solved. After Zhongkao examination, Daniel and his friends are going to have a party. Everyone will come with some candies. There will be n people at the party. Initially, the i -th person has a_i candies. During the party, they will swap their candies. To do this, they will line up in an arbitrary order and everyone will do the following exactly once: Daniel likes fairness, so he will be happy if and only if everyone receives candies from exactly one person. Meanwhile, his friend Tom likes average, so he will be happy if and only if all the people have the same number of candies after all swaps. Determine whether there exists a way to swap candies, so that both Daniel and Tom will be happy after the swaps. The first line of input contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of people at the party. The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 1 <= a_i <= 10^9 ) -- the number of candies each person has. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print "Yes" (without quotes) if exists a way to swap candies to make both Daniel and Tom happy, and print "No" (without quotes) otherwise. You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses. In the first test case: Then all people have 3 candies. In the second test case: '...

Tutorials

Codeforces Round 896 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
222762241 mban259 B1 Sept. 10, 2023, 3:04 p.m. OK C# 10 TESTS 57 186 22118400
222739396 KumaTachiRen B1 Sept. 10, 2023, 2:27 p.m. OK C# 8 TESTS 57 218 4198400
222740682 hos.lyric B1 Sept. 10, 2023, 2:28 p.m. OK D TESTS 57 109 13516800
222742985 Gassa B1 Sept. 10, 2023, 2:32 p.m. OK D TESTS 57 187 13619200
222747199 DeaphetS B1 Sept. 10, 2023, 2:38 p.m. OK GNU C++14 TESTS 57 62 819200
222839139 XZC__Bobby B1 Sept. 11, 2023, 12:25 a.m. OK GNU C++14 TESTS 57 62 921600
222759529 Leasier B1 Sept. 10, 2023, 2:59 p.m. OK GNU C++14 TESTS 57 62 3174400
222762719 Gorou B1 Sept. 10, 2023, 3:05 p.m. OK GNU C++14 TESTS 57 77 819200
222750321 MCPlayer542 B1 Sept. 10, 2023, 2:44 p.m. OK GNU C++14 TESTS 57 77 819200
222746428 meteor_shower B1 Sept. 10, 2023, 2:37 p.m. OK GNU C++14 TESTS 57 77 819200
222742513 KevinYao B1 Sept. 10, 2023, 2:31 p.m. OK GNU C++14 TESTS 57 77 819200
222771488 Lucky-Xiang B1 Sept. 10, 2023, 3:23 p.m. OK GNU C++14 TESTS 57 77 921600
222840067 wdnmdwrnmmp B1 Sept. 11, 2023, 12:46 a.m. OK GNU C++14 TESTS 57 77 1638400
222762727 SuperJ6 B1 Sept. 10, 2023, 3:05 p.m. OK GNU C++14 TESTS 57 77 1638400
222839947 TeasingMaster B1 Sept. 11, 2023, 12:43 a.m. OK GNU C++17 TESTS 57 31 1843200
222773789 Natsuzora B1 Sept. 10, 2023, 3:28 p.m. OK GNU C++17 TESTS 57 62 819200
222746119 SongC B1 Sept. 10, 2023, 2:37 p.m. OK GNU C++17 TESTS 57 62 819200
222739471 leinad2 B1 Sept. 10, 2023, 2:27 p.m. OK GNU C++17 TESTS 57 62 819200
222740638 Rewenix B1 Sept. 10, 2023, 2:28 p.m. OK GNU C++17 TESTS 57 62 1740800
222839515 sha7dow B1 Sept. 11, 2023, 12:34 a.m. OK GNU C++17 TESTS 57 77 819200
222790555 Maezra6 B1 Sept. 10, 2023, 4:01 p.m. OK GNU C++17 TESTS 57 77 819200
222763673 dyxx B1 Sept. 10, 2023, 3:07 p.m. OK GNU C++17 TESTS 57 77 819200
222761657 patou B1 Sept. 10, 2023, 3:03 p.m. OK GNU C++17 TESTS 57 77 819200
222760638 _Rebellion B1 Sept. 10, 2023, 3:01 p.m. OK GNU C++17 TESTS 57 77 819200
222745079 hydro-bot3 B1 Sept. 10, 2023, 2:35 p.m. OK GNU C++17 (64) TESTS 57 31 819200
222833949 Sana B1 Sept. 10, 2023, 10:02 p.m. OK GNU C++17 (64) TESTS 57 46 819200
222829891 enslaved B1 Sept. 10, 2023, 8:46 p.m. OK GNU C++17 (64) TESTS 57 46 819200
222808128 awesomeguy856 B1 Sept. 10, 2023, 5:18 p.m. OK GNU C++17 (64) TESTS 57 46 819200
222799756 marcOS B1 Sept. 10, 2023, 4:23 p.m. OK GNU C++17 (64) TESTS 57 46 819200
222757088 demian123 B1 Sept. 10, 2023, 2:55 p.m. OK GNU C++17 (64) TESTS 57 46 819200
222811114 kotatsugame B1 Sept. 10, 2023, 5:37 p.m. OK GNU C++17 (64) TESTS 57 46 1024000
222762845 SmolBrain B1 Sept. 10, 2023, 3:05 p.m. OK GNU C++17 (64) TESTS 57 46 1638400
222750643 Xellos B1 Sept. 10, 2023, 2:44 p.m. OK GNU C++17 (64) TESTS 57 46 1638400
222750385 natsugiri B1 Sept. 10, 2023, 2:44 p.m. OK GNU C++17 (64) TESTS 57 46 1638400
222751113 maspy B1 Sept. 10, 2023, 2:45 p.m. OK GNU C++20 (64) TESTS 57 31 1638400
222748751 shiomusubi496 B1 Sept. 10, 2023, 2:41 p.m. OK GNU C++20 (64) TESTS 57 31 1638400
222759019 cmk666 B1 Sept. 10, 2023, 2:58 p.m. OK GNU C++20 (64) TESTS 57 31 2867200
222800516 Sakuyalove B1 Sept. 10, 2023, 4:25 p.m. OK GNU C++20 (64) TESTS 57 31 6348800
222848212 immccn123 B1 Sept. 11, 2023, 3:36 a.m. OK GNU C++20 (64) TESTS 57 46 819200
222843057 lllei B1 Sept. 11, 2023, 1:52 a.m. OK GNU C++20 (64) TESTS 57 46 819200
222840144 Ckcyi B1 Sept. 11, 2023, 12:47 a.m. OK GNU C++20 (64) TESTS 57 46 819200
222827678 eshbak-khay B1 Sept. 10, 2023, 8:15 p.m. OK GNU C++20 (64) TESTS 57 46 819200
222814645 apoorv_me B1 Sept. 10, 2023, 6:04 p.m. OK GNU C++20 (64) TESTS 57 46 819200
222794643 red_tree B1 Sept. 10, 2023, 4:11 p.m. OK GNU C++20 (64) TESTS 57 46 819200
222819165 Platinumda B1 Sept. 10, 2023, 6:41 p.m. OK Go TESTS 57 124 5017600
222846113 WORTH B1 Sept. 11, 2023, 2:53 a.m. OK Java 11 TESTS 57 234 0
222763061 profchi B1 Sept. 10, 2023, 3:06 p.m. OK Java 11 TESTS 57 296 7987200
222853262 upadhyaytushar552 B1 Sept. 11, 2023, 5:02 a.m. OK Java 17 TESTS 57 312 1536000
222756222 lemon_codes B1 Sept. 10, 2023, 2:53 p.m. OK Java 17 TESTS 57 312 1536000
222753489 golions B1 Sept. 10, 2023, 2:49 p.m. OK Java 8 TESTS 57 202 3993600
222796689 cc4414 B1 Sept. 10, 2023, 4:16 p.m. OK Java 8 TESTS 57 218 4096000
222812102 yvbf B1 Sept. 10, 2023, 5:44 p.m. OK Java 8 TESTS 57 420 26624000
222757560 rowechen B1 Sept. 10, 2023, 2:56 p.m. OK Java 8 TESTS 57 592 107929600
222751845 RMA-NB B1 Sept. 10, 2023, 2:46 p.m. OK Java 8 TESTS 57 623 3276800
222735396 FastFreeTask B1 Sept. 10, 2023, 2:21 p.m. OK Kotlin 1.6 TESTS 57 234 614400
222779431 Timonnable B1 Sept. 10, 2023, 3:40 p.m. OK MS C++ 2017 TESTS 57 280 3276800
222733517 bcollet B1 Sept. 10, 2023, 2:19 p.m. OK PyPy 2 TESTS 57 607 22630400
222744306 SPD_9X2 B1 Sept. 10, 2023, 2:34 p.m. OK PyPy 3 TESTS 57 577 19046400
222812769 sushmanth.dampur8780 B1 Sept. 10, 2023, 5:49 p.m. OK PyPy 3-64 TESTS 57 140 27340800
222740370 whatshisbucket B1 Sept. 10, 2023, 2:28 p.m. OK PyPy 3-64 TESTS 57 140 29388800
222766347 thewaxmango B1 Sept. 10, 2023, 3:12 p.m. OK PyPy 3-64 TESTS 57 155 27238400
222814552 codicon B1 Sept. 10, 2023, 6:03 p.m. OK PyPy 3-64 TESTS 57 155 28467200
222751166 yupooh B1 Sept. 10, 2023, 2:45 p.m. OK PyPy 3-64 TESTS 57 155 29798400
222753226 misorin B1 Sept. 10, 2023, 2:48 p.m. OK PyPy 3-64 TESTS 57 155 32256000
222748774 dyppp B1 Sept. 10, 2023, 2:41 p.m. OK PyPy 3-64 TESTS 57 217 30822400
222771996 petamingks B1 Sept. 10, 2023, 3:24 p.m. OK PyPy 3-64 TESTS 57 218 28467200
222765218 alexwice B1 Sept. 10, 2023, 3:10 p.m. OK PyPy 3-64 TESTS 57 233 29491200
222753778 tamato B1 Sept. 10, 2023, 2:49 p.m. OK PyPy 3-64 TESTS 57 234 43622400
222746061 Jimanbanashi B1 Sept. 10, 2023, 2:37 p.m. OK Python 2 TESTS 57 280 11468800
222854103 prashastha_11 B1 Sept. 11, 2023, 5:14 a.m. OK Python 3 TESTS 57 374 27340800
222752491 shade34 B1 Sept. 10, 2023, 2:47 p.m. OK Python 3 TESTS 57 389 27340800
222752464 WaterColor2037 B1 Sept. 10, 2023, 2:47 p.m. OK Rust 2021 TESTS 57 46 4812800

remove filters

Back to search problems