Codeforces Global Round 14

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
1515 Codeforces Global Round 14 FINISHED False 10800 117300262 May 2, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20361 ) A Phoenix and Gold PROGRAMMING constructive algorithms math

B'Phoenix has collected n pieces of gold, and he wants to weigh them together so he can feel rich. The i -th piece of gold has weight w_i . All weights are distinct. He will put his n pieces of gold on a weight scale, one piece at a time. The scale has an unusual defect: if the total weight on it is exactly x , it will explode. Can he put all n gold pieces onto the scale in some order, without the scale exploding during the process? If so, help him find some possible order. Formally, rearrange the array w so that for each i (1 <= i <= n) , sum limits_{j = 1}^{i}w_j ne x . The input consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of each test case contains two integers n and x ( 1 <= n <= 100 ; 1 <= x <= 10^4 ) -- the number of gold pieces that Phoenix has and the weight to avoid, respectively. The second line of each test case contains n space-separated integers (1 <= w_i <= 100) -- the weights of the gold pieces. It is guaranteed that the weights are pairwise distinct. For each test case, if Phoenix cannot place all n pieces without the scale exploding, print NO. Otherwise, print YES followed by the rearranged array w . If there are multiple solutions, print any. In the first test case, Phoenix puts the gold piece with weight 3 on the scale first, then the piece with weight 2 , and finally the piece with weight 1 . The total weight on the scale is 3 , then 5 , then 6 . The scale does not explode because the total weight on the scale is never 2 . In the second test case, the total weight on the scale is 8 , 9 , 11 , 14 , then 18 . It is never 3 . In the third test case, Phoenix must put the gold piece with weight 5 on the scale, and the scale will always explode. '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
114968576 __v0id A May 2, 2021, 8:36 p.m. OK D TESTS 4 46 1945600
114987779 lucky0809 A May 3, 2021, 4:26 a.m. OK GNU C11 TESTS 4 327 0
114961466 ADITYA_17 A May 2, 2021, 6:54 p.m. OK GNU C11 TESTS 4 327 0
114961793 Ricky6200 A May 2, 2021, 6:57 p.m. OK GNU C11 TESTS 4 327 0
114985044 noobdecoder A May 3, 2021, 3:48 a.m. OK GNU C11 TESTS 4 327 0
114984768 cskfan_18 A May 3, 2021, 3:44 a.m. OK GNU C11 TESTS 4 343 0
114950636 Ankur1717 A May 2, 2021, 5:05 p.m. OK GNU C11 TESTS 4 374 0
114978918 jsz666 A May 3, 2021, 1:49 a.m. OK GNU C++11 TESTS 4 15 0
114978404 hihihi198 A May 3, 2021, 1:35 a.m. OK GNU C++11 TESTS 4 15 0
114977879 SrO A May 3, 2021, 1:19 a.m. OK GNU C++11 TESTS 4 15 0
114974967 xgzc A May 2, 2021, 11:40 p.m. OK GNU C++11 TESTS 4 15 0
114981603 xgzc A May 3, 2021, 2:48 a.m. OK GNU C++11 TESTS 4 15 0
114979769 zczc-Ethan A May 3, 2021, 2:08 a.m. OK GNU C++11 TESTS 4 15 0
114993591 1zhuxiaobaicai A May 3, 2021, 5:33 a.m. OK GNU C++11 TESTS 4 15 0
114989059 xiaoziyao A May 3, 2021, 4:43 a.m. OK GNU C++11 TESTS 4 15 0
114988515 E_Murarry_Reddy A May 3, 2021, 4:36 a.m. OK GNU C++11 TESTS 4 15 0
114988360 E_Murarry_Reddy A May 3, 2021, 4:34 a.m. OK GNU C++11 TESTS 4 15 0
114975281 Shekh_Ashraful A May 2, 2021, 11:51 p.m. OK GNU C++14 TESTS 4 15 0
114963035 loalialia A May 2, 2021, 7:09 p.m. OK GNU C++14 TESTS 4 15 102400
114966650 mohakkhowal A May 2, 2021, 8:03 p.m. OK GNU C++14 TESTS 4 15 102400
114994301 R35007 A May 3, 2021, 5:40 a.m. OK GNU C++14 TESTS 4 15 819200
114984830 Anurag_20 A May 3, 2021, 3:44 a.m. OK GNU C++14 TESTS 4 30 0
114983620 NewbieCoder31 A May 3, 2021, 3:26 a.m. OK GNU C++14 TESTS 4 30 0
114983291 NewbieCoder31 A May 3, 2021, 3:20 a.m. OK GNU C++14 TESTS 4 30 0
114983193 dmdivyansh_113 A May 3, 2021, 3:19 a.m. OK GNU C++14 TESTS 4 30 0
114996264 codingchamp7 A May 3, 2021, 5:58 a.m. OK GNU C++14 TESTS 4 30 0
114994928 I_francis A May 3, 2021, 5:46 a.m. OK GNU C++14 TESTS 4 30 0
114986544 mosampatel78 A May 3, 2021, 4:10 a.m. OK GNU C++17 TESTS 4 15 0
114987331 Priyank2912 A May 3, 2021, 4:20 a.m. OK GNU C++17 TESTS 4 15 102400
114996248 ninja_satyam A May 3, 2021, 5:58 a.m. OK GNU C++17 TESTS 4 15 102400
114971923 Akib_2612 A May 2, 2021, 10:01 p.m. OK GNU C++17 TESTS 4 15 102400
114976867 Roshan_08 A May 3, 2021, 12:49 a.m. OK GNU C++17 TESTS 4 15 204800
114982029 696C6F766575 A May 3, 2021, 2:56 a.m. OK GNU C++17 TESTS 4 15 409600
114991512 KDVinit A May 3, 2021, 5:11 a.m. OK GNU C++17 TESTS 4 30 0
114992729 yajc A May 3, 2021, 5:24 a.m. OK GNU C++17 TESTS 4 30 0
114993233 zyzzsama A May 3, 2021, 5:29 a.m. OK GNU C++17 TESTS 4 30 0
114995428 harsh639 A May 3, 2021, 5:50 a.m. OK GNU C++17 TESTS 4 30 0
114977133 Apelpul A May 3, 2021, 12:58 a.m. OK GNU C++17 (64) TESTS 4 15 0
114970298 the_xd A May 2, 2021, 9:16 p.m. OK GNU C++17 (64) TESTS 4 15 0
114969204 SinaSahabi A May 2, 2021, 8:49 p.m. OK GNU C++17 (64) TESTS 4 15 0
114967619 vk1cd314 A May 2, 2021, 8:20 p.m. OK GNU C++17 (64) TESTS 4 15 0
114991491 vjudge4 A May 3, 2021, 5:11 a.m. OK GNU C++17 (64) TESTS 4 15 0
114995477 AkshitDh A May 3, 2021, 5:51 a.m. OK GNU C++17 (64) TESTS 4 15 0
114981481 ajai_C_R_7_ A May 3, 2021, 2:46 a.m. OK GNU C++17 (64) TESTS 4 15 0
114978271 Monazo1997 A May 3, 2021, 1:31 a.m. OK GNU C++17 (64) TESTS 4 15 0
114978151 feelin_dejavu A May 3, 2021, 1:28 a.m. OK GNU C++17 (64) TESTS 4 15 0
114977229 BiIIy A May 3, 2021, 1:01 a.m. OK GNU C++17 (64) TESTS 4 15 0
114978314 wooljs A May 3, 2021, 1:33 a.m. OK Go TESTS 4 61 0
114960993 tihoson A May 2, 2021, 6:51 p.m. OK Haskell TESTS 4 202 102400
114995707 sf14t A May 3, 2021, 5:53 a.m. OK Java 11 TESTS 4 186 0
114968587 Ste A May 2, 2021, 8:36 p.m. OK Java 11 TESTS 4 186 0
114964146 zenilharia26 A May 2, 2021, 7:22 p.m. OK Java 11 TESTS 4 186 0
114960365 ypa A May 2, 2021, 6:48 p.m. OK Java 11 TESTS 4 186 0
114967185 eulerian11 A May 2, 2021, 8:12 p.m. OK Java 11 TESTS 4 202 0
114968689 BogoSortIsBest A May 2, 2021, 8:39 p.m. OK Java 11 TESTS 4 202 0
114957629 Ahmed_Hosssam A May 2, 2021, 5:33 p.m. OK Java 11 TESTS 4 218 0
114988818 lucky1305 A May 3, 2021, 4:40 a.m. OK Java 11 TESTS 4 218 0
114967507 hassanU A May 2, 2021, 8:18 p.m. OK Java 11 TESTS 4 234 0
114984454 Sina_5 A May 3, 2021, 3:39 a.m. OK Java 11 TESTS 4 296 0
114987563 Manan8686 A May 3, 2021, 4:23 a.m. OK Java 8 TESTS 4 109 0
114981185 edenSpace A May 3, 2021, 2:40 a.m. OK Java 8 TESTS 4 109 0
114966504 Gupta-OP A May 2, 2021, 8 p.m. OK Java 8 TESTS 4 109 0
114962964 gssakash A May 2, 2021, 7:08 p.m. OK Java 8 TESTS 4 109 0
114960487 deepaksach A May 2, 2021, 6:48 p.m. OK Java 8 TESTS 4 109 0
114988359 Pranay_ A May 3, 2021, 4:34 a.m. OK Java 8 TESTS 4 124 0
114965370 RonWonWon A May 2, 2021, 7:40 p.m. OK Java 8 TESTS 4 124 0
114960653 VishuTomar A May 2, 2021, 6:49 p.m. OK Java 8 TESTS 4 124 0
114957975 aditya.tiwari A May 2, 2021, 5:34 p.m. OK Java 8 TESTS 4 124 0
114956501 nuni. A May 2, 2021, 5:29 p.m. OK Java 8 TESTS 4 124 0
114974893 Spheniscine A May 2, 2021, 11:38 p.m. OK Kotlin TESTS 4 139 1228800
114968449 koper A May 2, 2021, 8:34 p.m. OK Kotlin TESTS 4 186 102400
114987711 rakeshSeervi A May 3, 2021, 4:25 a.m. OK Kotlin TESTS 4 202 204800
114961242 catforce A May 2, 2021, 6:53 p.m. OK Kotlin TESTS 4 217 1945600
114961515 lifran A May 2, 2021, 6:55 p.m. OK Kotlin TESTS 4 233 1945600
114990822 TRR A May 3, 2021, 5:04 a.m. OK Mono C# TESTS 4 311 3072000
114987455 DragonsSin_Meliodas A May 3, 2021, 4:22 a.m. OK MS C++ 2017 TESTS 4 46 0
114986803 DragonsSin_Meliodas A May 3, 2021, 4:13 a.m. OK MS C++ 2017 TESTS 4 77 0
114962343 codmacian A May 2, 2021, 7:02 p.m. OK MS C++ 2017 TESTS 4 109 0
114956832 UnHingedFrog A May 2, 2021, 5:30 p.m. OK MS C++ 2017 TESTS 4 109 0
114980999 Fy9091 A May 3, 2021, 2:36 a.m. OK MS C++ 2017 TESTS 4 109 204800
114991007 Archie98 A May 3, 2021, 5:06 a.m. OK MS C++ 2017 TESTS 4 124 0
114996095 Vapour_snekk A May 3, 2021, 5:56 a.m. OK MS C++ 2017 TESTS 4 124 0
114994338 vjudge1 A May 3, 2021, 5:40 a.m. OK MS C++ 2017 TESTS 4 124 0
114978141 spadking A May 3, 2021, 1:28 a.m. OK MS C++ 2017 TESTS 4 124 0
114956369 vipul7000 A May 2, 2021, 5:29 p.m. OK MS C++ 2017 TESTS 4 124 2457600
114986036 Jakhongir A May 3, 2021, 4:02 a.m. OK PHP TESTS 4 31 512000
114987574 MadinaN A May 3, 2021, 4:23 a.m. OK PHP TESTS 4 327 0
114963112 wishcode A May 2, 2021, 7:10 p.m. OK PyPy 3 TESTS 4 186 9420800
114978187 amrit231999 A May 3, 2021, 1:29 a.m. OK PyPy 3 TESTS 4 186 9523200
114978610 lucifer1004 A May 3, 2021, 1:41 a.m. OK PyPy 3 TESTS 4 187 5120000
114960601 akshitm16 A May 2, 2021, 6:49 p.m. OK PyPy 3 TESTS 4 187 9523200
114968518 chandra17shreeji A May 2, 2021, 8:35 p.m. OK PyPy 3 TESTS 4 202 9318400
114963315 light_yagami52 A May 2, 2021, 7:12 p.m. OK PyPy 3 TESTS 4 202 9523200
114966607 pawan6300 A May 2, 2021, 8:02 p.m. OK PyPy 3 TESTS 4 217 7372800
114961867 the_brainiac A May 2, 2021, 6:58 p.m. OK PyPy 3 TESTS 4 217 9523200
114989941 Half_coder A May 3, 2021, 4:54 a.m. OK PyPy 3 TESTS 4 218 4812800
114996218 Aref111n A May 3, 2021, 5:58 a.m. OK PyPy 3 TESTS 4 218 9318400
114968013 poojith_mannepalli A May 2, 2021, 8:26 p.m. OK Python 3 TESTS 4 108 204800
114969987 HexHowells A May 2, 2021, 9:08 p.m. OK Python 3 TESTS 4 109 0
114993125 shhrrtnvr A May 3, 2021, 5:28 a.m. OK Python 3 TESTS 4 124 0
114968517 mhdrz A May 2, 2021, 8:35 p.m. OK Python 3 TESTS 4 124 0
114968473 morpheus00 A May 2, 2021, 8:34 p.m. OK Python 3 TESTS 4 124 0
114960336 Alirezanow A May 2, 2021, 6:47 p.m. OK Python 3 TESTS 4 124 512000
114969036 shuvrajeet17 A May 2, 2021, 8:46 p.m. OK Python 3 TESTS 4 139 0
114969981 Muntasib A May 2, 2021, 9:07 p.m. OK Python 3 TESTS 4 155 0
114981713 Klaycf A May 3, 2021, 2:50 a.m. OK Python 3 TESTS 4 186 0
114961054 Itzumal A May 2, 2021, 6:51 p.m. OK Python 3 TESTS 4 186 307200
114970479 Kaa A May 2, 2021, 9:21 p.m. OK Rust TESTS 4 46 0

remove filters

Back to search problems