Автор RussianCodeCup, 7 лет назад, По-русски

Всем привет!

Лучшие 200 участников первой квалификации уже в отборочном раунде, а остальные могут попытать свои силы во втором квалификацоинном раунде. Он состоится в это воскресенье, 16 апреля в 12-00 по Московскому времени . Лучшие 200 участников попадут в отборочный раунд, а остальные смогут попытать свои силы еще один раз, в третьем квалификационном раунде.

Желаем всем удачи на раунде и ждем на http://russiancodecup.ru!

  • Проголосовать: нравится
  • +41
  • Проголосовать: не нравится

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

If I qualified to the elimination round, how can I receive the certificate and I'm live in Egypt ?!

»
7 лет назад, # |
Rev. 7   Проголосовать: нравится +18 Проголосовать: не нравится

Has anybody received their shirts from last year?

EDIT: oops... that was an unfortunate typo!

»
7 лет назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится

I qualified in the previous round. Can I take part in this round unofficially?

»
7 лет назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

How to solve C?

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Minimize the number of cycles.

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    The answer to the fully given array = N — number of cycles. So you collect all cycle segments (e.g. ? -> 1 -> 4 -> 5 -> ?) where ? is controlled by you. If you have one segment — you have no choice (just put one element you have). Otherwise you can connect all segments into a one cycle (e.g. end0 -> start1, end1 ->start2, ... endI->start0), thus maximizing the answer.

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I have a feeling that E can be solved using MO's Algorithm but I don't know how xD So Can Someone Help Me ?

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, it does. I solved it by MO.

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I tried to, but got TLE :(

    First, transform array into prefix sums + lift it up by 100000 to avoid negative values. So our goal is to find longest interval such that arr[l] = arr[r] inside the quered interval.

    We start MO's algorithm and check intervals. We maintain:

    • for each value: a deque of indices of this value in our current interval (easy to add/remove index from any side);
    • a multiset of maximal lengths for each value (that is multiset of all deque[val].front() - deque[val].back()). The multiset is also easy to update since we can compute the length for the value from the deque. The answer for current query is then the largest value in the multiset.

    At the end of block check, we can clear the multiset directly, and clean the deque's by collapsing the current interval.

    PS: I used map<int,int> instead of multiset.

    • »
      »
      »
      7 лет назад, # ^ |
      Rev. 3   Проголосовать: нравится +8 Проголосовать: не нравится

      My solution is similar to hellman_'s one, except a trick to avoid log factor in the complexity :). Maintain two array a[], b[]. When adding/removing a segment of leng d we add/substract one from a[d / sqrt(N)] and b[d]. To find the maximal len, we need only O(sqrt(N)).

»
7 лет назад, # |
  Проголосовать: нравится +42 Проголосовать: не нравится

Will the problems get added to Gym like Qualification Round 1?