Codeforces Round 859 (Div. 4)

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
1807 Codeforces Round 859 (Div. 4) FINISHED False 8100 52585499 March 19, 2023, 2:55 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 42532 ) B Grab the Candies PROGRAMMING greedy

B'Mihai and Bianca are playing with bags of candies. They have a row a of n bags of candies. The i -th bag has a_i candies. The bags are given to the players in the order from the first bag to the n -th bag. If a bag has an even number of candies, Mihai grabs the bag. Otherwise, Bianca grabs the bag. Once a bag is grabbed, the number of candies in it gets added to the total number of candies of the player that took it. Mihai wants to show off, so he wants to reorder the array so that at any moment (except at the start when they both have no candies), Mihai will have strictly more candies than Bianca. Help Mihai find out if such a reordering exists. The first line of the input contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 100 ) -- the number of bags in the array. The second line of each test case contains n space-separated integers a_i ( 1 <= q a_i <= q 100 ) -- the number of candies in each bag. For each test case, output "YES" (without quotes) if such a reordering exists, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer). In the first test case, Mihai can reorder the array as follows: [4, 1, 2, 3] . Then the process proceeds as follows: '...

Tutorials

114143

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
198262568 Kissama B March 19, 2023, 5:53 p.m. OK C# 10 TESTS 3 46 2969600
198289544 nksammirPL B March 19, 2023, 11:02 p.m. OK C# 10 TESTS 3 46 3072000
198305234 anau11 B March 20, 2023, 3:37 a.m. OK C# 8 TESTS 3 77 2969600
198289160 bluemegane B March 19, 2023, 10:53 p.m. OK C# 8 TESTS 3 77 3072000
198311269 Han_Ji-pyeong B March 20, 2023, 4:59 a.m. OK Clang++17 Diagnostics TESTS 3 31 0
198312928 klu_2100031241 B March 20, 2023, 5:19 a.m. OK Clang++17 Diagnostics TESTS 3 233 0
198304943 mohammed48 B March 20, 2023, 3:32 a.m. OK Clang++17 Diagnostics TESTS 3 234 0
198271994 kumararnab0342 B March 19, 2023, 6:56 p.m. OK Clang++17 Diagnostics TESTS 3 249 4198400
198299801 PHANHUUTUANKIET B March 20, 2023, 1:52 a.m. OK Clang++20 Diagnostics TESTS 3 31 0
198270524 3nteel_Handasa B March 19, 2023, 6:44 p.m. OK Clang++20 Diagnostics TESTS 3 202 0
198292059 yxyxyx B March 20, 2023, 12:05 a.m. OK Clang++20 Diagnostics TESTS 3 233 0
198289186 v12hwas B March 19, 2023, 10:54 p.m. OK Clang++20 Diagnostics TESTS 3 234 0
198302054 Fazley_Elahi B March 20, 2023, 2:39 a.m. OK Clang++20 Diagnostics TESTS 3 249 0
198299351 FST_Forces B March 20, 2023, 1:42 a.m. OK FPC TESTS 3 15 0
198272039 shark1992 B March 19, 2023, 6:57 p.m. OK GNU C11 TESTS 3 15 0
198265002 ahsanhabibsadik123 B March 19, 2023, 6:07 p.m. OK GNU C11 TESTS 3 15 0
198301737 Anwar38a B March 20, 2023, 2:33 a.m. OK GNU C11 TESTS 3 15 0
198307334 2100030977cseh B March 20, 2023, 4:09 a.m. OK GNU C11 TESTS 3 15 0
198274827 SheikhGalib B March 19, 2023, 7:21 p.m. OK GNU C11 TESTS 3 15 0
198265374 gandour B March 19, 2023, 6:09 p.m. OK GNU C11 TESTS 3 30 0
198304612 MDKhairulHasan B March 20, 2023, 3:26 a.m. OK GNU C11 TESTS 3 31 0
198277963 maruf_bro B March 19, 2023, 7:53 p.m. OK GNU C11 TESTS 3 31 0
198302332 sliverthu B March 20, 2023, 2:45 a.m. OK GNU C11 TESTS 3 31 0
198307825 FatinShadab B March 20, 2023, 4:17 a.m. OK GNU C11 TESTS 3 31 0
198302414 zy777 B March 20, 2023, 2:46 a.m. OK GNU C++14 TESTS 3 0 0
198286001 JustJie B March 19, 2023, 9:45 p.m. OK GNU C++14 TESTS 3 0 102400
198293962 malan_c B March 20, 2023, 12:53 a.m. OK GNU C++14 TESTS 3 15 0
198307241 richroy07 B March 20, 2023, 4:07 a.m. OK GNU C++14 TESTS 3 15 0
198308723 _wh B March 20, 2023, 4:29 a.m. OK GNU C++14 TESTS 3 15 0
198314694 CoolLife B March 20, 2023, 5:40 a.m. OK GNU C++14 TESTS 3 15 0
198311575 panubhav0112 B March 20, 2023, 5:03 a.m. OK GNU C++14 TESTS 3 15 0
198313561 AbrarTo_o B March 20, 2023, 5:27 a.m. OK GNU C++14 TESTS 3 15 0
198300124 l.felicity B March 20, 2023, 1:59 a.m. OK GNU C++14 TESTS 3 15 0
198299947 wsyhb B March 20, 2023, 1:55 a.m. OK GNU C++14 TESTS 3 15 0
198301193 Outsider33 B March 20, 2023, 2:21 a.m. OK GNU C++17 TESTS 3 0 0
198295252 GPR B March 20, 2023, 1:23 a.m. OK GNU C++17 TESTS 3 0 0
198287748 OmarAlzakout B March 19, 2023, 10:22 p.m. OK GNU C++17 TESTS 3 0 0
198274853 babis B March 19, 2023, 7:22 p.m. OK GNU C++17 TESTS 3 0 0
198306133 Lorq B March 20, 2023, 3:51 a.m. OK GNU C++17 TESTS 3 0 0
198316245 kaitokid2811 B March 20, 2023, 5:59 a.m. OK GNU C++17 TESTS 3 0 0
198311783 samulokito14 B March 20, 2023, 5:05 a.m. OK GNU C++17 TESTS 3 0 0
198265427 Atharva_2152 B March 19, 2023, 6:09 p.m. OK GNU C++17 TESTS 3 0 102400
198314457 brongulus B March 20, 2023, 5:38 a.m. OK GNU C++17 TESTS 3 0 102400
198276170 abdallah_emad B March 19, 2023, 7:34 p.m. OK GNU C++17 TESTS 3 0 204800
198306714 Rifat777 B March 20, 2023, 4 a.m. OK GNU C++17 (64) TESTS 3 0 0
198305087 vioalbert B March 20, 2023, 3:34 a.m. OK GNU C++17 (64) TESTS 3 0 0
198265618 TAM B March 19, 2023, 6:11 p.m. OK GNU C++17 (64) TESTS 3 0 0
198299050 mnecoea B March 20, 2023, 1:35 a.m. OK GNU C++17 (64) TESTS 3 0 0
198286546 AGG B March 19, 2023, 9:57 p.m. OK GNU C++17 (64) TESTS 3 0 0
198288699 harshikeshbhadaniya B March 19, 2023, 10:44 p.m. OK GNU C++17 (64) TESTS 3 0 102400
198303130 Sakif B March 20, 2023, 2:59 a.m. OK GNU C++17 (64) TESTS 3 15 0
198306177 youmi_45 B March 20, 2023, 3:52 a.m. OK GNU C++17 (64) TESTS 3 15 0
198307895 Niaz_Kamiub B March 20, 2023, 4:18 a.m. OK GNU C++17 (64) TESTS 3 15 0
198315362 Catee B March 20, 2023, 5:48 a.m. OK GNU C++17 (64) TESTS 3 15 0
198303566 Bears_haunt B March 20, 2023, 3:07 a.m. OK GNU C++20 (64) TESTS 3 0 0
198316059 BAKIEV.OFFICIAL B March 20, 2023, 5:57 a.m. OK GNU C++20 (64) TESTS 3 0 0
198315719 bnu20DT B March 20, 2023, 5:53 a.m. OK GNU C++20 (64) TESTS 3 0 0
198304100 DKAZ B March 20, 2023, 3:17 a.m. OK GNU C++20 (64) TESTS 3 0 0
198307306 cowgoodsheep B March 20, 2023, 4:08 a.m. OK GNU C++20 (64) TESTS 3 0 0
198313383 Amrharb B March 20, 2023, 5:25 a.m. OK GNU C++20 (64) TESTS 3 0 0
198313787 robchik B March 20, 2023, 5:30 a.m. OK GNU C++20 (64) TESTS 3 0 0
198315555 zoesads B March 20, 2023, 5:51 a.m. OK GNU C++20 (64) TESTS 3 0 0
198303937 tandingfu B March 20, 2023, 3:14 a.m. OK GNU C++20 (64) TESTS 3 0 0
198303866 KingPRaj B March 20, 2023, 3:13 a.m. OK GNU C++20 (64) TESTS 3 0 0
198311622 longsl B March 20, 2023, 5:03 a.m. OK Go TESTS 3 623 4198400
198267406 naveenkumar.s2021cseb B March 19, 2023, 6:21 p.m. OK Java 11 TESTS 3 155 0
198315162 vijender_8601 B March 20, 2023, 5:46 a.m. OK Java 11 TESTS 3 156 0
198282617 ETHANHUNTMI5 B March 19, 2023, 8:52 p.m. OK Java 11 TESTS 3 171 0
198310848 pranp_24 B March 20, 2023, 4:54 a.m. OK Java 11 TESTS 3 186 0
198271793 etian6795 B March 19, 2023, 6:55 p.m. OK Java 11 TESTS 3 187 0
198294015 Try14022001Baar B March 20, 2023, 12:54 a.m. OK Java 11 TESTS 3 249 0
198306359 erasmas B March 20, 2023, 3:54 a.m. OK Java 11 TESTS 3 264 0
198301821 __bing007___ B March 20, 2023, 2:34 a.m. OK Java 11 TESTS 3 264 0
198310242 manishjha221 B March 20, 2023, 4:48 a.m. OK Java 11 TESTS 3 280 0
198309361 Tarunkrish B March 20, 2023, 4:38 a.m. OK Java 11 TESTS 3 280 0
198271672 omar_sherif B March 19, 2023, 6:54 p.m. OK Java 17 TESTS 3 233 512000
198299935 ksvijayan06 B March 20, 2023, 1:54 a.m. OK Java 17 TESTS 3 249 819200
198273118 hulk4justice B March 19, 2023, 7:06 p.m. OK Java 17 TESTS 3 265 409600
198307808 yogesg_25 B March 20, 2023, 4:17 a.m. OK Java 17 TESTS 3 280 921600
198287925 j4cobi B March 19, 2023, 10:26 p.m. OK Java 17 TESTS 3 295 614400
198307647 goalboy B March 20, 2023, 4:14 a.m. OK Java 17 TESTS 3 311 614400
198276666 kishori_23 B March 19, 2023, 7:39 p.m. OK Java 17 TESTS 3 326 1331200
198272949 anubhavRoy_1305 B March 19, 2023, 7:04 p.m. OK Java 17 TESTS 3 373 921600
198304443 Hemstitch4074 B March 20, 2023, 3:24 a.m. OK Java 17 TESTS 3 405 0
198312626 tejasS-27 B March 20, 2023, 5:15 a.m. OK Java 8 TESTS 3 93 0
198267082 Bagel_ B March 19, 2023, 6:19 p.m. OK Java 8 TESTS 3 93 0
198305079 q2045891621. B March 20, 2023, 3:34 a.m. OK Java 8 TESTS 3 108 0
198291674 mkhafaga B March 19, 2023, 11:56 p.m. OK Java 8 TESTS 3 109 0
198272994 Asee B March 19, 2023, 7:05 p.m. OK Java 8 TESTS 3 109 0
198269725 Ziran3234 B March 19, 2023, 6:38 p.m. OK Java 8 TESTS 3 109 0
198304468 Guddu_P B March 20, 2023, 3:24 a.m. OK Java 8 TESTS 3 124 0
198301829 L-0720 B March 20, 2023, 2:34 a.m. OK Java 8 TESTS 3 186 0
198288799 Rounder B March 19, 2023, 10:46 p.m. OK Java 8 TESTS 3 186 0
198281020 agnivesh2705 B March 19, 2023, 8:32 p.m. OK Java 8 TESTS 3 186 0
198273704 Golovanov399 B March 19, 2023, 7:11 p.m. OK Kotlin 1.7 TESTS 3 342 19660800
198286632 Hussein_salem B March 19, 2023, 9:58 p.m. OK Kotlin 1.7 TESTS 3 420 25292800
198305472 IITeens B March 20, 2023, 3:41 a.m. OK MS C++ 2017 TESTS 3 31 0
198309498 phoenix_78 B March 20, 2023, 4:39 a.m. OK MS C++ 2017 TESTS 3 46 0
198270993 yaqoup.athmneh.12 B March 19, 2023, 6:48 p.m. OK MS C++ 2017 TESTS 3 61 409600
198289453 jithomp B March 19, 2023, 11 p.m. OK MS C++ 2017 TESTS 3 62 0
198262320 sooy B March 19, 2023, 5:51 p.m. OK MS C++ 2017 TESTS 3 62 0
198288621 doanminhtue B March 19, 2023, 10:42 p.m. OK MS C++ 2017 TESTS 3 77 0
198272577 Sverx_Razum B March 19, 2023, 7:01 p.m. OK MS C++ 2017 TESTS 3 77 409600
198284644 Zeyad.AnkhAmon99 B March 19, 2023, 9:21 p.m. OK MS C++ 2017 TESTS 3 78 0
198316363 beksultanomirzak.2001 B March 20, 2023, 6 a.m. OK Node.js TESTS 3 62 4608000
198266285 b-baka B March 19, 2023, 6:14 p.m. OK PyPy 3 TESTS 3 109 2662400
198291737 alpy123 B March 19, 2023, 11:57 p.m. OK PyPy 3 TESTS 3 171 6656000
198299191 dhaivatdshah B March 20, 2023, 1:38 a.m. OK PyPy 3 TESTS 3 186 5324800
198275111 MaoLiser B March 19, 2023, 7:24 p.m. OK PyPy 3 TESTS 3 186 5427200
198283951 oneku16 B March 19, 2023, 9:11 p.m. OK PyPy 3-64 TESTS 3 61 3379200
198282411 oneku16 B March 19, 2023, 8:49 p.m. OK PyPy 3-64 TESTS 3 62 3174400
198283861 oneku16 B March 19, 2023, 9:10 p.m. OK PyPy 3-64 TESTS 3 77 3072000
198269913 klindyuk B March 19, 2023, 6:40 p.m. OK PyPy 3-64 TESTS 3 77 3481600
198301538 Youarenotgood B March 20, 2023, 2:28 a.m. OK PyPy 3-64 TESTS 3 77 3788800
198269177 ayush_kumar20 B March 19, 2023, 6:34 p.m. OK PyPy 3-64 TESTS 3 93 3481600
198294477 voicon B March 20, 2023, 1:05 a.m. OK PyPy 3-64 TESTS 3 93 4300800
198303603 wwwwzhh B March 20, 2023, 3:08 a.m. OK PyPy 3-64 TESTS 3 109 138035200
198287582 oadey89 B March 19, 2023, 10:19 p.m. OK PyPy 3-64 TESTS 3 124 4915200
198262248 Shri_874 B March 19, 2023, 5:51 p.m. OK PyPy 3-64 TESTS 3 124 7065600
198307197 2000030996 B March 20, 2023, 4:06 a.m. OK Python 3 TESTS 3 46 0
198281817 govufpb B March 19, 2023, 8:42 p.m. OK Python 3 TESTS 3 46 0
198285307 AbdallaE B March 19, 2023, 9:32 p.m. OK Python 3 TESTS 3 61 0
198281235 ekru B March 19, 2023, 8:35 p.m. OK Python 3 TESTS 3 61 0
198276293 JohnWicck B March 19, 2023, 7:35 p.m. OK Python 3 TESTS 3 61 0
198270533 iv.osipov2004 B March 19, 2023, 6:44 p.m. OK Python 3 TESTS 3 61 0
198270054 GeshaIliiasova B March 19, 2023, 6:41 p.m. OK Python 3 TESTS 3 61 0
198264879 1OMAR1 B March 19, 2023, 6:06 p.m. OK Python 3 TESTS 3 61 0
198263900 anshraj4324 B March 19, 2023, 6 p.m. OK Python 3 TESTS 3 61 0
198315148 kolyalegenda B March 20, 2023, 5:46 a.m. OK Python 3 TESTS 3 62 0
198310609 novice.li B March 20, 2023, 4:52 a.m. OK Rust 2021 TESTS 3 0 0
198295301 Kither B March 20, 2023, 1:24 a.m. OK Rust 2021 TESTS 3 15 0

remove filters

Back to search problems