Codeforces Round 251 (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
439 Codeforces Round 251 (Div. 2) FINISHED False 7200 329927399 June 4, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6128 ) D Devu and his Brother PROGRAMMING binary search sortings ternary search two pointers 1900

B"Devu and his brother love each other a lot. As they are super geeks, they only like to play with arrays. They are given two arrays a and b by their father. The array a is given to Devu and b to his brother. As Devu is really a naughty kid, he wants the minimum value of his array a should be at least as much as the maximum value of his brother's array b. Now you have to help Devu in achieving this condition. You can perform multiple operations on the arrays. In a single operation, you are allowed to decrease or increase any element of any of the arrays by 1. Note that you are allowed to apply the operation on any index of the array multiple times. You need to find minimum number of operations required to satisfy Devu's condition so that the brothers can play peacefully without fighting. The first line contains two space-separated integers n, m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The second line will contain n space-separated integers representing content of the array a (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). The third line will contain m space-separated integers representing content of the array b (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). You need to output a single integer representing the minimum number of operations needed to satisfy Devu's condition. In example 1, you can increase a1 by 1 and decrease b2 by 1 and then again decrease b2 by 1. Now array a will be [3; 3] and array b will also be [3; 3]. Here minimum element of a is at least as large as maximum element of b. So minimum number of operations needed to satisfy Devu's condition are 3. In example 3, you don't need to do any operation, Devu's condition is already satisfied. "...

Tutorials

Codeforces Round #251 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56689444 danielbgm D July 8, 2019, 2:36 a.m. OK Clang++17 Diagnostics TESTS 70 779 0 1900
18172042 Gray_58 D May 31, 2016, 4:58 p.m. OK FPC TESTS 70 77 3072000 1900
12058540 newp D July 14, 2015, 5:18 p.m. OK FPC TESTS 70 109 819200 1900
29509945 T.S.H.T D Aug. 16, 2017, 4:33 p.m. OK FPC TESTS 70 124 819200 1900
53785392 chaorenhaha D May 5, 2019, 9:58 a.m. OK FPC TESTS 70 124 7987200 1900
32483766 TShT D Nov. 19, 2017, 8:43 p.m. OK FPC TESTS 70 124 17612800 1900
13113798 RomanDerkach D Sept. 20, 2015, 11:56 a.m. OK FPC TESTS 70 156 3379200 1900
19520661 vkozlovs D July 30, 2016, 3:42 p.m. OK FPC TESTS 70 171 1740800 1900
22855387 ice_tea D Dec. 10, 2016, 12:32 p.m. OK FPC TESTS 70 171 3174400 1900
9719375 AhmedElsayedMahmoud D Feb. 4, 2015, 4:26 p.m. OK GNU C TESTS 70 78 819200 1900
9692866 AhmedElsayedMahmoud D Feb. 2, 2015, 9:54 p.m. OK GNU C TESTS 70 78 819200 1900
18989607 vjudge1 D July 9, 2016, 5:11 p.m. OK GNU C TESTS 70 108 3174400 1900
11342213 optimus___prime D May 29, 2015, 7:32 a.m. OK GNU C TESTS 70 108 3174400 1900
18989559 answer3tl D July 9, 2016, 5:07 p.m. OK GNU C TESTS 70 109 3174400 1900
18989577 vjudge2 D July 9, 2016, 5:09 p.m. OK GNU C TESTS 70 124 3174400 1900
37641726 reyad D April 26, 2018, 3:35 p.m. OK GNU C TESTS 70 124 8089600 1900
10975571 joaolago D May 2, 2015, 2:39 p.m. OK GNU C TESTS 70 327 2662400 1900
15634704 ---___--- D Jan. 28, 2016, 6:32 p.m. OK GNU C++ TESTS 70 31 819200 1900
15634675 ---___--- D Jan. 28, 2016, 6:30 p.m. OK GNU C++ TESTS 70 31 819200 1900
40988355 ReaLNero1 D July 30, 2018, 9:55 p.m. OK GNU C++ TESTS 70 46 819200 1900
13502309 lcr D Oct. 9, 2015, 1:07 a.m. OK GNU C++ TESTS 70 46 819200 1900
11697788 vjudge2 D June 21, 2015, 1:52 p.m. OK GNU C++ TESTS 70 46 4812800 1900
27421801 vjudge3 D May 29, 2017, 1:46 a.m. OK GNU C++ TESTS 70 46 47923200 1900
40409868 vjudge3 D July 16, 2018, 11:54 a.m. OK GNU C++ TESTS 70 62 819200 1900
40400642 vjudge4 D July 16, 2018, 7:29 a.m. OK GNU C++ TESTS 70 62 819200 1900
22039353 hloya_ygrt D Nov. 4, 2016, 5:09 p.m. OK GNU C++ TESTS 70 62 819200 1900
22026555 wangshuo D Nov. 4, 2016, 4:13 a.m. OK GNU C++ TESTS 70 62 819200 1900
9815906 ho-jo-bo-ro-lo D Feb. 13, 2015, 12:34 p.m. OK GNU C++0x TESTS 70 171 1638400 1900
10258614 sonlh07 D March 13, 2015, 2:05 p.m. OK GNU C++0x TESTS 70 171 2457600 1900
10257303 sonlh07 D March 13, 2015, 12:18 p.m. OK GNU C++0x TESTS 70 202 819200 1900
9721210 ygv17 D Feb. 4, 2015, 8:06 p.m. OK GNU C++0x TESTS 70 468 1638400 1900
9721139 ygv17 D Feb. 4, 2015, 7:57 p.m. OK GNU C++0x TESTS 70 468 5324800 1900
9567685 Dirak D Jan. 27, 2015, 3 a.m. OK GNU C++0x TESTS 70 499 1638400 1900
9817714 Rainto96 D Feb. 13, 2015, 3:34 p.m. OK GNU C++0x TESTS 70 530 39321600 1900
57957747 rainboy D July 29, 2019, 7:44 p.m. OK GNU C11 TESTS 70 93 3174400 1900
12320389 PPFish D Aug. 3, 2015, 3:15 a.m. OK GNU C++11 TESTS 70 46 819200 1900
43261596 BriMon D Sept. 22, 2018, 2:58 p.m. OK GNU C++11 TESTS 70 46 1126400 1900
43261664 BriMon D Sept. 22, 2018, 2:59 p.m. OK GNU C++11 TESTS 70 46 1126400 1900
23361703 habib_rahman D Dec. 27, 2016, 3:11 p.m. OK GNU C++11 TESTS 70 46 3686400 1900
10832077 dashuiren D April 23, 2015, 8 a.m. OK GNU C++11 TESTS 70 46 6758400 1900
15069100 khatribiru D Dec. 28, 2015, 10:43 a.m. OK GNU C++11 TESTS 70 46 16076800 1900
12676070 MrNull D Aug. 23, 2015, 5:45 p.m. OK GNU C++11 TESTS 70 61 819200 1900
19476085 Yellowstar D July 29, 2016, 8:50 a.m. OK GNU C++11 TESTS 70 61 1433600 1900
20295639 _Saitama_ D Aug. 31, 2016, 7 a.m. OK GNU C++11 TESTS 70 61 3174400 1900
11053782 wumaodang D May 9, 2015, 10:22 a.m. OK GNU C++11 TESTS 70 62 614400 1900
56531796 Phortox D July 4, 2019, 8:13 p.m. OK GNU C++14 TESTS 70 62 2764800 1900
31922415 sarthak0797 D Oct. 31, 2017, 1:18 p.m. OK GNU C++14 TESTS 70 77 819200 1900
55565624 bluejay D June 14, 2019, 3:16 p.m. OK GNU C++14 TESTS 70 77 819200 1900
35157793 Simon7426 D Feb. 11, 2018, 3:56 p.m. OK GNU C++14 TESTS 70 77 2662400 1900
56534186 Phortox D July 4, 2019, 10:23 p.m. OK GNU C++14 TESTS 70 77 2764800 1900
56531947 Phortox D July 4, 2019, 8:21 p.m. OK GNU C++14 TESTS 70 77 2969600 1900
58485157 bojverdict2 D Aug. 9, 2019, 7:22 a.m. OK GNU C++14 TESTS 70 78 819200 1900
55988503 Wu-Kong D June 24, 2019, 6:07 a.m. OK GNU C++14 TESTS 70 78 819200 1900
51763346 mostafa_saeed D March 23, 2019, 2:42 p.m. OK GNU C++14 TESTS 70 78 819200 1900
61579572 vjudge4 D Oct. 1, 2019, 12:30 a.m. OK GNU C++14 TESTS 70 78 819200 1900
62239528 NoName0000 D Oct. 10, 2019, 12:45 a.m. OK GNU C++17 TESTS 70 78 819200 1900
58702869 bojverdict2 D Aug. 13, 2019, 8:26 a.m. OK GNU C++17 TESTS 70 78 819200 1900
57739971 cfmaster D July 25, 2019, 11:09 a.m. OK GNU C++17 TESTS 70 78 819200 1900
56252244 mlyean D June 29, 2019, 4:12 a.m. OK GNU C++17 TESTS 70 78 819200 1900
47310256 R_S_A_ D Dec. 20, 2018, 7:17 p.m. OK GNU C++17 TESTS 70 78 819200 1900
46659724 Laboon D Dec. 5, 2018, 6:29 p.m. OK GNU C++17 TESTS 70 78 819200 1900
41447429 yuhta D Aug. 11, 2018, 1:38 a.m. OK GNU C++17 TESTS 70 78 819200 1900
39953425 arbitrary_A D July 4, 2018, 11:39 a.m. OK GNU C++17 TESTS 70 78 819200 1900
66072017 golikovnik D Nov. 30, 2019, 8:03 p.m. OK GNU C++17 TESTS 70 78 819200 1900
55741917 YinR D June 19, 2019, 7:55 a.m. OK GNU C++17 TESTS 70 78 1536000 1900
68301760 synapse D Jan. 6, 2020, 6:59 a.m. OK Go TESTS 70 233 4505600 1900
68301853 synapse D Jan. 6, 2020, 7:02 a.m. OK Go TESTS 70 234 4505600 1900
59981894 serhiimazurok D Sept. 4, 2019, 8:46 a.m. OK Go TESTS 70 546 4505600 1900
60020637 serhiimazurok D Sept. 4, 2019, 1:01 p.m. OK Go TESTS 70 951 4505600 1900
67248865 Oom D Dec. 19, 2019, 6:14 p.m. OK Java 11 TESTS 70 280 2969600 1900
17168147 yrjie D April 5, 2016, 8:56 a.m. OK Java 7 TESTS 70 202 38912000 1900
10200910 bero D March 8, 2015, 6:01 a.m. OK Java 7 TESTS 70 264 0 1900
16888525 niting112 D March 23, 2016, 3:01 p.m. OK Java 7 TESTS 70 577 39628800 1900
10664865 Sumeet.Varma D April 12, 2015, 9:23 a.m. OK Java 7 TESTS 70 623 0 1900
12471285 dhwanilpatel D Aug. 11, 2015, 8:45 p.m. OK Java 8 TESTS 70 140 0 1900
60950738 Anonymous D Sept. 20, 2019, 9:34 p.m. OK Java 8 TESTS 70 171 0 1900
39774816 ShowStopper728 D June 29, 2018, 4:48 p.m. OK Java 8 TESTS 70 187 0 1900
54531328 _Sergey_ D May 23, 2019, 5:12 p.m. OK Java 8 TESTS 70 187 2969600 1900
54530504 _Sergey_ D May 23, 2019, 4:48 p.m. OK Java 8 TESTS 70 187 2969600 1900
57264523 In_The_Name_Of_Love D July 18, 2019, 6:38 a.m. OK Java 8 TESTS 70 202 0 1900
9745073 essar D Feb. 7, 2015, 1:38 p.m. OK Java 8 TESTS 70 202 0 1900
50545146 Solo_Player. D Feb. 26, 2019, 8:44 p.m. OK Java 8 TESTS 70 202 4198400 1900
33049747 parth_15 D Dec. 9, 2017, 1:11 p.m. OK Java 8 TESTS 70 202 20684800 1900
38099747 ViciousCoder D May 10, 2018, 6:52 p.m. OK Java 8 TESTS 70 202 20787200 1900
43623707 igorpastukh D Sept. 30, 2018, 8:42 p.m. OK Mono C# TESTS 70 124 23654400 1900
51961348 hongquanntct D March 29, 2019, 7 a.m. OK Mono C# TESTS 70 171 39833600 1900
51961197 hongquanntct D March 29, 2019, 6:54 a.m. OK Mono C# TESTS 70 218 29798400 1900
9620215 HeshamMeneisi D Jan. 29, 2015, 9:42 p.m. OK MS C# TESTS 70 124 23654400 1900
9455759 camypaper D Jan. 18, 2015, 12:09 p.m. OK MS C# TESTS 70 140 8089600 1900
15346892 m1gu3l D Jan. 14, 2016, 4:33 p.m. OK MS C# TESTS 70 202 24883200 1900
15970229 dilshodp D Feb. 12, 2016, 12:01 p.m. OK MS C++ TESTS 70 62 819200 1900
10350091 a88027180 D March 19, 2015, 2:52 p.m. OK MS C++ TESTS 70 77 1638400 1900
29353067 vjudge1 D Aug. 11, 2017, 12:43 p.m. OK MS C++ TESTS 70 77 3686400 1900
48991846 vjudge4 D Jan. 26, 2019, 2:45 p.m. OK MS C++ TESTS 70 93 819200 1900
44567590 vjudge1 D Oct. 20, 2018, 2:09 a.m. OK MS C++ TESTS 70 109 819200 1900
15324356 Sandmann D Jan. 13, 2016, 12:09 a.m. OK MS C++ TESTS 70 140 4915200 1900
15160065 NVAL D Jan. 2, 2016, 3:38 p.m. OK MS C++ TESTS 70 187 8806400 1900
12260163 Alex_Moor D July 29, 2015, 6:22 a.m. OK MS C++ TESTS 70 202 819200 1900
12260339 Alex_Moor D July 29, 2015, 6:35 a.m. OK MS C++ TESTS 70 202 819200 1900
12217666 vjudge5 D July 24, 2015, 6:02 p.m. OK MS C++ TESTS 70 202 819200 1900
55738426 IntoSpring D June 19, 2019, 6:02 a.m. OK MS C++ 2017 TESTS 70 93 1638400 1900
58171372 yorky D Aug. 2, 2019, 11:27 a.m. OK MS C++ 2017 TESTS 70 218 3174400 1900
62321075 vladnoov D Oct. 10, 2019, 4:46 p.m. OK MS C++ 2017 TESTS 70 234 1638400 1900
51328550 YoussefRaafatNasry D March 15, 2019, 11:07 a.m. OK MS C++ 2017 TESTS 70 280 2150400 1900
51328409 YoussefRaafatNasry D March 15, 2019, 11:03 a.m. OK MS C++ 2017 TESTS 70 296 2150400 1900
61918777 Boryan07 D Oct. 5, 2019, 12:48 p.m. OK MS C++ 2017 TESTS 70 561 1638400 1900
15037430 poikniok D Dec. 26, 2015, 8:52 p.m. OK PyPy 2 TESTS 70 327 18636800 1900
49030159 aeternalis1 D Jan. 26, 2019, 9:31 p.m. OK PyPy 2 TESTS 70 530 11059200 1900
49054957 Zeyu D Jan. 27, 2019, 12:53 p.m. OK PyPy 2 TESTS 70 889 11059200 1900
61574454 sdhd D Sept. 30, 2019, 8:02 p.m. OK PyPy 3 TESTS 70 374 13312000 1900
15037434 poikniok D Dec. 26, 2015, 8:52 p.m. OK PyPy 3 TESTS 70 514 21196800 1900
11505110 poikniok D June 9, 2015, 5:04 a.m. OK PyPy 3 TESTS 70 529 21504000 1900
11505101 poikniok D June 9, 2015, 5:03 a.m. OK PyPy 3 TESTS 70 545 21913600 1900
57800737 Honey_Badger D July 26, 2019, 1:10 p.m. OK PyPy 3 TESTS 70 857 13414400 1900
9674860 zoomer D Feb. 2, 2015, 11:19 a.m. OK Python 2 TESTS 70 265 7782400 1900
11361515 Mr.Bluesman D May 30, 2015, 11:37 p.m. OK Python 2 TESTS 70 280 7782400 1900
35872194 ______u______ D March 3, 2018, 7:04 a.m. OK Python 2 TESTS 70 280 12595200 1900
35872092 ______n______ D March 3, 2018, 7:04 a.m. OK Python 2 TESTS 70 280 12595200 1900
35871495 _____i_____ D March 3, 2018, 6:52 a.m. OK Python 2 TESTS 70 280 12595200 1900
35871479 _____k_____ D March 3, 2018, 6:52 a.m. OK Python 2 TESTS 70 280 12595200 1900
35862489 ______k______ D March 2, 2018, 10:26 p.m. OK Python 2 TESTS 70 280 12595200 1900
35862468 ______h______ D March 2, 2018, 10:26 p.m. OK Python 2 TESTS 70 280 12595200 1900
35862184 ______i______ D March 2, 2018, 10:19 p.m. OK Python 2 TESTS 70 280 12595200 1900
35860473 ______M______ D March 2, 2018, 9:42 p.m. OK Python 2 TESTS 70 280 12595200 1900
39953914 arbitrary_A D July 4, 2018, 11:54 a.m. OK Python 3 TESTS 70 327 10547200 1900
19181113 future_loops D July 16, 2016, 11:58 p.m. OK Python 3 TESTS 70 373 10854400 1900

remove filters

Back to search problems