Ra1nWarden's blog

By Ra1nWarden, history, 9 years ago, In English

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

Problem set

  • Vote: I like it
  • +16
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +8 Vote: I do not like it

What is the idea behind the inversion problem?

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    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.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
9 years ago, # |
  Vote: I like it +8 Vote: I do not like it

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 :[

  • »
    »
    9 years ago, # ^ |
    Rev. 2   Vote: I like it +11 Vote: I do not like it

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

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    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.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Where can I upsolve the problems?