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

Автор maroonrk, история, 3 года назад, По-английски

We will hold AtCoder Grand Contest 063. This contest counts for GP30 scores.

The point values will be 300-600-800-1200-1400-1700.

We are looking forward to your participation!

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

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

Hope I can solve two problems!

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

Why this fails for problem B?

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

C is almost the same as this problem

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

In problem $$$B$$$ I firstly defined good subsegment incorrectly. It was "for all prefixes for all $$$i$$$ number of $$$i$$$ is greater or equal to number of $$$i + 1$$$". Surprisingly, it failed only half of tests. How to implement it? I scan from left to right and have starting positions of good segments, which end up in current position. I append to them new number. Some of them become not good. Those are suffix of segments (segments with rightmost left end). So this is like stack. To check, if top segment on stack should be removed, I have to ask number of $$$i$$$ and $$$i + 1$$$ on segment. For all $$$i$$$ I precalculate set of positions and do set::lower_bound to find them (Can we do it faster? I doubted, that it can get TL, but it did not). Finally, if current element is $$$1$$$, push this position to stack.

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

In the editorial for problem B, it is stated that

Suppose $$$a$$$ is generatable, and let $$$(1,2,…,k)$$$ be the maximum-length sequence of consecutive numbers starting at the rightmost $$$1$$$. No deletion will be performed to the right of this position until this $$$1$$$ is deleted (since we are looking at the rightmost $$$1$$$). Thus, if ($$$1, 2, ..., k'$$$) is the sequence that is deleted when this $$$1$$$ is deleted, then $$$k' ≤ k$$$ holds

But in this sequence for example: Let $$$a = 1, 2, 1, 2, 3, 3, 4, 5$$$

Then :

  • "$$$a$$$ is generatable"

  • $$$1, 2, 3$$$ is the "maximum-length sequence of consecutive numbers starting at the rightmost $$$1$$$". So now $$$k = 3$$$

  • Then I delete this sequence and left with $$$1, 2, 3, 4, 5$$$. So now "$$$(1,2,…,k′)$$$ is the sequence that is deleted when this $$$1$$$ is deleted". In this sequence $$$k' = 5$$$

But in the last statement, it is said that "then $$$k' ≤ k$$$ holds." Which is not true

Am I missing something here?

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

    I think the "$$$(1,2,...,k')$$$ is the sequence that is deleted when this $$$1$$$ is deleted" means what continuous subsequence was also deleted when we deleted $$$(1,2,...,k)$$$. For example, the continuous subsequence $$$(1,2)$$$ also got deleted when we deleted $$$(1,2,3)$$$, which means $$$k'=2$$$ for this particular case.

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

Problem D in tasks: Many CRT,and in hints:Many CRTs