Sparkle_'s blog

By Sparkle_, history, 2 years ago, In English

As the title.

I wrote a comment:"C is too difficult and D is too easy XD" under the lastest round.

Then my comment deleted and my account got a read-only mode for 2 days.

Was my comment against community rules in CodeForces? I didn't know it well,could someone tell me plz

  • Vote: I like it
  • -2
  • Vote: I do not like it

»
2 years ago, # |
  Vote: I like it +41 Vote: I do not like it

Did you write it before the contest ended? Maybe that is a kind of violation of rules.

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

How did you do D? I didn't do C either so I looked at D. I felt in my bones that there was probably some kind of mathematics involved but had no idea what it was.

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

    Use dp.

    It is easy to see the steps must be not big,about $$$\sqrt{n}$$$.

    Set $$$f_{i,j}$$$ as the answer of $$$i$$$ steps reach $$$j$$$.

    $$$f_{i,j}=\sum_{l=1}^{j-1} f_l*[(j-l) \mod (k+i-1) == 0]$$$

    Then we can use rolling arrays to optimize the memory and use prefix sum to optimize the time.

    Then it is a $$$O(n\sqrt{n})$$$ solution.

    Code: 166958668

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

censorship police