Codeforces Round 553 (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
1151 Codeforces Round 553 (Div. 2) FINISHED False 7200 176221499 April 18, 2019, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8465 ) D Stas and the Queue at the Buffet PROGRAMMING greedy math sortings 1500

B'During a break in the buffet of the scientific lyceum of the Kingdom of Kremland, there was formed a queue of n high school students numbered from 1 to n . Initially, each student i is on position i . Each student i is characterized by two numbers -- a_i and b_i . Dissatisfaction of the person i equals the product of a_i by the number of people standing to the left of his position, add the product b_i by the number of people standing to the right of his position. Formally, the dissatisfaction of the student i , which is on the position j , equals a_i cdot (j-1) + b_i cdot (n-j) . The director entrusted Stas with the task: rearrange the people in the queue so that minimize the total dissatisfaction. Although Stas is able to solve such problems, this was not given to him. He turned for help to you. The first line contains a single integer n ( 1 <= q n <= q 10^5 ) -- the number of people in the queue. Each of the following n lines contains two integers a_i and b_i ( 1 <= q a_i, b_i <= q 10^8 ) -- the characteristic of the student i , initially on the position i . Output one integer -- minimum total dissatisfaction which can be achieved by rearranging people in the queue. In the first example it is optimal to put people in this order: ( 3, 1, 2 ). The first person is in the position of 2 , then his dissatisfaction will be equal to 4 cdot 1+2 cdot 1=6 . The second person is in the position of 3 , his dissatisfaction will be equal to 2 cdot 2+3 cdot 0=4 . The third person is in the position of 1 , his dissatisfaction will be equal to 6 cdot 0+1 cdot 2=2 . The total dissatisfaction will be 12 . In the second example, you need to put people in this order: ( 3, 2, 4, 1 ). The total dissatisfaction will be 25 . '...

Tutorials

Codeforces Round #553 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56951208 vjudge1 D July 13, 2019, 2:16 a.m. OK Clang++17 Diagnostics TESTS 40 155 5836800 1500
55852938 vjudge4 D June 21, 2019, 5:18 a.m. OK Clang++17 Diagnostics TESTS 40 998 2457600 1500
55852895 vjudge1 D June 21, 2019, 5:16 a.m. OK Clang++17 Diagnostics TESTS 40 998 2457600 1500
52983726 old_boo D April 18, 2019, 6:16 p.m. OK D TESTS 40 109 0 1500
55270749 xcodevn D June 7, 2019, 4:17 p.m. OK D TESTS 40 109 4198400 1500
52973355 daut-dlang D April 18, 2019, 4:33 p.m. OK D TESTS 40 139 4198400 1500
52966749 fluffyowl D April 18, 2019, 4:03 p.m. OK D TESTS 40 140 11776000 1500
52963221 iica D April 18, 2019, 3:49 p.m. OK D TESTS 40 140 22732800 1500
52968205 TheHedgehog D April 18, 2019, 4:08 p.m. OK Delphi TESTS 40 108 9318400 1500
52977315 ruban D April 18, 2019, 4:56 p.m. OK Delphi TESTS 40 108 149094400 1500
52994902 PhuongPeu D April 19, 2019, 2:54 a.m. OK FPC TESTS 40 77 1331200 1500
52977338 PAG D April 18, 2019, 4:57 p.m. OK FPC TESTS 40 77 2662400 1500
52979134 TShT D April 18, 2019, 5:09 p.m. OK FPC TESTS 40 78 4300800 1500
52972367 darkkcyan D April 18, 2019, 4:27 p.m. OK FPC TESTS 40 171 3276800 1500
53214807 sansen D April 24, 2019, 8:07 a.m. OK GNU C11 TESTS 40 46 409600 1500
53214853 sansen D April 24, 2019, 8:08 a.m. OK GNU C11 TESTS 40 46 819200 1500
52969819 sansen D April 18, 2019, 4:15 p.m. OK GNU C11 TESTS 40 46 1638400 1500
54881746 _nmp_ D May 31, 2019, 2:43 p.m. OK GNU C11 TESTS 40 62 819200 1500
53044579 MYNAMEISSHARIFUL D April 20, 2019, 11:32 a.m. OK GNU C11 TESTS 40 62 1638400 1500
52974296 Risen_Again D April 18, 2019, 4:38 p.m. OK GNU C11 TESTS 40 62 1945600 1500
54876081 vjudge3 D May 31, 2019, 11:52 a.m. OK GNU C11 TESTS 40 62 2355200 1500
54876509 myvegatablehasexplode D May 31, 2019, 12:04 p.m. OK GNU C11 TESTS 40 77 2355200 1500
58545471 mahmednabil109 D Aug. 10, 2019, 4:22 p.m. OK GNU C11 TESTS 40 78 1638400 1500
52984944 nipungoel11 D April 18, 2019, 6:34 p.m. OK GNU C11 TESTS 40 78 3174400 1500
56829227 Frame233 D July 11, 2019, 6:13 a.m. OK GNU C++11 TESTS 40 31 204800 1500
53288039 ZJH111111 D April 25, 2019, 2:37 p.m. OK GNU C++11 TESTS 40 31 409600 1500
53288055 luogu_bot5 D April 25, 2019, 2:37 p.m. OK GNU C++11 TESTS 40 31 409600 1500
52968574 fwdarling D April 18, 2019, 4:10 p.m. OK GNU C++11 TESTS 40 31 819200 1500
56845777 wasa855 D July 11, 2019, 1:34 p.m. OK GNU C++11 TESTS 40 31 819200 1500
52975037 Holland_Pig D April 18, 2019, 4:42 p.m. OK GNU C++11 TESTS 40 31 819200 1500
54409426 SoiMae D May 20, 2019, 8:47 a.m. OK GNU C++11 TESTS 40 31 1228800 1500
55539152 Blind D June 13, 2019, 6:27 p.m. OK GNU C++11 TESTS 40 46 409600 1500
54831747 litble D May 30, 2019, 9:11 a.m. OK GNU C++11 TESTS 40 46 409600 1500
55539125 Blind D June 13, 2019, 6:26 p.m. OK GNU C++11 TESTS 40 46 409600 1500
52970014 Linkus D April 18, 2019, 4:16 p.m. OK GNU C++14 TESTS 40 46 819200 1500
53182404 H4XeO6 D April 23, 2019, 8:22 a.m. OK GNU C++14 TESTS 40 46 1740800 1500
52999494 tokitsukaze D April 19, 2019, 6:17 a.m. OK GNU C++14 TESTS 40 46 2560000 1500
52973128 Eassion_C D April 18, 2019, 4:31 p.m. OK GNU C++14 TESTS 40 46 3481600 1500
52969076 tlylz99 D April 18, 2019, 4:12 p.m. OK GNU C++14 TESTS 40 61 409600 1500
53118086 calabash_boy D April 22, 2019, 9:31 a.m. OK GNU C++14 TESTS 40 61 1126400 1500
53862219 krijgertje D May 7, 2019, 10:09 p.m. OK GNU C++14 TESTS 40 61 1228800 1500
53198218 vjudge5 D April 23, 2019, 4:33 p.m. OK GNU C++14 TESTS 40 61 1228800 1500
53043136 DeeaX99 D April 20, 2019, 10:55 a.m. OK GNU C++14 TESTS 40 61 6451200 1500
67288059 tzaph_ D Dec. 20, 2019, 2:48 p.m. OK GNU C++14 TESTS 40 62 409600 1500
52994609 TobyCF D April 19, 2019, 2:39 a.m. OK GNU C++17 TESTS 40 46 819200 1500
63542831 superslow D Oct. 27, 2019, 9:49 a.m. OK GNU C++17 TESTS 40 46 819200 1500
53746151 lesskreker D May 4, 2019, 4:54 p.m. OK GNU C++17 TESTS 40 46 1228800 1500
63542927 superslow D Oct. 27, 2019, 9:50 a.m. OK GNU C++17 TESTS 40 46 1638400 1500
53541720 SharniR D April 30, 2019, 7:12 a.m. OK GNU C++17 TESTS 40 61 819200 1500
54279747 vjudge2 D May 17, 2019, 12:50 p.m. OK GNU C++17 TESTS 40 61 819200 1500
53011194 Top_xiao D April 19, 2019, 12:12 p.m. OK GNU C++17 TESTS 40 61 1228800 1500
52965414 TWICE2 D April 18, 2019, 3:57 p.m. OK GNU C++17 TESTS 40 61 1638400 1500
57170060 Raiden D July 17, 2019, 2:26 a.m. OK GNU C++17 TESTS 40 61 1638400 1500
54027417 vjudge3 D May 12, 2019, 1:37 p.m. OK GNU C++17 TESTS 40 62 409600 1500
53866895 b0n0n D May 8, 2019, 5:03 a.m. OK Go TESTS 40 93 9728000 1500
53867178 b0n0n D May 8, 2019, 5:19 a.m. OK Go TESTS 40 93 9728000 1500
62840371 120405217 D Oct. 18, 2019, 2:15 a.m. OK Go TESTS 40 187 4505600 1500
52975326 u1s1reallycai D April 18, 2019, 4:44 p.m. OK Go TESTS 40 202 0 1500
64731681 Beta_Tumse_Na_Ho_Paega D Nov. 12, 2019, 8:40 a.m. OK Java 11 TESTS 40 514 0 1500
52995095 aman28rwt D April 19, 2019, 3:06 a.m. OK Java 8 TESTS 40 124 0 1500
53012617 atharvat77 D April 19, 2019, 12:47 p.m. OK Java 8 TESTS 40 140 0 1500
52971563 icpc_loser D April 18, 2019, 4:24 p.m. OK Java 8 TESTS 40 140 0 1500
52996656 mufaddalnaya D April 19, 2019, 4:24 a.m. OK Java 8 TESTS 40 140 0 1500
56382859 prem_cse D July 1, 2019, 9:13 a.m. OK Java 8 TESTS 40 140 0 1500
53207123 doomsfear D April 23, 2019, 11:53 p.m. OK Java 8 TESTS 40 140 0 1500
53038244 beroul D April 20, 2019, 8:25 a.m. OK Java 8 TESTS 40 140 0 1500
69281822 amolpratap007 D Jan. 22, 2020, 6:19 a.m. OK Java 8 TESTS 40 155 0 1500
53405755 spar5h D April 27, 2019, 10:43 a.m. OK Java 8 TESTS 40 155 0 1500
53048718 xodiac D April 20, 2019, 1:30 p.m. OK Java 8 TESTS 40 155 0 1500
55999380 og.kostya D June 24, 2019, 12:16 p.m. OK Mono C# TESTS 40 78 1126400 1500
53118142 lewasupaman SaurumanS LapsleyJuno D April 22, 2019, 9:33 a.m. OK Mono C# TESTS 40 124 3891200 1500
52984701 mban259 D April 18, 2019, 6:29 p.m. OK Mono C# TESTS 40 139 4710400 1500
52979241 sergmel D April 18, 2019, 5:09 p.m. OK Mono C# TESTS 40 140 3891200 1500
54224067 QuantumKnight D May 16, 2019, 5:22 a.m. OK Mono C# TESTS 40 140 6348800 1500
54666431 camypaper D May 26, 2019, 1:38 p.m. OK Mono C# TESTS 40 140 11776000 1500
52978233 Giangvp D April 18, 2019, 5:02 p.m. OK Mono C# TESTS 40 155 4300800 1500
52983281 hongquanntct D April 18, 2019, 6:12 p.m. OK Mono C# TESTS 40 156 7065600 1500
52962254 mircea85 D April 18, 2019, 3:46 p.m. OK Mono C# TESTS 40 156 8704000 1500
53027354 nastya1199 D April 19, 2019, 8:04 p.m. OK Mono C# TESTS 40 171 13107200 1500
53456427 vjudge2 D April 28, 2019, 3:10 a.m. OK MS C++ TESTS 40 46 819200 1500
53473547 vjudge5 D April 28, 2019, 2:04 p.m. OK MS C++ TESTS 40 46 819200 1500
53456443 vjudge2 D April 28, 2019, 3:12 a.m. OK MS C++ TESTS 40 46 819200 1500
54325068 vjudge1 D May 18, 2019, 1:57 a.m. OK MS C++ TESTS 40 46 1228800 1500
57019455 vjudge3 D July 14, 2019, 1:17 p.m. OK MS C++ TESTS 40 46 2457600 1500
53427176 vjudge5 D April 27, 2019, 2:14 p.m. OK MS C++ TESTS 40 61 1228800 1500
53219648 vjudge3 D April 24, 2019, 11:09 a.m. OK MS C++ TESTS 40 61 1228800 1500
53825453 vjudge5 D May 6, 2019, 3:46 p.m. OK MS C++ TESTS 40 61 2457600 1500
54909205 vjudge1 D June 1, 2019, 10:16 a.m. OK MS C++ TESTS 40 61 4812800 1500
53824098 scorpiowf D May 6, 2019, 2:56 p.m. OK MS C++ TESTS 40 62 819200 1500
53992624 Kirja_ES D May 11, 2019, 12:59 p.m. OK MS C++ 2017 TESTS 40 78 819200 1500
52963167 Hasan0540 D April 18, 2019, 3:49 p.m. OK MS C++ 2017 TESTS 40 78 819200 1500
53026390 swomack D April 19, 2019, 7:27 p.m. OK MS C++ 2017 TESTS 40 78 1638400 1500
53304772 risa243 D April 26, 2019, 1:31 a.m. OK MS C++ 2017 TESTS 40 78 2355200 1500
52978631 2462478392 D April 18, 2019, 5:05 p.m. OK MS C++ 2017 TESTS 40 78 2457600 1500
53031027 risa243 D April 20, 2019, 12:11 a.m. OK MS C++ 2017 TESTS 40 78 2662400 1500
52997472 petko_mitkov D April 19, 2019, 5:01 a.m. OK MS C++ 2017 TESTS 40 78 3276800 1500
53037092 AleksanderBalobanov D April 20, 2019, 7:52 a.m. OK MS C++ 2017 TESTS 40 78 4096000 1500
53850948 zhuiyi D May 7, 2019, 1:25 p.m. OK MS C++ 2017 TESTS 40 92 819200 1500
53391024 R99 D April 27, 2019, 6:53 a.m. OK MS C++ 2017 TESTS 40 93 819200 1500
52980919 CrazyDr D April 18, 2019, 5:22 p.m. OK PHP TESTS 40 998 49971200 1500
52990214 pajenegod D April 18, 2019, 9:23 p.m. OK PyPy 2 TESTS 40 217 7372800 1500
53006773 YESMAths D April 19, 2019, 9:59 a.m. OK PyPy 2 TESTS 40 234 12697600 1500
52971016 pajenegod D April 18, 2019, 4:21 p.m. OK PyPy 2 TESTS 40 295 11059200 1500
52967311 Mukundan314 D April 18, 2019, 4:05 p.m. OK PyPy 2 TESTS 40 342 10956800 1500
52989536 raj1307 D April 18, 2019, 8:50 p.m. OK PyPy 2 TESTS 40 343 12185600 1500
52984756 thenewguy39 D April 18, 2019, 6:30 p.m. OK PyPy 2 TESTS 40 358 5734400 1500
53008805 pajenegod D April 19, 2019, 11:03 a.m. OK PyPy 2 TESTS 40 373 11878400 1500
52969751 noob77777 D April 18, 2019, 4:15 p.m. OK PyPy 2 TESTS 40 467 8192000 1500
52974168 pavankatta D April 18, 2019, 4:37 p.m. OK PyPy 2 TESTS 40 639 14950400 1500
52994857 apoorv1999 D April 19, 2019, 2:52 a.m. OK PyPy 2 TESTS 40 670 9113600 1500
52990248 pajenegod D April 18, 2019, 9:25 p.m. OK PyPy 3 TESTS 40 217 8294400 1500
52990219 pajenegod D April 18, 2019, 9:23 p.m. OK PyPy 3 TESTS 40 233 8294400 1500
52988802 meooow D April 18, 2019, 8:22 p.m. OK PyPy 3 TESTS 40 311 12902400 1500
52977044 Paixao D April 18, 2019, 4:55 p.m. OK PyPy 3 TESTS 40 312 8499200 1500
53029517 Hokage777 D April 19, 2019, 9:53 p.m. OK PyPy 3 TESTS 40 327 12697600 1500
52971767 pineriver D April 18, 2019, 4:25 p.m. OK PyPy 3 TESTS 40 342 12083200 1500
52967363 algmyr D April 18, 2019, 4:05 p.m. OK PyPy 3 TESTS 40 358 24371200 1500
52989772 sm1ley D April 18, 2019, 9 p.m. OK PyPy 3 TESTS 40 436 12185600 1500
52993377 glucose D April 19, 2019, 1:14 a.m. OK PyPy 3 TESTS 40 436 12800000 1500
54631648 Mint_Dentifrice D May 25, 2019, 2:45 p.m. OK PyPy 3 TESTS 40 436 18022400 1500
52967473 nwi D April 18, 2019, 4:05 p.m. OK Python 2 TESTS 40 389 11161600 1500
53169236 TheDreamer979 D April 22, 2019, 7:59 p.m. OK Python 2 TESTS 40 421 4198400 1500
52985829 elistark D April 18, 2019, 6:53 p.m. OK Python 2 TESTS 40 483 12288000 1500
52971180 iroodaz D April 18, 2019, 4:22 p.m. OK Python 2 TESTS 40 483 16486400 1500
52966260 bazzyadb D April 18, 2019, 4:01 p.m. OK Python 2 TESTS 40 514 4300800 1500
52992756 ilkerkosaroglu D April 19, 2019, 12:25 a.m. OK Python 2 TESTS 40 514 12185600 1500
52985103 kaif_7 D April 18, 2019, 6:37 p.m. OK Python 2 TESTS 40 514 12288000 1500
52973750 LaoJiangHu D April 18, 2019, 4:35 p.m. OK Python 2 TESTS 40 514 12288000 1500
53293573 Helli.code D April 25, 2019, 4:35 p.m. OK Python 2 TESTS 40 514 14233600 1500
52981701 eat_sleep_code_repeat D April 18, 2019, 5:28 p.m. OK Python 2 TESTS 40 545 12390400 1500
55055294 plosique D June 3, 2019, 6:44 p.m. OK Python 3 TESTS 40 358 3174400 1500
52967281 sparkyyyy D April 18, 2019, 4:04 p.m. OK Python 3 TESTS 40 358 10854400 1500
52977617 FlyingBag65 D April 18, 2019, 4:58 p.m. OK Python 3 TESTS 40 374 2969600 1500
53714435 Codebat D May 3, 2019, 6:02 p.m. OK Python 3 TESTS 40 389 13414400 1500
54739925 surajsirvi88 D May 28, 2019, 7:18 a.m. OK Python 3 TESTS 40 404 2969600 1500
52973166 dave13 D April 18, 2019, 4:32 p.m. OK Python 3 TESTS 40 405 2867200 1500
53171185 Fedos_progaet D April 22, 2019, 9:45 p.m. OK Python 3 TESTS 40 405 2969600 1500
52978942 julianferres D April 18, 2019, 5:07 p.m. OK Python 3 TESTS 40 405 3174400 1500
53212003 abhidish_123 D April 24, 2019, 6:11 a.m. OK Python 3 TESTS 40 405 3379200 1500
53498967 Yazan_Eagle2 D April 29, 2019, 1:19 p.m. OK Python 3 TESTS 40 420 2355200 1500
55073752 EbTech D June 4, 2019, 7:33 a.m. OK Rust TESTS 40 46 2252800 1500
53175781 CountZero D April 23, 2019, 3:34 a.m. OK Rust TESTS 40 62 1433600 1500
55216876 EbTech D June 6, 2019, 5:14 p.m. OK Rust TESTS 40 62 2150400 1500
55267452 EbTech D June 7, 2019, 2:27 p.m. OK Rust TESTS 40 77 2252800 1500
55183428 EbTech D June 6, 2019, 1:29 a.m. OK Rust TESTS 40 77 2252800 1500
55185471 EbTech D June 6, 2019, 3:07 a.m. OK Rust TESTS 40 78 2150400 1500
55072748 EbTech D June 4, 2019, 7:05 a.m. OK Rust TESTS 40 78 2252800 1500
55073106 EbTech D June 4, 2019, 7:16 a.m. OK Rust TESTS 40 93 2252800 1500
55072868 EbTech D June 4, 2019, 7:09 a.m. OK Rust TESTS 40 93 2252800 1500
61349749 chinmaykousik1 D Sept. 27, 2019, 7:22 a.m. OK Rust TESTS 40 108 2457600 1500
52977715 yakamoto D April 18, 2019, 4:59 p.m. OK Scala TESTS 40 529 0 1500

remove filters

Back to search problems