Codeforces Round 536 (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
1106 Codeforces Round 536 (Div. 2) FINISHED False 9600 188587523 Jan. 31, 2019, 12:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14861 ) C Lunar New Year and Number Division PROGRAMMING greedy implementation math sortings 1000

B"Lunar New Year is approaching, and Bob is struggling with his homework xe2 x80 x93 a number division problem. There are n positive integers a_1, a_2, ldots, a_n on Bob's homework paper, where n is always an even number. Bob is asked to divide those numbers into groups, where each group must contain at least 2 numbers. Suppose the numbers are divided into m groups, and the sum of the numbers in the j -th group is s_j . Bob's aim is to minimize the sum of the square of s_j , that is sum_{j = 1}^{m} s_j^2. Bob is puzzled by this hard problem. Could you please help him solve it? The first line contains an even integer n ( 2 <= q n <= q 3 cdot 10^5 ), denoting that there are n integers on Bob's homework paper. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^4 ), describing the numbers you need to deal with. A single line containing one integer, denoting the minimum of the sum of the square of s_j , which is sum_{i = j}^{m} s_j^2, where m is the number of groups. In the first sample, one of the optimal solutions is to divide those 4 numbers into 2 groups {2, 8 }, {5, 3 } . Thus the answer is (2 + 8)^2 + (5 + 3)^2 = 164 . In the second sample, one of the optimal solutions is to divide those 6 numbers into 3 groups {1, 2 }, {1, 2 }, {1, 2 } . Thus the answer is (1 + 2)^2 + (1 + 2)^2 + (1 + 2)^2 = 27 . "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49371373 vjudge1 C Feb. 2, 2019, 5:29 p.m. OK Clang++17 Diagnostics TESTS 52 280 0 1000
50249476 yafngzh C Feb. 20, 2019, 4:32 p.m. OK Clang++17 Diagnostics TESTS 52 280 307200 1000
49510685 LawrenceMelo C Feb. 5, 2019, 8:10 p.m. OK Clang++17 Diagnostics TESTS 52 280 1228800 1000
50249577 yafngzh C Feb. 20, 2019, 4:34 p.m. OK Clang++17 Diagnostics TESTS 52 1231 1433600 1000
50249602 yafngzh C Feb. 20, 2019, 4:35 p.m. OK Clang++17 Diagnostics TESTS 52 1232 1433600 1000
50606799 jeong000307 C Feb. 28, 2019, 2:55 p.m. OK Clang++17 Diagnostics TESTS 52 1247 1433600 1000
49464435 smit.mangukiya C Feb. 4, 2019, 2:28 p.m. OK Clang++17 Diagnostics TESTS 52 1248 1228800 1000
50249785 yafngzh C Feb. 20, 2019, 4:40 p.m. OK Clang++17 Diagnostics TESTS 52 1278 1228800 1000
50249718 yafngzh C Feb. 20, 2019, 4:38 p.m. OK Clang++17 Diagnostics TESTS 52 1294 1228800 1000
49354592 luogu_bot2 C Feb. 2, 2019, 10:25 a.m. OK FPC TESTS 52 78 1228800 1000
49267214 lie_b C Jan. 31, 2019, 1:48 p.m. OK FPC TESTS 52 78 4300800 1000
51852779 chaorenhaha C March 26, 2019, 9:01 a.m. OK FPC TESTS 52 78 4812800 1000
51248981 panteleevda C March 13, 2019, 7:20 a.m. OK FPC TESTS 52 92 1228800 1000
49269103 bcr_233 C Jan. 31, 2019, 1:58 p.m. OK FPC TESTS 52 92 4300800 1000
49312274 PAG C Feb. 1, 2019, 8:34 a.m. OK FPC TESTS 52 93 2457600 1000
51852801 chaorenhaha C March 26, 2019, 9:02 a.m. OK FPC TESTS 52 93 4300800 1000
49275862 Kecapgiacmo C Jan. 31, 2019, 2:36 p.m. OK FPC TESTS 52 93 7065600 1000
51852817 chaorenhaha C March 26, 2019, 9:02 a.m. OK FPC TESTS 52 93 8294400 1000
49356687 DarkAvengerr C Feb. 2, 2019, 11:27 a.m. OK FPC TESTS 52 109 2457600 1000
52933679 Istiak516 C April 18, 2019, 4:49 a.m. OK GNU C11 TESTS 52 62 2355200 1000
56850449 Xetnys_Rorre C July 11, 2019, 3:28 p.m. OK GNU C11 TESTS 52 78 1228800 1000
52544667 _one_noob C April 9, 2019, 8:20 p.m. OK GNU C11 TESTS 52 78 1228800 1000
49393256 33RMB C Feb. 3, 2019, 11:12 a.m. OK GNU C11 TESTS 52 78 1228800 1000
49288588 hardShoft C Jan. 31, 2019, 6:33 p.m. OK GNU C11 TESTS 52 78 4608000 1000
56978171 You_Know_Who C July 13, 2019, 12:57 p.m. OK GNU C11 TESTS 52 93 1228800 1000
52639887 Alfeh C April 12, 2019, 12:01 p.m. OK GNU C11 TESTS 52 93 1228800 1000
53723779 susmoydhar7 C May 4, 2019, 2:28 a.m. OK GNU C11 TESTS 52 93 1228800 1000
55382220 kaiboy C June 9, 2019, 9:53 p.m. OK GNU C11 TESTS 52 93 1228800 1000
62457663 DevJewel C Oct. 13, 2019, 7:05 a.m. OK GNU C11 TESTS 52 93 1228800 1000
49298152 qjzTreeZ C Feb. 1, 2019, 12:42 a.m. OK GNU C++11 TESTS 52 31 1228800 1000
49309666 GKxx C Feb. 1, 2019, 7:16 a.m. OK GNU C++11 TESTS 52 46 1024000 1000
49318686 luogu_bot5 C Feb. 1, 2019, 11:16 a.m. OK GNU C++11 TESTS 52 46 1024000 1000
57789944 Alike C July 26, 2019, 9:05 a.m. OK GNU C++11 TESTS 52 46 1024000 1000
54333415 vjudge4 C May 18, 2019, 7 a.m. OK GNU C++11 TESTS 52 46 1228800 1000
57625159 vjudge3 C July 24, 2019, 6:44 a.m. OK GNU C++11 TESTS 52 46 1228800 1000
57624482 vjudge2 C July 24, 2019, 6:29 a.m. OK GNU C++11 TESTS 52 46 1228800 1000
57623667 vjudge4 C July 24, 2019, 6:09 a.m. OK GNU C++11 TESTS 52 46 1228800 1000
57302432 parallelCH C July 19, 2019, 1:14 a.m. OK GNU C++11 TESTS 52 46 1228800 1000
57772548 luogu_bot1 C July 26, 2019, 1:42 a.m. OK GNU C++11 TESTS 52 46 1228800 1000
49353657 interestingLSY C Feb. 2, 2019, 9:56 a.m. OK GNU C++14 TESTS 52 46 3379200 1000
49353650 HatsuneMikuo C Feb. 2, 2019, 9:56 a.m. OK GNU C++14 TESTS 52 46 3379200 1000
49296468 naoya_t C Jan. 31, 2019, 11:24 p.m. OK GNU C++14 TESTS 52 46 13209600 1000
50605779 zhixiang C Feb. 28, 2019, 2:28 p.m. OK GNU C++14 TESTS 52 46 16281600 1000
49622770 tokitsukaze C Feb. 8, 2019, 10:16 a.m. OK GNU C++14 TESTS 52 62 2560000 1000
49462149 AgReB C Feb. 4, 2019, 1:31 p.m. OK GNU C++14 TESTS 52 77 1228800 1000
49313116 N.H.Fahim C Feb. 1, 2019, 9 a.m. OK GNU C++14 TESTS 52 78 1228800 1000
49339634 classmate C Feb. 1, 2019, 9:13 p.m. OK GNU C++14 TESTS 52 78 1228800 1000
49296573 anishmahto C Jan. 31, 2019, 11:31 p.m. OK GNU C++14 TESTS 52 78 1433600 1000
49472972 evenharder C Feb. 4, 2019, 6 p.m. OK GNU C++14 TESTS 52 78 1433600 1000
49901036 .tx C Feb. 14, 2019, 9:22 a.m. OK GNU C++17 TESTS 52 31 1228800 1000
50512752 functionfang C Feb. 26, 2019, 3:05 a.m. OK GNU C++17 TESTS 52 78 1126400 1000
51075603 qingchexx C March 9, 2019, 9:16 a.m. OK GNU C++17 TESTS 52 78 1228800 1000
50928613 19170243 C March 7, 2019, 12:58 p.m. OK GNU C++17 TESTS 52 78 1228800 1000
49517782 qrfkickit C Feb. 6, 2019, 5:12 a.m. OK GNU C++17 TESTS 52 78 1228800 1000
54139362 Raiden C May 14, 2019, 5:03 p.m. OK GNU C++17 TESTS 52 78 1228800 1000
57135150 vjudge5 C July 16, 2019, 8:37 a.m. OK GNU C++17 TESTS 52 78 1228800 1000
49348731 Mynesis C Feb. 2, 2019, 7:10 a.m. OK GNU C++17 TESTS 52 78 1433600 1000
49556654 astolfo C Feb. 7, 2019, 10:05 a.m. OK GNU C++17 TESTS 52 78 1433600 1000
49268770 RibbonDragon C Jan. 31, 2019, 1:56 p.m. OK GNU C++17 TESTS 52 78 4812800 1000
55311547 vchilikov C June 8, 2019, 5:58 p.m. OK Go TESTS 52 234 716800 1000
51016098 fayzzz C March 8, 2019, 10:17 a.m. OK Go TESTS 52 249 716800 1000
49285090 gksato C Jan. 31, 2019, 5:33 p.m. OK Haskell TESTS 52 265 63897600 1000
54975249 code_report C June 2, 2019, 10:30 a.m. OK Haskell TESTS 52 482 22118400 1000
52725855 jedikni C April 14, 2019, 12:13 a.m. OK Haskell TESTS 52 530 26419200 1000
49278723 gksato C Jan. 31, 2019, 2:59 p.m. OK Haskell TESTS 52 561 81817600 1000
49285067 gksato C Jan. 31, 2019, 5:32 p.m. OK Haskell TESTS 52 576 87040000 1000
49270205 torus711 C Jan. 31, 2019, 2:04 p.m. OK Haskell TESTS 52 639 81715200 1000
57797442 jmazon C July 26, 2019, 11:59 a.m. OK Haskell TESTS 52 920 33689600 1000
67385928 satya_p54 C Dec. 21, 2019, 5:49 p.m. OK Java 11 TESTS 52 233 0 1000
64144660 pizzaEater C Nov. 3, 2019, 9:29 a.m. OK Java 11 TESTS 52 608 2457600 1000
49319876 ShowStopper728 C Feb. 1, 2019, 11:49 a.m. OK Java 8 TESTS 52 124 0 1000
56176967 beroul C June 27, 2019, 7:46 p.m. OK Java 8 TESTS 52 139 0 1000
49562853 tsumit023 C Feb. 7, 2019, 1:28 p.m. OK Java 8 TESTS 52 139 0 1000
49991345 chojh1222 C Feb. 16, 2019, 12:58 p.m. OK Java 8 TESTS 52 140 0 1000
49695899 Pratik_Rajani C Feb. 10, 2019, 1:46 p.m. OK Java 8 TESTS 52 140 0 1000
49299401 aman28rwt C Feb. 1, 2019, 1:47 a.m. OK Java 8 TESTS 52 140 0 1000
49262382 Suunn C Jan. 31, 2019, 1:21 p.m. OK Java 8 TESTS 52 140 20787200 1000
49291578 Z_E_R_0 C Jan. 31, 2019, 7:37 p.m. OK Java 8 TESTS 52 140 21094400 1000
59050971 Vatsal53 C Aug. 18, 2019, 5:17 p.m. OK Java 8 TESTS 52 155 0 1000
49472133 typedef_2000 C Feb. 4, 2019, 5:36 p.m. OK Java 8 TESTS 52 155 0 1000
50268078 I.A.K.O.V C Feb. 21, 2019, 5:42 a.m. OK Kotlin TESTS 52 171 4300800 1000
49364334 Quaternion C Feb. 2, 2019, 2:20 p.m. OK Kotlin TESTS 52 436 31846400 1000
49947540 glider.g C Feb. 15, 2019, 12:41 p.m. OK Kotlin TESTS 52 468 26419200 1000
53990505 og.kostya C May 11, 2019, 12:03 p.m. OK Mono C# TESTS 52 78 1228800 1000
55202316 camypaper C June 6, 2019, 11:07 a.m. OK Mono C# TESTS 52 124 15564800 1000
50257386 treasuryonly C Feb. 20, 2019, 8:32 p.m. OK Mono C# TESTS 52 124 20275200 1000
49492499 DoesNotExist C Feb. 5, 2019, 10:50 a.m. OK Mono C# TESTS 52 124 20275200 1000
49322506 TRR C Feb. 1, 2019, 12:53 p.m. OK Mono C# TESTS 52 124 20275200 1000
49351648 mayumi C Feb. 2, 2019, 8:50 a.m. OK Mono C# TESTS 52 139 23961600 1000
49274303 mircea85 C Jan. 31, 2019, 2:26 p.m. OK Mono C# TESTS 52 139 31334400 1000
49462594 Beboo C Feb. 4, 2019, 1:44 p.m. OK Mono C# TESTS 52 140 20275200 1000
49380365 Mandrade C Feb. 3, 2019, 12:34 a.m. OK Mono C# TESTS 52 140 20275200 1000
49482420 apokaliko C Feb. 5, 2019, 12:36 a.m. OK Mono C# TESTS 52 140 23961600 1000
49880238 vjudge2 C Feb. 13, 2019, 5:49 p.m. OK MS C++ TESTS 52 62 1228800 1000
49686398 vjudge3 C Feb. 10, 2019, 7:23 a.m. OK MS C++ TESTS 52 62 1228800 1000
49889044 vjudge1 C Feb. 14, 2019, 1:28 a.m. OK MS C++ TESTS 52 77 1228800 1000
49685426 vjudge4 C Feb. 10, 2019, 6:47 a.m. OK MS C++ TESTS 52 77 1228800 1000
57810870 Ahmed_Abid C July 26, 2019, 5:16 p.m. OK MS C++ TESTS 52 77 1331200 1000
57627234 vjudge4 C July 24, 2019, 7:28 a.m. OK MS C++ TESTS 52 77 2355200 1000
53723851 vjudge3 C May 4, 2019, 2:31 a.m. OK MS C++ TESTS 52 77 2457600 1000
50431803 ys1468362286 C Feb. 24, 2019, 2:27 p.m. OK MS C++ TESTS 52 77 2457600 1000
57144114 vjudge2 C July 16, 2019, 12:17 p.m. OK MS C++ TESTS 52 78 1228800 1000
57806485 vjudge4 C July 26, 2019, 3:22 p.m. OK MS C++ TESTS 52 78 1228800 1000
57592622 CtrlAlt C July 23, 2019, 12:47 p.m. OK MS C++ 2017 TESTS 52 93 1228800 1000
49370154 aeremin C Feb. 2, 2019, 4:55 p.m. OK MS C++ 2017 TESTS 52 108 1228800 1000
49272306 Heyhue C Jan. 31, 2019, 2:15 p.m. OK MS C++ 2017 TESTS 52 108 4608000 1000
51378860 petko_mitkov C March 16, 2019, 3:18 p.m. OK MS C++ 2017 TESTS 52 109 1228800 1000
49370129 aeremin C Feb. 2, 2019, 4:55 p.m. OK MS C++ 2017 TESTS 52 109 1228800 1000
63281641 AleksanderBalobanov C Oct. 24, 2019, 8:53 a.m. OK MS C++ 2017 TESTS 52 109 1433600 1000
49400695 zzysleep C Feb. 3, 2019, 2:36 p.m. OK MS C++ 2017 TESTS 52 109 2457600 1000
50157967 lyslyslys C Feb. 19, 2019, 11:11 a.m. OK MS C++ 2017 TESTS 52 109 3174400 1000
49266955 GU_GUGU C Jan. 31, 2019, 1:46 p.m. OK MS C++ 2017 TESTS 52 109 4608000 1000
49266241 robert334 C Jan. 31, 2019, 1:42 p.m. OK MS C++ 2017 TESTS 52 109 4608000 1000
53425456 ssdh233 C April 27, 2019, 1:24 p.m. OK Node.js TESTS 52 499 29593600 1000
49342746 ssdh233 C Feb. 2, 2019, 2:01 a.m. OK Node.js TESTS 52 529 28979200 1000
56006745 Gimber C June 24, 2019, 3:56 p.m. OK PascalABC.NET TESTS 52 358 0 1000
49285197 mayakin C Jan. 31, 2019, 5:34 p.m. OK PHP TESTS 52 919 37068800 1000
49295105 gatsko C Jan. 31, 2019, 9:52 p.m. OK PyPy 2 TESTS 52 202 12800000 1000
54462879 kaif_7 C May 21, 2019, 8:06 p.m. OK PyPy 2 TESTS 52 202 18329600 1000
49276251 ssk497 C Jan. 31, 2019, 2:38 p.m. OK PyPy 2 TESTS 52 217 40755200 1000
57925069 uz2ee C July 29, 2019, 6:48 a.m. OK PyPy 2 TESTS 52 218 17817600 1000
49265110 raven_47 C Jan. 31, 2019, 1:36 p.m. OK PyPy 2 TESTS 52 218 40755200 1000
49984489 shehebe C Feb. 16, 2019, 9:53 a.m. OK PyPy 2 TESTS 52 249 17817600 1000
49285612 god1048 C Jan. 31, 2019, 5:40 p.m. OK PyPy 2 TESTS 52 249 40755200 1000
49285160 conjecture_xyz C Jan. 31, 2019, 5:33 p.m. OK PyPy 2 TESTS 52 373 79155200 1000
49511763 psyfoo C Feb. 5, 2019, 8:56 p.m. OK PyPy 3 TESTS 52 295 20377600 1000
49323002 lollihunter C Feb. 1, 2019, 1:03 p.m. OK PyPy 3 TESTS 52 295 21708800 1000
49630423 s19b2_subbotin C Feb. 8, 2019, 3:43 p.m. OK PyPy 3 TESTS 52 296 21708800 1000
53120357 iamprayush C April 22, 2019, 10:57 a.m. OK PyPy 3 TESTS 52 296 21708800 1000
49476383 Stephan C Feb. 4, 2019, 7:35 p.m. OK PyPy 3 TESTS 52 296 21708800 1000
50235008 atharva456 C Feb. 20, 2019, 10:18 a.m. OK PyPy 3 TESTS 52 296 22630400 1000
52341417 y0f01 C April 5, 2019, 10:42 a.m. OK PyPy 3 TESTS 52 311 21708800 1000
49855294 a00920 C Feb. 13, 2019, 6:51 a.m. OK PyPy 3 TESTS 52 311 21708800 1000
49456841 AbduSharif C Feb. 4, 2019, 10:43 a.m. OK PyPy 3 TESTS 52 311 21708800 1000
49456164 yfo C Feb. 4, 2019, 10:20 a.m. OK PyPy 3 TESTS 52 311 21708800 1000
51325227 franckmy C March 15, 2019, 9:22 a.m. OK Python 2 TESTS 52 421 16281600 1000
49302131 biltharesatyendra C Feb. 1, 2019, 3:48 a.m. OK Python 2 TESTS 52 436 16384000 1000
49262877 mrsac7 C Jan. 31, 2019, 1:23 p.m. OK Python 2 TESTS 52 436 22425600 1000
49386495 PraveenMJ C Feb. 3, 2019, 7:14 a.m. OK Python 2 TESTS 52 451 16281600 1000
58082721 bsr011 C July 31, 2019, 2:25 p.m. OK Python 2 TESTS 52 451 16384000 1000
49761269 ltrmn C Feb. 11, 2019, 9:06 a.m. OK Python 2 TESTS 52 452 16281600 1000
49274294 odinson C Jan. 31, 2019, 2:26 p.m. OK Python 2 TESTS 52 452 22425600 1000
49293303 msadiq074 C Jan. 31, 2019, 8:31 p.m. OK Python 2 TESTS 52 467 18124800 1000
49277256 bharathjoshi99 C Jan. 31, 2019, 2:46 p.m. OK Python 2 TESTS 52 467 22323200 1000
49273229 jhoelD C Jan. 31, 2019, 2:20 p.m. OK Python 2 TESTS 52 467 22425600 1000
54720827 Egor_MM C May 27, 2019, 5:18 p.m. OK Python 3 TESTS 52 327 20787200 1000
50526284 CodeMaster C Feb. 26, 2019, 11:54 a.m. OK Python 3 TESTS 52 327 20787200 1000
49307843 Andras675 C Feb. 1, 2019, 6:29 a.m. OK Python 3 TESTS 52 327 20787200 1000
49660200 yashk14 C Feb. 9, 2019, 12:04 p.m. OK Python 3 TESTS 52 342 20787200 1000
49287105 hrmanning C Jan. 31, 2019, 6:05 p.m. OK Python 3 TESTS 52 342 27545600 1000
57061129 Ajay_Modi C July 14, 2019, 6:01 p.m. OK Python 3 TESTS 52 343 20787200 1000
50627757 Jsxft C March 1, 2019, 7:10 a.m. OK Python 3 TESTS 52 343 20787200 1000
49531950 somnath796 C Feb. 6, 2019, 2:12 p.m. OK Python 3 TESTS 52 343 20787200 1000
49387130 Raban7 C Feb. 3, 2019, 7:35 a.m. OK Python 3 TESTS 52 343 20787200 1000
49285624 lekha617 C Jan. 31, 2019, 5:40 p.m. OK Python 3 TESTS 52 343 27545600 1000
49294363 Yellowboy C Jan. 31, 2019, 9:17 p.m. OK Ruby TESTS 52 280 34816000 1000
49294421 Yellowboy C Jan. 31, 2019, 9:20 p.m. OK Ruby TESTS 52 296 34816000 1000
49294453 Yellowboy C Jan. 31, 2019, 9:21 p.m. OK Ruby TESTS 52 311 33587200 1000
49293376 Yellowboy C Jan. 31, 2019, 8:34 p.m. OK Ruby TESTS 52 311 33587200 1000
49294180 Yellowboy C Jan. 31, 2019, 9:08 p.m. OK Ruby TESTS 52 311 34816000 1000
49270720 rahdpp C Jan. 31, 2019, 2:06 p.m. OK Ruby TESTS 52 311 40652800 1000
49294277 Yellowboy C Jan. 31, 2019, 9:13 p.m. OK Ruby TESTS 52 326 34816000 1000
49294314 Yellowboy C Jan. 31, 2019, 9:15 p.m. OK Ruby TESTS 52 327 34816000 1000
49293711 Yellowboy C Jan. 31, 2019, 8:48 p.m. OK Ruby TESTS 52 342 34816000 1000
49293663 Yellowboy C Jan. 31, 2019, 8:46 p.m. OK Ruby TESTS 52 530 34304000 1000
49453028 ancv1990 C Feb. 4, 2019, 8:31 a.m. OK Rust TESTS 52 61 1740800 1000
49633027 kobae964 C Feb. 8, 2019, 5:10 p.m. OK Rust TESTS 52 139 2662400 1000
49289832 denison7111 C Jan. 31, 2019, 6:59 p.m. OK Scala TESTS 52 904 81715200 1000

remove filters

Back to search problems