SWERC 2021-2022 - Online Mirror (Unrated, ICPC Rules, Teams Preferred)

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
1662 SWERC 2021-2022 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) FINISHED False 18000 86468063 April 24, 2022, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2242 ) I Ice Cream Shop PROGRAMMING sortings

B'On a beach there are n huts in a perfect line, hut 1 being at the left and hut i+1 being 100 meters to the right of hut i , for all 1 <= i <= n - 1 . In hut i there are p_i people. There are m ice cream sellers, also aligned in a perfect line with all the huts. The i -th ice cream seller has their shop x_i meters to the right of the first hut. All ice cream shops are at distinct locations, but they may be at the same location as a hut. You want to open a new ice cream shop and you wonder what the best location for your shop is. You can place your ice cream shop anywhere on the beach (not necessarily at an integer distance from the first hut) as long as it is aligned with the huts and the other ice cream shops, even if there is already another ice cream shop or a hut at that location. You know that people would come to your shop only if it is strictly closer to their hut than any other ice cream shop. If every person living in the huts wants to buy exactly one ice cream, what is the maximum number of ice creams that you can sell if you place the shop optimally? The first line contains two integers n and m ( 2 <= n <= 200 ,000 , 1 <= m <= 200 ,000 ) -- the number of huts and the number of ice cream sellers. The second line contains n integers p_1, p_2, ldots, p_n ( 1 <= p_i <= 10^9 ) -- the number of people in each hut. The third line contains m integers x_1, x_2, ldots, x_m ( 0 <= x_i <= 10^9 , x_i ne x_j for i ne j ) -- the location of each ice cream shop. Print the maximum number of ice creams that can be sold by choosing optimally the location of the new shop. In the first sample, you can place the shop (coloured orange in the picture below) 150 meters to the right of the first hut (for example) so that it is the closest shop to the first two huts, which have 2 and 5 people, for a total of 7$'...

Tutorials

102042

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154857611 YMlx WGYHMFkZyA02 wheneveright I April 24, 2022, 1:40 p.m. OK GNU C++14 TESTS 23 31 3686400
154847188 peiwenjun I April 24, 2022, 12:01 p.m. OK GNU C++14 TESTS 23 93 1638400
154842847 KillerX Eric_hooo He_Ren I April 24, 2022, 11:26 a.m. OK GNU C++14 TESTS 23 108 3174400
154847808 zhihei2000 x_faraway_x dujvet I April 24, 2022, 12:06 p.m. OK GNU C++14 TESTS 23 109 2457600
154847996 Jimanbanashi I April 24, 2022, 12:08 p.m. OK GNU C++14 TESTS 23 109 3174400
154862464 wizist I April 24, 2022, 2:28 p.m. OK GNU C++14 TESTS 23 124 3174400
154861703 wizist I April 24, 2022, 2:20 p.m. OK GNU C++14 TESTS 23 124 3174400
154849467 shayan_ebrahimi pnm1384 ParsaEs I April 24, 2022, 12:21 p.m. OK GNU C++14 TESTS 23 124 6451200
154854831 tk_sky YEWPO AntiOxygen I April 24, 2022, 1:13 p.m. OK GNU C++14 TESTS 23 124 7987200
154849137 eecs I April 24, 2022, 12:18 p.m. OK GNU C++14 TESTS 23 124 9932800
154871806 ugly2333 I April 24, 2022, 4:03 p.m. OK GNU C++17 TESTS 23 109 82841600
154843495 hank55663 I April 24, 2022, 11:31 a.m. OK GNU C++17 TESTS 23 124 2355200
154859656 MohammadAghil nebula I April 24, 2022, 1:59 p.m. OK GNU C++17 TESTS 23 124 2457600
154848751 rajkon CaptainAmazing I April 24, 2022, 12:15 p.m. OK GNU C++17 TESTS 23 124 3174400
154854973 sniper97 vilgax I April 24, 2022, 1:14 p.m. OK GNU C++17 TESTS 23 124 4812800
154864681 emonzhong I April 24, 2022, 2:53 p.m. OK GNU C++17 TESTS 23 124 11673600
154851723 jebouin I April 24, 2022, 12:42 p.m. OK GNU C++17 TESTS 23 140 5324800
154850989 hieplpvip ta4p _SS I April 24, 2022, 12:35 p.m. OK GNU C++17 TESTS 23 140 5939200
154847843 ARegularCoder akshatanand186 gakshat468 I April 24, 2022, 12:07 p.m. OK GNU C++17 TESTS 23 140 7987200
154843265 TeaTime Ormlis Pechalka I April 24, 2022, 11:29 a.m. OK GNU C++17 TESTS 23 140 8089600
154859241 Molly_Love_MAOoo MAOoo_Love_Molly I April 24, 2022, 1:56 p.m. OK GNU C++17 (64) TESTS 23 77 3174400
154881556 Egor.Lifar cookiedoth rqi I April 24, 2022, 6:23 p.m. OK GNU C++17 (64) TESTS 23 77 4812800
154903139 yaoveil I April 25, 2022, 4:29 a.m. OK GNU C++17 (64) TESTS 23 77 5632000
154845280 kostia244 KostasKostil VladProg I April 24, 2022, 11:45 a.m. OK GNU C++17 (64) TESTS 23 77 5632000
154847146 Raz HamletPetrosyan I April 24, 2022, noon OK GNU C++17 (64) TESTS 23 92 4812800
154845064 gs18115 Retro3014 Gom I April 24, 2022, 11:44 a.m. OK GNU C++17 (64) TESTS 23 93 2457600
154848838 Temmie I April 24, 2022, 12:16 p.m. OK GNU C++17 (64) TESTS 23 93 4812800
154845210 Siberian _tryhard alexxela12345 I April 24, 2022, 11:45 a.m. OK GNU C++17 (64) TESTS 23 93 5324800
154903062 yaoveil I April 25, 2022, 4:27 a.m. OK GNU C++17 (64) TESTS 23 93 5632000
154846131 yuanhaowei TsukasaYuzaki I April 24, 2022, 11:52 a.m. OK GNU C++17 (64) TESTS 23 93 6451200
154844054 lucifer1004 Milesian liouzhou_101 I April 24, 2022, 11:35 a.m. OK GNU C++20 (64) TESTS 23 31 15974400
154859691 ueurwieuzzzzz I April 24, 2022, 2 p.m. OK GNU C++20 (64) TESTS 23 61 5632000
154848856 Arayi I April 24, 2022, 12:16 p.m. OK GNU C++20 (64) TESTS 23 61 12083200
154855728 christchurch swz geospiza I April 24, 2022, 1:22 p.m. OK GNU C++20 (64) TESTS 23 62 4812800
154850136 HeartFireY gongkoufadongji yezzz I April 24, 2022, 12:27 p.m. OK GNU C++20 (64) TESTS 23 62 6451200
154849329 The_Joker2000 I April 24, 2022, 12:20 p.m. OK GNU C++20 (64) TESTS 23 62 6451200
154846272 A05 I April 24, 2022, 11:53 a.m. OK GNU C++20 (64) TESTS 23 62 6451200
154851820 Prgl2001 gu76h zzqwtc I April 24, 2022, 12:43 p.m. OK GNU C++20 (64) TESTS 23 77 4812800
154844060 Davoth AmShZ Keshi I April 24, 2022, 11:35 a.m. OK GNU C++20 (64) TESTS 23 77 4812800
154848492 sare pooya-shams radal I April 24, 2022, 12:12 p.m. OK GNU C++20 (64) TESTS 23 77 7270400
154906703 19acm I April 25, 2022, 5:42 a.m. OK MS C++ 2017 TESTS 23 248 182784000
154850904 CrashMaster I April 24, 2022, 12:35 p.m. OK MS C++ 2017 TESTS 23 498 163532800
154862813 XYShaoKang I April 24, 2022, 2:32 p.m. OK Node.js TESTS 23 249 34406400
154854506 RUSH_D_CAT limbo.null NecroSean38 I April 24, 2022, 1:09 p.m. OK PyPy 3 TESTS 23 1528 41676800
154858118 huangxw I April 24, 2022, 1:45 p.m. OK PyPy 3-64 TESTS 23 202 36249600
154854209 N00BGH0ST I April 24, 2022, 1:06 p.m. OK PyPy 3-64 TESTS 23 467 29696000
154854196 dyppp I April 24, 2022, 1:06 p.m. OK PyPy 3-64 TESTS 23 764 97075200
154905852 Owi I April 25, 2022, 5:24 a.m. OK Python 3 TESTS 23 748 19968000
154905692 Owi I April 25, 2022, 5:21 a.m. OK Python 3 TESTS 23 748 19968000
154890987 Tistou I April 24, 2022, 9:17 p.m. OK Python 3 TESTS 23 1263 43212800

remove filters

Back to search problems