Codeforces Round 661 (Div. 3)

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
1399 Codeforces Round 661 (Div. 3) FINISHED False 8100 140714711 Aug. 5, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 44151 ) B Gifts Fixing PROGRAMMING greedy

B"You have n gifts and you want to give all of them to children. Of course, you don't want to offend anyone, so all gifts should be equal between each other. The i -th gift consists of a_i candies and b_i oranges. During one move, you can choose some gift 1 <= i <= n and do one of the following operations: Of course, you can not eat a candy or orange if it's not present in the gift (so neither a_i nor b_i can become less than zero). As said above, all gifts should be equal. This means that after some sequence of moves the following two conditions should be satisfied: a_1 = a_2 = ... = a_n and b_1 = b_2 = ... = b_n (and a_i equals b_i is not necessary). Your task is to find the minimum number of moves required to equalize all the given gifts. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 1000 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 50 ) -- the number of gifts. The second line of the test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ), where a_i is the number of candies in the i -th gift. The third line of the test case contains n integers b_1, b_2, ... , b_n ( 1 <= b_i <= 10^9 ), where b_i is the number of oranges in the i -th gift. For each test case, print one integer: the minimum number of moves required to equalize all the given gifts. In the first test case of the example, we can perform the following sequence of moves: "...

Tutorials

Codeforces Round #661 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
90435799 vjudge2 B Aug. 20, 2020, 5:49 a.m. OK Clang++17 Diagnostics TESTS 2 77 4096000
90434937 vjudge5 B Aug. 20, 2020, 5:34 a.m. OK Clang++17 Diagnostics TESTS 2 248 4198400
89995725 fpc_coder B Aug. 15, 2020, 7:15 a.m. OK FPC TESTS 2 46 102400
90085309 daniel5u B Aug. 16, 2020, 1:33 p.m. OK GNU C11 TESTS 2 15 0
90054888 Wenbo888 B Aug. 16, 2020, 3:48 a.m. OK GNU C11 TESTS 2 15 0
90034481 Chreonix B Aug. 15, 2020, 4:31 p.m. OK GNU C11 TESTS 2 15 0
90262069 noobhere B Aug. 17, 2020, 8:27 p.m. OK GNU C11 TESTS 2 15 0
90216503 vedayemlo B Aug. 17, 2020, 10:07 a.m. OK GNU C11 TESTS 2 15 0
90195484 Merida_meem63 B Aug. 17, 2020, 5:20 a.m. OK GNU C11 TESTS 2 15 0
91036481 RK_05028 B Aug. 26, 2020, 9:24 a.m. OK GNU C11 TESTS 2 15 0
90442206 Median B Aug. 20, 2020, 7:31 a.m. OK GNU C11 TESTS 2 15 0
90359943 kamil_hassan B Aug. 19, 2020, 5:38 a.m. OK GNU C11 TESTS 2 15 0
91442778 rioma_san B Aug. 30, 2020, 10:37 p.m. OK GNU C11 TESTS 2 15 3686400
90881887 M_sea B Aug. 25, 2020, 8:23 a.m. OK GNU C++11 TESTS 2 15 0
90877314 PhoenixWright666 B Aug. 25, 2020, 7:20 a.m. OK GNU C++11 TESTS 2 15 0
90865409 Zoezhangjz B Aug. 25, 2020, 3:46 a.m. OK GNU C++11 TESTS 2 15 0
90427057 ivanovcraft B Aug. 20, 2020, 2:01 a.m. OK GNU C++11 TESTS 2 15 0
91695882 Igor_Zielinski B Sept. 3, 2020, 7:22 a.m. OK GNU C++11 TESTS 2 15 0
91671214 MediaBilly B Sept. 2, 2020, 7:39 p.m. OK GNU C++11 TESTS 2 15 0
91580589 WaluntOvO B Sept. 1, 2020, 3:42 p.m. OK GNU C++11 TESTS 2 15 0
91496912 AstorWU B Aug. 31, 2020, 1:54 p.m. OK GNU C++11 TESTS 2 15 0
91050515 luogu_bot3 B Aug. 26, 2020, 12:29 p.m. OK GNU C++11 TESTS 2 15 0
91004981 Esmay_1803017 B Aug. 25, 2020, 10:09 p.m. OK GNU C++11 TESTS 2 15 0
90996037 DuccDuccDucc B Aug. 25, 2020, 6:35 p.m. OK GNU C++14 TESTS 2 0 102400
90356715 LobsterKid B Aug. 19, 2020, 4:30 a.m. OK GNU C++14 TESTS 2 15 0
91234383 Ren_Greyart B Aug. 28, 2020, 5:53 p.m. OK GNU C++14 TESTS 2 15 0
91608920 Ibn_Ali B Sept. 2, 2020, 3:46 a.m. OK GNU C++14 TESTS 2 15 0
91622103 mr_priyansh B Sept. 2, 2020, 7:51 a.m. OK GNU C++14 TESTS 2 15 0
91043237 Azrael142857 B Aug. 26, 2020, 10:58 a.m. OK GNU C++14 TESTS 2 15 0
90900973 HMD_191 B Aug. 25, 2020, 12:59 p.m. OK GNU C++14 TESTS 2 15 0
90434336 Archie1101 B Aug. 20, 2020, 5:22 a.m. OK GNU C++14 TESTS 2 15 0
90405216 AlexanderPr B Aug. 19, 2020, 4:09 p.m. OK GNU C++14 TESTS 2 15 0
90378848 mesumit B Aug. 19, 2020, 10:20 a.m. OK GNU C++14 TESTS 2 15 0
91690218 Yoshinow2001 B Sept. 3, 2020, 5:48 a.m. OK GNU C++17 TESTS 2 15 0
91685962 ak5147 B Sept. 3, 2020, 4:16 a.m. OK GNU C++17 TESTS 2 15 0
91646641 vjudge3 B Sept. 2, 2020, 1:55 p.m. OK GNU C++17 TESTS 2 15 0
91636646 1NVAL1D B Sept. 2, 2020, 11:41 a.m. OK GNU C++17 TESTS 2 15 0
91620801 karankamboj B Sept. 2, 2020, 7:30 a.m. OK GNU C++17 TESTS 2 15 0
91320662 weaknesses B Aug. 30, 2020, 3:48 a.m. OK GNU C++17 TESTS 2 15 0
91218561 shanu_im B Aug. 28, 2020, 2:47 p.m. OK GNU C++17 TESTS 2 15 0
91204072 bluespex B Aug. 28, 2020, 11:43 a.m. OK GNU C++17 TESTS 2 15 0
91081655 iq0 B Aug. 26, 2020, 5:52 p.m. OK GNU C++17 TESTS 2 15 0
91055911 sirius_black1 B Aug. 26, 2020, 1:24 p.m. OK GNU C++17 TESTS 2 15 0
91055461 IMCV B Aug. 26, 2020, 1:19 p.m. OK GNU C++17 (64) TESTS 2 15 0
91691124 Scissors_Ss B Sept. 3, 2020, 6:03 a.m. OK GNU C++17 (64) TESTS 2 15 0
91669258 Phortox B Sept. 2, 2020, 7:01 p.m. OK GNU C++17 (64) TESTS 2 15 0
91656576 ChethanJ B Sept. 2, 2020, 3:54 p.m. OK GNU C++17 (64) TESTS 2 15 0
91619856 vjudge4 B Sept. 2, 2020, 7:15 a.m. OK GNU C++17 (64) TESTS 2 15 0
91249293 ir_1st_vil B Aug. 29, 2020, 12:50 a.m. OK GNU C++17 (64) TESTS 2 15 0
91165899 MrReDoX B Aug. 27, 2020, 8:14 p.m. OK GNU C++17 (64) TESTS 2 15 0
91162650 jenilpatel B Aug. 27, 2020, 7:04 p.m. OK GNU C++17 (64) TESTS 2 15 0
91109472 rekifath B Aug. 27, 2020, 6:45 a.m. OK GNU C++17 (64) TESTS 2 15 0
90449740 seshuzoomin B Aug. 20, 2020, 9:23 a.m. OK GNU C++17 (64) TESTS 2 15 0
91548939 BamgoeSN B Sept. 1, 2020, 8:31 a.m. OK Go TESTS 2 31 0
91694242 bnurgeldiyev514 B Sept. 3, 2020, 6:56 a.m. OK Go TESTS 2 46 0
90517139 CtrlCV B Aug. 21, 2020, 8:57 a.m. OK Go TESTS 2 920 10854400
90052979 B_w_c B Aug. 16, 2020, 2:43 a.m. OK Haskell TESTS 2 77 102400
90532229 GKArnd B Aug. 21, 2020, 12:44 p.m. OK Haskell TESTS 2 77 11571200
90532034 GKArnd B Aug. 21, 2020, 12:41 p.m. OK Haskell TESTS 2 77 11571200
91037583 MC47 B Aug. 26, 2020, 9:39 a.m. OK Haskell TESTS 2 93 0
90529676 abdul_ghani_07 B Aug. 21, 2020, 12:08 p.m. OK Java 11 TESTS 2 155 23859200
90306063 TheManWithNoName B Aug. 18, 2020, 12:13 p.m. OK Java 11 TESTS 2 156 0
90426277 Ruins B Aug. 20, 2020, 1:29 a.m. OK Java 11 TESTS 2 171 0
90243600 Smir B Aug. 17, 2020, 3:37 p.m. OK Java 11 TESTS 2 171 0
90518806 emmalachaitanya B Aug. 21, 2020, 9:20 a.m. OK Java 11 TESTS 2 171 23961600
91630046 _prophet B Sept. 2, 2020, 10:03 a.m. OK Java 11 TESTS 2 186 0
90014460 Boryan07 B Aug. 15, 2020, 11:31 a.m. OK Java 11 TESTS 2 186 0
90831213 GaussFan B Aug. 24, 2020, 1:49 p.m. OK Java 11 TESTS 2 186 23859200
90528988 abdul_ghani_07 B Aug. 21, 2020, 11:59 a.m. OK Java 11 TESTS 2 186 23859200
90516902 cribabby B Aug. 21, 2020, 8:54 a.m. OK Java 11 TESTS 2 186 31948800
91310067 MaxHeap B Aug. 29, 2020, 7:57 p.m. OK Java 8 TESTS 2 78 0
90648160 mu.shakhawat.hossain B Aug. 22, 2020, 2:57 a.m. OK Java 8 TESTS 2 78 20377600
91217502 coder_freak B Aug. 28, 2020, 2:33 p.m. OK Java 8 TESTS 2 93 0
90325979 shika07 B Aug. 18, 2020, 4:05 p.m. OK Java 8 TESTS 2 93 0
90243928 Juniper B Aug. 17, 2020, 3:41 p.m. OK Java 8 TESTS 2 93 0
90041594 AnandOza B Aug. 15, 2020, 6:50 p.m. OK Java 8 TESTS 2 93 0
91470414 Qnass1996 B Aug. 31, 2020, 7:55 a.m. OK Java 8 TESTS 2 93 20480000
90631928 Mihir_Gajera1 B Aug. 21, 2020, 7:07 p.m. OK Java 8 TESTS 2 93 28774400
91689547 Homie_smk B Sept. 3, 2020, 5:35 a.m. OK Java 8 TESTS 2 108 0
91087447 dhanishtha96 B Aug. 26, 2020, 7:35 p.m. OK Java 8 TESTS 2 108 0
90041988 cokifigue B Aug. 15, 2020, 6:59 p.m. OK JavaScript TESTS 2 30 2867200
91311193 Mirimax B Aug. 29, 2020, 8:26 p.m. OK Kotlin TESTS 2 139 512000
90041471 Jothef B Aug. 15, 2020, 6:48 p.m. OK Kotlin TESTS 2 186 0
90293090 chanter B Aug. 18, 2020, 9:10 a.m. OK Kotlin TESTS 2 202 1024000
90404651 Soomanib_037 B Aug. 19, 2020, 4:01 p.m. OK Mono C# TESTS 2 46 3072000
91281965 hhsaffar B Aug. 29, 2020, 11:53 a.m. OK Mono C# TESTS 2 61 6758400
90030548 VisiOrigin B Aug. 15, 2020, 3:31 p.m. OK Mono C# TESTS 2 62 6758400
90200161 Mosyagin B Aug. 17, 2020, 6:28 a.m. OK Mono C# TESTS 2 77 2969600
90031011 VisiOrigin B Aug. 15, 2020, 3:38 p.m. OK Mono C# TESTS 2 109 6758400
90441513 vjudge5 B Aug. 20, 2020, 7:21 a.m. OK MS C++ TESTS 2 15 204800
90500102 hmn1995 B Aug. 21, 2020, 12:07 a.m. OK MS C++ TESTS 2 61 0
91700322 gao_wu_di B Sept. 3, 2020, 8:27 a.m. OK MS C++ 2017 TESTS 2 15 0
90437219 vjudge1 B Aug. 20, 2020, 6:15 a.m. OK MS C++ 2017 TESTS 2 31 0
90468240 wei.youmn B Aug. 20, 2020, 1:55 p.m. OK MS C++ 2017 TESTS 2 31 0
91629454 registuv B Sept. 2, 2020, 9:53 a.m. OK MS C++ 2017 TESTS 2 31 0
91089650 jacob31 B Aug. 26, 2020, 8:24 p.m. OK MS C++ 2017 TESTS 2 46 0
91605167 Shimos191211 B Sept. 2, 2020, 1:34 a.m. OK MS C++ 2017 TESTS 2 46 0
91702400 ARTO B Sept. 3, 2020, 9 a.m. OK MS C++ 2017 TESTS 2 46 0
91549446 psb2942 B Sept. 1, 2020, 8:39 a.m. OK MS C++ 2017 TESTS 2 46 0
91277872 Alzamer B Aug. 29, 2020, 10:51 a.m. OK MS C++ 2017 TESTS 2 46 0
91267339 concept3d B Aug. 29, 2020, 8:10 a.m. OK MS C++ 2017 TESTS 2 46 0
90866923 japyscript B Aug. 25, 2020, 4:21 a.m. OK Node.js TESTS 2 93 4915200
90589830 Fatelon B Aug. 21, 2020, 3:39 p.m. OK Node.js TESTS 2 93 16384000
90375207 john_theBlond B Aug. 19, 2020, 9:24 a.m. OK Node.js TESTS 2 186 5120000
90889695 roman.khabibulin B Aug. 25, 2020, 10:17 a.m. OK PHP TESTS 2 61 0
91233620 yumtam B Aug. 28, 2020, 5:41 p.m. OK PyPy 2 TESTS 2 124 2150400
90876980 rkat7 B Aug. 25, 2020, 7:16 a.m. OK PyPy 2 TESTS 2 139 3686400
90266245 MA123 B Aug. 17, 2020, 10:50 p.m. OK PyPy 3 TESTS 2 171 3276800
90235756 prateek_sahu B Aug. 17, 2020, 2:10 p.m. OK PyPy 3 TESTS 2 171 4198400
91205296 cpicard443 B Aug. 28, 2020, 12:01 p.m. OK PyPy 3 TESTS 2 186 4198400
90235937 prateek_sahu B Aug. 17, 2020, 2:12 p.m. OK PyPy 3 TESTS 2 202 3584000
91318469 enloh1 B Aug. 30, 2020, 2:07 a.m. OK PyPy 3 TESTS 2 202 4096000
90377388 Naman_Tyagi B Aug. 19, 2020, 9:57 a.m. OK PyPy 3 TESTS 2 218 4300800
91685075 jdiamond B Sept. 3, 2020, 3:52 a.m. OK PyPy 3 TESTS 2 218 4505600
91100519 SubsTheTechnomancer B Aug. 27, 2020, 3:40 a.m. OK PyPy 3 TESTS 2 218 4505600
90367240 ashish_sasmal B Aug. 19, 2020, 7:29 a.m. OK PyPy 3 TESTS 2 218 5939200
90176006 vesko.r.zdravkov B Aug. 16, 2020, 8:28 p.m. OK PyPy 3 TESTS 2 233 5427200
90949010 adyrek B Aug. 25, 2020, 3:35 p.m. OK Python 3 TESTS 2 93 204800
90518066 nikhita5a6 B Aug. 21, 2020, 9:10 a.m. OK Python 3 TESTS 2 93 6656000
91704035 ravi_sah B Sept. 3, 2020, 9:26 a.m. OK Python 3 TESTS 2 108 0
91506612 Shirbo B Aug. 31, 2020, 3:52 p.m. OK Python 3 TESTS 2 108 307200
91277459 snkpurty003 B Aug. 29, 2020, 10:44 a.m. OK Python 3 TESTS 2 108 307200
91119481 samiksha003 B Aug. 27, 2020, 9:16 a.m. OK Python 3 TESTS 2 108 307200
91067175 dato2017 B Aug. 26, 2020, 3:13 p.m. OK Python 3 TESTS 2 108 307200
91005859 Orblics B Aug. 25, 2020, 10:50 p.m. OK Python 3 TESTS 2 108 307200
90457566 Excelsior4U B Aug. 20, 2020, 11:22 a.m. OK Python 3 TESTS 2 108 307200
90419928 Evilknight B Aug. 19, 2020, 8:44 p.m. OK Python 3 TESTS 2 108 307200
90330396 piyushsawaria B Aug. 18, 2020, 4:57 p.m. OK Ruby TESTS 2 576 819200
90855255 myduomilia B Aug. 24, 2020, 7:25 p.m. OK Rust TESTS 2 30 0
90069956 Ballu-Bhai B Aug. 16, 2020, 9 a.m. OK Rust TESTS 2 30 0
90066958 Ballu-Bhai B Aug. 16, 2020, 8:07 a.m. OK Rust TESTS 2 30 0
90054729 chicken1925 B Aug. 16, 2020, 3:43 a.m. OK Rust TESTS 2 30 0
90776615 survived B Aug. 23, 2020, 5:40 p.m. OK Rust TESTS 2 30 3891200
90100001 buenasdiaz B Aug. 16, 2020, 2:48 p.m. OK Scala TESTS 2 561 204800

remove filters

Back to search problems