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.)

# | User | Rating |
---|---|---|

1 | tourist | 3624 |

2 | Um_nik | 3468 |

3 | mnbvmar | 3363 |

4 | Petr | 3330 |

5 | wxhtxdy | 3329 |

6 | LHiC | 3300 |

7 | sunset | 3278 |

8 | V--o_o--V | 3275 |

9 | Vn_nV | 3182 |

10 | dotorya | 3156 |

# | User | Contrib. |
---|---|---|

1 | Radewoosh | 190 |

2 | Errichto | 185 |

3 | rng_58 | 161 |

3 | PikMike | 161 |

5 | Petr | 156 |

6 | Ashishgup | 153 |

6 | Vovuh | 153 |

8 | neal | 151 |

8 | majk | 151 |

8 | 300iq | 151 |

8 | Um_nik | 151 |

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.)

↑

↓

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/26/2019 10:29:54 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

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

iat sizeA(i) — (i- 1) in round 1After that notice if you visit a queue at size

t, you also visit it at sizet-n,t- 2n,t- 3n, ..., 0.Now,

how many visits do you make at a queue when it is0 ?The answer is

t/n= (A(i) — (i- 1)) /nSo, for each queue calculate the time it will take to reach it and keep track of the minimum.

Here is my code.