Please, can anyone explain the Problem B "996B — World Cup" of Codeforces Round #492 happened on 24/06/18. I couldn't completely understand the explanation without any solution code provided(like it used to be in previous contests.)
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3880 |
2 | jiangly | 3669 |
3 | ecnerwala | 3654 |
4 | Benq | 3627 |
5 | orzdevinwang | 3612 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | jqdai0815 | 3532 |
9 | Radewoosh | 3522 |
10 | gyh20 | 3447 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | awoo | 161 |
2 | maomao90 | 160 |
3 | adamant | 156 |
4 | maroonrk | 153 |
5 | -is-this-fft- | 148 |
5 | atcoder_official | 148 |
5 | SecondThread | 148 |
8 | Petr | 147 |
9 | nor | 144 |
9 | TheScrasse | 144 |
Please, can anyone explain the Problem B "996B — World Cup" of Codeforces Round #492 happened on 24/06/18. I couldn't completely understand the explanation without any solution code provided(like it used to be in previous contests.)
Название |
---|
Suppose you have the numbers A(1), A(2), A(3), ..., A(n)
What is the length when you visit them in round 1 ?
A(1) — 0, A(2) — 1, A(3) — 2, A(4) - 3, ..., A(n) — (n - 1)
You visit queue i at size A(i) — (i - 1) in round 1
After that notice if you visit a queue at size t, you also visit it at size t - n, t - 2n, t - 3n, ..., 0.
Now, how many visits do you make at a queue when it is 0 ?
The answer is t / n = (A(i) — (i - 1)) / n
So, for each queue calculate the time it will take to reach it and keep track of the minimum.
Here is my code.