Codeforces Global Round 5

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
1237 Codeforces Global Round 5 FINISHED False 9000 160586699 Oct. 16, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 123 ) G Balanced Distribution PROGRAMMING data structures dp greedy 3600

B'There are n friends living on a circular street. The friends and their houses are numbered clockwise from 0 to n-1 . Initially person i has a_i stones. The friends want to make the distribution of stones among them perfectly balanced: everyone should possess the same number of stones. The only way to change the distribution of stones is by conducting meetings. During a meeting, people from exactly k consecutive houses (remember that the street is circular) gather at the same place and bring all their stones with them. All brought stones may be redistributed among people attending the meeting arbitrarily. The total number of stones they possess before the meeting and after the meeting must stay the same. After the meeting, everyone returns to their home. Find a way to make the distribution of stones perfectly balanced conducting as few meetings as possible. The first line contains two integers n and k ( 2 <= k < n <= 10^5 ), denoting the number of friends and the size of each meeting. The second line contains n integers a_0, a_1, ldots, a_{n-1} ( 0 <= a_i <= 10^4 ), denoting the number of stones people initially have. The sum of all a_i is divisible by n . Output the minimum number of meetings m ( m ge 0 ), followed by m descriptions of meetings in chronological order. The i -th description must consist of an integer s_i ( 0 <= s_i < n ), followed by k non-negative integers b_{i, 0}, b_{i, 1}, ldots, b_{i, k-1} ( b_{i, j} ge 0 ). Such a description denotes a meeting of people s_i, (s_i + 1) bmod n, ldots, (s_i + k - 1) bmod n , and b_{i,j} denotes the number of stones person (s_i + j) bmod n must have after the i -th meeting. The sum of b_{i, j} must match the total number of stones owned by these people before the i -th meeting. We can show that a solution exists for any valid input, and '...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
63222493 yasugongshang G Oct. 23, 2019, 8:18 a.m. OK GNU C++11 TESTS 54 78 8089600 3600
64589494 TrzBoys-07-Askar G Nov. 9, 2019, 2:18 p.m. OK GNU C++11 TESTS 54 109 27648000 3600
63700393 frodakcin G Oct. 29, 2019, 7:07 a.m. OK GNU C++11 TESTS 54 109 27648000 3600
62768327 RNS_JKS G Oct. 17, 2019, 9:23 a.m. OK GNU C++11 TESTS 54 155 32153600 3600
67793402 _twilight G Dec. 28, 2019, 3:31 p.m. OK GNU C++11 TESTS 54 171 31948800 3600
62863823 RNS_KSB G Oct. 18, 2019, 11:37 a.m. OK GNU C++11 TESTS 54 202 50585600 3600
68963575 zx2003 G Jan. 17, 2020, 3:14 a.m. OK GNU C++11 TESTS 54 217 39116800 3600
66013290 RNS_KSB G Nov. 30, 2019, 3:58 a.m. OK GNU C++11 TESTS 54 233 50585600 3600
63062196 yuguotianqing G Oct. 21, 2019, 9:09 a.m. OK GNU C++11 TESTS 54 327 41984000 3600
63205524 birka0 G Oct. 22, 2019, 11:34 p.m. OK GNU C++11 TESTS 54 561 51200000 3600
62872090 Batrr G Oct. 18, 2019, 2:06 p.m. OK GNU C++14 TESTS 54 155 49971200 3600
65232715 Yennefer G Nov. 17, 2019, 5:52 a.m. OK GNU C++14 TESTS 54 156 30924800 3600
62747276 krijgertje G Oct. 16, 2019, 10:26 p.m. OK GNU C++14 TESTS 54 171 30924800 3600
62737472 MiFaFaOvO G Oct. 16, 2019, 6:44 p.m. OK GNU C++14 TESTS 54 171 49152000 3600
67625233 Benq G Dec. 25, 2019, 9:10 p.m. OK GNU C++14 TESTS 54 202 34918400 3600
63270404 hjc20032003 G Oct. 24, 2019, 3:38 a.m. OK GNU C++14 TESTS 54 234 28057600 3600
69930813 newbiegcz G Jan. 31, 2020, 11:36 p.m. OK GNU C++14 TESTS 54 264 65638400 3600
63057477 BSBandme G Oct. 21, 2019, 7:03 a.m. OK GNU C++14 TESTS 54 280 106700800 3600
69930775 newbiegcz G Jan. 31, 2020, 11:34 p.m. OK GNU C++14 TESTS 54 295 65638400 3600
64180386 Motarack G Nov. 3, 2019, 11:56 p.m. OK GNU C++14 TESTS 54 499 13721600 3600
63271595 gina0605 G Oct. 24, 2019, 4:30 a.m. OK GNU C++17 TESTS 54 109 9728000 3600
67654487 ParsaBahrami G Dec. 26, 2019, 1:24 p.m. OK GNU C++17 TESTS 54 109 27750400 3600
63651878 user202729_ G Oct. 28, 2019, 11:38 a.m. OK GNU C++17 TESTS 54 124 14131200 3600
66611290 how_to_become_purple G Dec. 10, 2019, 9:56 p.m. OK GNU C++17 TESTS 54 140 31436800 3600
62767037 RNS_CUS G Oct. 17, 2019, 8:59 a.m. OK GNU C++17 TESTS 54 155 39731200 3600
62893292 Jatana G Oct. 18, 2019, 9:46 p.m. OK GNU C++17 TESTS 54 171 30924800 3600
67067496 BEmrenimoo G Dec. 17, 2019, 11:37 a.m. OK GNU C++17 TESTS 54 171 49971200 3600
63288760 gongsuidashen G Oct. 24, 2019, 11:09 a.m. OK GNU C++17 TESTS 54 187 8192000 3600
66550598 eunchan115 G Dec. 9, 2019, 2:46 p.m. OK GNU C++17 TESTS 54 202 87449600 3600
62771097 maroonrk G Oct. 17, 2019, 10:18 a.m. OK GNU C++17 TESTS 54 218 41369600 3600
62737869 qwerty787788 G Oct. 16, 2019, 6:51 p.m. OK Java 8 TESTS 54 296 33689600 3600
62746809 eatmore G Oct. 16, 2019, 10:07 p.m. OK Java 8 TESTS 54 404 20275200 3600

remove filters

Back to search problems