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

Автор chokudai, 2 года назад, По-английски

We will hold AtCoder Beginner Contest 247.

The point values will be 100-200-300-400-500-500-600-600.

We are looking forward to your participation!

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

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

fun contest

i thought F is a dp problem, realizing it's related to graph in the last minutes made me took a wild guess and speedrun coding DSU. submitted 8 seconds before contest ended and as expected got WA

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

I think I overcomplicated most of my solutions :/ But still it's wonderful, when there are various approaches to a problem. Great contest)

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

WA (https://atcoder.jp/contests/abc247/submissions/30857193)

AC (https://atcoder.jp/contests/abc247/submissions/30873457)

I think both are same in multiset of string

auto it=s.find(x) s.erase(it)  (WA)
s.erase(s.find(x)) (AC)
»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

how to solve E?

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

    Iterate over all possible right endings. For each endings, we find the first X, Y, bad to the left. (Here we define a number bad as $$$(a[i] < Y || a[i] > X)$$$ If the order is one of the following (X, Y, bad, right), (Y, X, bad, right), (X, bad, Y, right), or (Y, bad, X, right), it is impossible to find a subsequence ending at right that contains both X and Y. If bad is leftmost relatively to X and Y, then the number of subsequences ending at right will be $$$min(index_X, index_Y) - index_{bad} + 1$$$ My submission

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

Why are heuristic contests shown in red on main atcoder page and in black color on contests page? I get it confused with Atcoder Grand contests because they are shown in red.

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

The solution to F?

  • »
    »
    23 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    The idea is same as editorial but my dp states are a bit different. Please let me know if something is not clear.

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

I find that Problems E and F in ABC round are always great practice for me. It turns out that it is quite a challenge for me to solve both of them within the contest. Hope that after more practice, I could be more comfortable with these problems.

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

Could anyone explain F. I'm unable to understand g(M)=f(M−1)+f(M−3) relation. Unable to understand "This problem is quite similar to “you must choose one of adjacent elements. How many ways are there to do so?” that we discussed right before." What is meany by adjacent elements? adjacent nodes or edges?

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

    Can't answer the first question . While solving problem I was looking for pattern and then brute forced for some values and found out that f[i]=f[i-1]+f[i-2] where i is the size of the cycle .
    For the second part , try naming each edge and vertex 0 to n-1 , u will notice that when you colour edge j , vertex j and (j+1)%n gets colored , I think this is exactly what is meant by the "you must choose one of adjacent elements. How many ways are there to do so?"

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

It was a very good contest.

can anyone tell me what is best time complexity in which problem C(1 2 1 3..) can be solved?

Link for Problem C

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

    Suppose that $$$T(x)=$$$ the number of numbers we should print when $$$N=x$$$, then we have $$$T(x)=2T(x-1)+1(x>1),T(1)=1$$$. So $$$T(x)=O(2^x)$$$.

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

    Someone solved it in O(1), because there are only 16 possibilities: Submission