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

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

We will hold AtCoder Beginner Contest 336.

We are looking forward to your participation!

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

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

After the contest ends, I will be live discussing soln of ABC 336

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

Hope to solve:A,B,C,D!

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

First round of ATcoder

Hope to get A,B,C,D,E.

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

E>500 Round? Hope not as hard as 332.

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

Problem E is exactly the same as LUOGU P4127

And it seems that the first solver just copied his code from his luogu submission...

I have checked that the code is exactly the same, lol...

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

    Are you a multi-account of sunkuangzheng bro :(

    Both of your submissions start with

    /**
     *    author: sunkuangzheng
     *    created: xxxxxx
    **/
    #include<bits/stdc++.h>
    #ifdef DEBUG_LOCAL
    #include <mydebug/debug.h>
    debug_helper deg;
    #endif
    

    even without changing the author name...

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

      I suspect you're also a multi-account of sunkuangzheng :(

      Most of your submissions start with the following code:

      /**
       *    author: sunkuangzheng
       *    created: xxxxxx
      **/
      

      Moreover, in the introduction of the Luogu account _sunkuangzheng_, it's mentioned that both tril0713 and little_dog belong to him.

      Hint: Due to policy restrictions, you can't directly access the Luogu user's introduction. However, you can observe in the HTML code of the page that there are references to <a href="https://codeforces.me/profile/little_dog"> & <a href="https://codeforces.me/profile/tril0713">.

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

I guess, in problem G we have to calculate number of Euler paths. How to do it? The graph looks specific, do we need to use this fact?

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

I wonder if G is a inclusion-exclusion problem lol, I'm looking for some ideas.

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

E (:

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

How to write check function for D optimally?

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

E has the same problem in Luogu,even harder than E

https://www.luogu.com.cn/problem/P4127

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

F seems to be a search, but I don't have enough time to complete it:(

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

Even C is easily available at the internet

Atcoder Copy paste round.

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

Copycoder

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

Can D be done using bin search??

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

    yes but check function need a quick way to find min in a range in less than $$$O(N)$$$.

    I used sparse table and sliding window approach. (submission)

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

      Mind explaining your solution in a bit detail.

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

      My binary search solution used a $$$O(n)$$$ greedy check function. You start at index 1 and start trying to build up your pyramid. Assume that you're at index $$$i$$$ and up to index $$$i - 1$$$ you were able to build up your pyramid with no problems. Let $$$H$$$ be the height needed to continue building up our pyramid at this point. If $$$A_i$$$ is greater than or equal to $$$H$$$, you just move on to index $$$i + 1$$$, and update $$$H$$$ to $$$H + 1$$$ or $$$H - 1$$$ depending on if we're going up or down currently; if it's smaller than $$$H$$$, we failed and we should try starting building up another pyramid. However, by our hypthosesis, we were able to build a pyramid with height at least $$$H - 1$$$ at index $$$i - 1$$$, and since $$$H - 1 \geq A_i$$$, we have the guarantee that we could've built a pyramid with height $$$A_i$$$ at index $$$i$$$, so just move on to index $$$i + 1$$$ and $$$H := A_i + 1$$$ (making sure we're going up).

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

    yo , check function is just greedy https://atcoder.jp/contests/abc336/submissions/49319491 iterate the array from beginning and set a value $$$p$$$=1 , if $$$v[i] \ge p$$$ increase p by 1 if $$$p \lt mid$$$ and $$$p$$$ hasn't reached mid yet else decrease p by 1 and if $$$v_i \lt p$$$ set $$$p=v_i+1 $$$assuming it has just reached mid or never reached mid if new $$$p \lt mid$$$ , if $$$p$$$ ever reaches 1 after reaching mid check function returns $$$true$$$

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

Please , do release english editorial as well...

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

F is too classic imo, from the constraint you can easily observe a meet-in-the-middle solution. idk why so few people passed it.

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

how to solve E to not fit in 5000ms?

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

I had the same idea for E , but was going from lower digits , and hence was stuck on how to handle <= N constraint.

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

Passed F doing a double BFS from original grid and from target grid (max depth 10), and joining the states using a map.

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

why there isn't a editorial in English.. (T⌓T)

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

For problem E, I use dp[i][j][k][r][0/1] to denote the number of ways such that, i denotes that we have determined the first i digits(from high to low), and j denotes that the sum of the first i digits is j, while k and r denote that the current integer module k is r, and finally 1/0 denotes that we have arrived at the upper bound or not.

The final answer is dp[len][j][j][0][0]+dp[len][j][j][0][1], where len denotes the number of digits in n.