Aveiro_quanyue's blog

By Aveiro_quanyue, history, 21 month(s) ago, In English

Problem: https://atcoder.jp/contests/arc156/tasks/arc156_d

My note:

Google drive: https://drive.google.com/file/d/1It475dOHDzrt0DCm0so95x4y7ocn51pT/view?usp=share_link

Tencent: https://docs.qq.com/pdf/DU3pOalBZbW9DbVV1

Code (C/C++ are both OK, please use gcc/g++ compilers), in $$$O(NlogKmax(A))$$$ time:

Spoiler
  • Vote: I like it
  • +15
  • Vote: I do not like it

»
21 month(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks a ton, Aveiro_quanyue.

»
21 month(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

can u please make a notes on problem B ?

  • »
    »
    21 month(s) ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Yes, you can enumerate the possible mex after operations. For example, if the initial sequence is $$$0, 1, 3$$$ and the final mex is $$$4$$$, then you can only add $$$0, 1, 2, 3$$$, and adding $$$2$$$ is mandatory. So it is boiled down to calculate the number of solutions to some undetermined equations.

»
21 month(s) ago, # |
  Vote: I like it +1 Vote: I do not like it

is this what all Chinese Pupils are capable of...