Блог пользователя Ra1nWarden

Автор Ra1nWarden, история, 8 лет назад, По-английски

Anybody took part in NAIPC 2016? Let us discuss the problems here.

Problem set

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

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

What is the idea behind the inversion problem?

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

    Imagine the product of a0x0, a1x1, ..., an - 1xn - 1 and b0x0, b1x - 1, ..., bn - 1x - n + 1. If ai is 1 if s[i] is A and bi is 1 if s[i] is B, then the coefficients of xi would be the answer for i-inversions.

    You can shift the second expression to get a valid polynomial (get non-negative exponents multiplying it by xj). Then you can solve it by FFT. If you shifted by j, then answer for k-inversion will be coefficient of xj + k.

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

Auto comment: topic has been updated by Ra1nWarden (previous revision, new revision, compare).

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

Hi :)

Any ideas for problem B or problem J?

Problem B was solved by almost 30 teams but I don't find the correct approach :[

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

    B: Suppose you know the number of digits for each start and end, then it is easy. We can assume they have 1 digit at first, then get the answer, and then you may find some start/end need more digits. Then you can update them and solve again. You do this again and again till it will not change. Each start/end can only increase few times, so the complicity is O(n^2 * log(n))

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

    J: For each grid square, we can compute, what is the latest time a marker has went over this square?

    Now, for a square that needs to be colored, the marker can't dry out before the latest time we touch this square, so we know the minimum time the marker needs to dry out is at least the maximum of all these values.

    On the other hand, for a square to be blank, the marker needs to dry out before the latest time we touch this square, so we know the maximum time the marker can dry out is at most the minimum of all these values.

    If minimum time > maximum time, it's impossible, otherwise, we can output these two numbers. Of course, computing the latest time the marker hits each square is the tricky part, but one hint is to use segment trees.

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

Where can I upsolve the problems?