Educational Codeforces Round 19

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
797 Educational Codeforces Round 19 FINISHED False 7200 245172287 April 15, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1248 ) F Mice and Holes PROGRAMMING data structures dp greedy sortings 2600

B'One day Masha came home and noticed n mice in the corridor of her flat. Of course, she shouted loudly, so scared mice started to run to the holes in the corridor. The corridor can be represeted as a numeric axis with n mice and m holes on it. ith mouse is at the coordinate xi, and jth hole -- at coordinate pj. jth hole has enough room for cj mice, so not more than cj mice can enter this hole. What is the minimum sum of distances that mice have to go through so that they all can hide in the holes? If ith mouse goes to the hole j, then its distance is |xi xe2 x80 x89- xe2 x80 x89pj|. Print the minimum sum of distances. The first line contains two integer numbers n, m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895000) -- the number of mice and the number of holes, respectively. The second line contains n integers x1, xe2 x80 x89x2, xe2 x80 x89..., xe2 x80 x89xn ( xe2 x80 x89- xe2 x80 x89109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), where xi is the coordinate of ith mouse. Next m lines contain pairs of integer numbers pj, xe2 x80 x89cj ( xe2 x80 x89- xe2 x80 x89109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pj xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89cj xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895000), where pj is the coordinate of jth hole, and cj is the maximum number of mice that can hide in the hole j. Print one integer number -- the minimum sum of distances. If there is no solution, print -1 instead. '...

Tutorials

51588

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
30747615 yhy F Sept. 26, 2017, 10:50 a.m. OK GNU C++ TESTS 56 15 204800 2600
27481448 150420 F June 1, 2017, 9:28 a.m. OK GNU C++ TESTS 56 15 307200 2600
27479207 laofudasuan F June 1, 2017, 6:58 a.m. OK GNU C++ TESTS 56 15 1433600 2600
40981757 ReaLNero1 F July 30, 2018, 6:07 p.m. OK GNU C++ TESTS 56 31 307200 2600
40981199 ReaLNero1 F July 30, 2018, 5:52 p.m. OK GNU C++ TESTS 56 31 1433600 2600
26601736 1629338 F April 23, 2017, 10:52 a.m. OK GNU C++ TESTS 56 124 2252800 2600
27404146 150420 F May 28, 2017, 8:23 a.m. OK GNU C++ TESTS 56 202 0 2600
27330716 AkaneSasu F May 25, 2017, 6:47 a.m. OK GNU C++ TESTS 56 202 409600 2600
29795297 vjudge4 F Aug. 26, 2017, 2:23 a.m. OK GNU C++ TESTS 56 249 307200 2600
29603575 vjudge4 F Aug. 19, 2017, 4:31 p.m. OK GNU C++ TESTS 56 264 205824000 2600
29865359 laofudasuan F Aug. 29, 2017, 12:10 p.m. OK GNU C++11 TESTS 56 15 1433600 2600
32096772 wfj_2048 F Nov. 6, 2017, 1:22 p.m. OK GNU C++11 TESTS 56 15 16588800 2600
33153302 laofudasuan F Dec. 12, 2017, 11:34 a.m. OK GNU C++11 TESTS 56 15 98304000 2600
37510474 KMAASZRAA F April 21, 2018, 10 a.m. OK GNU C++11 TESTS 56 30 4300800 2600
67684857 EternalAlexander F Dec. 27, 2019, 8:23 a.m. OK GNU C++11 TESTS 56 31 819200 2600
69614528 vjudge3 F Jan. 27, 2020, 12:41 p.m. OK GNU C++11 TESTS 56 31 1433600 2600
37211717 RNS_MHB F April 11, 2018, 9:11 a.m. OK GNU C++11 TESTS 56 31 4608000 2600
48421346 star_magic_young F Jan. 15, 2019, 12:57 p.m. OK GNU C++11 TESTS 56 31 9523200 2600
69599893 luogu_bot4 F Jan. 27, 2020, 6:58 a.m. OK GNU C++11 TESTS 56 31 16486400 2600
64073343 luogu_bot1 F Nov. 2, 2019, 8:08 a.m. OK GNU C++11 TESTS 56 31 16588800 2600
30754123 lizhidan F Sept. 26, 2017, 2:46 p.m. OK GNU C++14 TESTS 56 30 512000 2600
65696098 latte0119 F Nov. 25, 2019, 8:16 a.m. OK GNU C++14 TESTS 56 31 819200 2600
69519198 iotang F Jan. 25, 2020, 12:56 p.m. OK GNU C++14 TESTS 56 31 1024000 2600
48405922 Itst F Jan. 15, 2019, 3:39 a.m. OK GNU C++14 TESTS 56 31 5427200 2600
32149718 Super_Nick F Nov. 9, 2017, 2:16 a.m. OK GNU C++14 TESTS 56 31 16281600 2600
69599946 vjudge4 F Jan. 27, 2020, 7 a.m. OK GNU C++14 TESTS 56 31 16691200 2600
69599804 dsl2002 F Jan. 27, 2020, 6:55 a.m. OK GNU C++14 TESTS 56 31 16691200 2600
26538858 unused F April 21, 2017, 1:45 p.m. OK GNU C++14 TESTS 56 31 32768000 2600
65695898 latte0119 F Nov. 25, 2019, 8:09 a.m. OK GNU C++14 TESTS 56 46 819200 2600
65695561 latte0119 F Nov. 25, 2019, 7:55 a.m. OK GNU C++14 TESTS 56 46 819200 2600
69519335 vjudge3 F Jan. 25, 2020, 12:58 p.m. OK GNU C++17 TESTS 56 31 1024000 2600
53111695 aaa2333333 F April 22, 2019, 3:51 a.m. OK GNU C++17 TESTS 56 31 2764800 2600
48405894 Itst F Jan. 15, 2019, 3:37 a.m. OK GNU C++17 TESTS 56 31 5734400 2600
69591022 vjudge4 F Jan. 26, 2020, 11:29 p.m. OK GNU C++17 TESTS 56 46 16384000 2600
69516904 vjudge2 F Jan. 25, 2020, 12:17 p.m. OK GNU C++17 TESTS 56 46 56115200 2600
51216214 Elegia F March 12, 2019, 10:35 a.m. OK GNU C++17 TESTS 56 217 204800 2600
61189756 lovefnq F Sept. 24, 2019, 1:56 a.m. OK GNU C++17 TESTS 56 218 4198400 2600
52495210 hmc F April 8, 2019, 1:23 p.m. OK GNU C++17 TESTS 56 234 204800 2600
48195678 how_to_become_purple F Jan. 10, 2019, 9:48 p.m. OK GNU C++17 TESTS 56 265 614400 2600
63786858 klfly F Oct. 30, 2019, 12:34 p.m. OK GNU C++17 TESTS 56 280 200908800 2600
29432645 uwi F Aug. 13, 2017, 11:48 a.m. OK Java 8 TESTS 56 545 21299200 2600
29432584 uwi F Aug. 13, 2017, 11:46 a.m. OK Java 8 TESTS 56 545 21299200 2600
29427570 uwi F Aug. 13, 2017, 7:55 a.m. OK Java 8 TESTS 56 670 21401600 2600
27168557 jagauthier F May 16, 2017, 8:43 p.m. OK Java 8 TESTS 56 1372 260096000 2600
34473982 Los_Angelos_Laycurse F Jan. 23, 2018, 8:22 a.m. OK MS C++ TESTS 56 15 90214400 2600
27146545 _mactep F May 15, 2017, 10:11 p.m. OK MS C++ TESTS 56 218 409600 2600
44339069 vjudge4 F Oct. 15, 2018, 1:16 a.m. OK MS C++ TESTS 56 249 201420800 2600
43365026 2191699104 F Sept. 24, 2018, 11:48 a.m. OK MS C++ TESTS 56 280 307200 2600
26498785 marisuki F April 19, 2017, 3:08 p.m. OK MS C++ TESTS 56 373 203059200 2600
31183612 ddfsb F Oct. 10, 2017, 7:47 a.m. OK MS C++ TESTS 56 374 512000 2600
27146692 _mactep F May 15, 2017, 10:30 p.m. OK MS C++ TESTS 56 405 409600 2600

remove filters

Back to search problems