Codeforces Round 583 (Div. 1 + Div. 2, based on Olympiad of Metropolises)

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
1214 Codeforces Round 583 (Div. 1 + Div. 2, based on Olympiad of Metropolises) FINISHED False 9000 169851287 Sept. 4, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 463 ) F Employment PROGRAMMING greedy sortings 2700

B'Two large companies "Cecsi" and "Poca Pola" are fighting against each other for a long time. In order to overcome their competitor, "Poca Pola" started a super secret project, for which it has total n vacancies in all of their offices. After many tests and interviews n candidates were selected and the only thing left was their employment. Because all candidates have the same skills, it doesn 't matter where each of them will work. That is why the company decided to distribute candidates between workplaces so that the total distance between home and workplace over all candidates is minimal. It is well known that Earth is round, so it can be described as a circle, and all m cities on Earth can be described as points on this circle. All cities are enumerated from 1 to m so that for each i ( 1 <= i <= m - 1 ) cities with indexes i and i + 1 are neighbors and cities with indexes 1 and m are neighbors as well. People can move only along the circle. The distance between any two cities equals to minimal number of transitions between neighboring cities you have to perform to get from one city to another. In particular, the distance between the city and itself equals 0 . The "Poca Pola" vacancies are located at offices in cities a_1, a_2, ldots, a_n . The candidates live in cities b_1, b_2, ldots, b_n . It is possible that some vacancies are located in the same cities and some candidates live in the same cities. The "Poca Pola" managers are too busy with super secret project, so you were asked to help "Poca Pola" to distribute candidates between workplaces, so that the sum of the distance between home and workplace over all candidates is minimum possible. The first line contains two integers m and n ( 1 <= m <= 10^9 , 1 <= n <= 200 ,000 ) -- the number of cities on Earth and the number of vacancies. The second line contains n integers a_1, a_2, a_3,'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
60012089 hos.lyric F Sept. 4, 2019, 11:14 a.m. OK D TESTS 127 795 95027200 2700
60015441 LJC00118 F Sept. 4, 2019, 11:32 a.m. OK GNU C++11 TESTS 127 93 7987200 2700
60515491 11235813213455 F Sept. 14, 2019, 6:21 a.m. OK GNU C++11 TESTS 128 109 7475200 2700
60052389 daydream. F Sept. 5, 2019, 1:29 a.m. OK GNU C++11 TESTS 128 109 36966400 2700
60332912 AutumnKite F Sept. 10, 2019, 7:02 a.m. OK GNU C++11 TESTS 128 124 16691200 2700
66251252 cuizhuyefei F Dec. 4, 2019, 2:04 a.m. OK GNU C++11 TESTS 128 124 26521600 2700
60018886 ohweonfire F Sept. 4, 2019, 12:39 p.m. OK GNU C++11 TESTS 127 139 11878400 2700
60332960 AutumnKite F Sept. 10, 2019, 7:03 a.m. OK GNU C++11 TESTS 128 139 16691200 2700
61047779 sunyx F Sept. 22, 2019, 5:18 a.m. OK GNU C++11 TESTS 128 140 7270400 2700
68383433 hjsjhn F Jan. 8, 2020, 3:51 a.m. OK GNU C++11 TESTS 128 140 12083200 2700
60376688 zjczzzjczjczzzjc F Sept. 11, 2019, 6:57 a.m. OK GNU C++11 TESTS 128 140 27033600 2700
64174996 gs12117 F Nov. 3, 2019, 8:21 p.m. OK GNU C++14 TESTS 128 186 9011200 2700
60070582 coderharshit F Sept. 5, 2019, 11 a.m. OK GNU C++14 TESTS 128 186 17612800 2700
60447751 fsociety00 F Sept. 12, 2019, 2:45 p.m. OK GNU C++14 TESTS 128 187 3993600 2700
60080289 idxcalcal F Sept. 5, 2019, 1:47 p.m. OK GNU C++14 TESTS 128 187 11468800 2700
60227233 DimmyT F Sept. 7, 2019, 3:26 p.m. OK GNU C++14 TESTS 128 187 12083200 2700
65906635 KeyID F Nov. 28, 2019, 11:13 a.m. OK GNU C++14 TESTS 128 187 13619200 2700
60374477 vjudge2 F Sept. 11, 2019, 5:33 a.m. OK GNU C++14 TESTS 128 187 13619200 2700
60200505 rhrnald F Sept. 7, 2019, 5:21 a.m. OK GNU C++14 TESTS 128 187 25395200 2700
60028839 Shirley_lf F Sept. 4, 2019, 2:51 p.m. OK GNU C++14 TESTS 128 187 29081600 2700
60165229 dev_cpp F Sept. 6, 2019, 10:38 a.m. OK GNU C++14 TESTS 128 202 5632000 2700
60040085 lesskreker F Sept. 4, 2019, 6:02 p.m. OK GNU C++17 TESTS 128 109 12083200 2700
64322217 user202729_ F Nov. 5, 2019, 4:02 p.m. OK GNU C++17 TESTS 128 187 11264000 2700
60176453 song666 F Sept. 6, 2019, 2:36 p.m. OK GNU C++17 TESTS 128 187 16076800 2700
61318627 bibibibi F Sept. 26, 2019, 11:53 a.m. OK GNU C++17 TESTS 128 187 18432000 2700
60067904 __JuRuo F Sept. 5, 2019, 9:55 a.m. OK GNU C++17 TESTS 128 202 7372800 2700
60035325 Benq F Sept. 4, 2019, 4:36 p.m. OK GNU C++17 TESTS 128 202 8806400 2700
60012431 imeimi F Sept. 4, 2019, 11:15 a.m. OK GNU C++17 TESTS 127 202 10444800 2700
60009696 tEMMIE.w. F Sept. 4, 2019, 10:59 a.m. OK GNU C++17 TESTS 127 202 16076800 2700
60148360 lagin F Sept. 6, 2019, 2:10 a.m. OK GNU C++17 TESTS 128 202 36044800 2700
60064378 __JuRuo F Sept. 5, 2019, 8:29 a.m. OK GNU C++17 TESTS 128 217 7372800 2700
67169355 dalt F Dec. 18, 2019, 4:43 p.m. OK Java 8 TESTS 128 701 135475200 2700
67976586 I_love_Harpae F Dec. 30, 2019, 5:11 p.m. OK Java 8 TESTS 128 732 28672000 2700
60133801 Tlatoani F Sept. 5, 2019, 5:39 p.m. OK Kotlin TESTS 128 1746 143462400 2700
66705267 gorgchap F Dec. 12, 2019, 2:37 p.m. OK Mono C# TESTS 128 420 42291200 2700
66679365 gorgchap F Dec. 12, 2019, 12:32 p.m. OK Mono C# TESTS 128 436 42291200 2700
66889536 gorgchap F Dec. 14, 2019, 7:45 p.m. OK Mono C# TESTS 128 1731 45875200 2700

remove filters

Back to search problems