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

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

We will hold SuntoryProgrammingContest2023 (AtCoder Beginner Contest 321).

We are looking forward to your participation!

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

»
8 месяцев назад, # |
Rev. 2   Проголосовать: нравится -21 Проголосовать: не нравится

I hope it can be simpler.

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

Can wait no more!!

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

Can't wait for this contest to begin! Excited!

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

Let's get started!

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

How to do F?? giving tle at tc 66

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

    Do knapsack in reverse for subtract operation

    https://atcoder.jp/contests/abc321/submissions/45887808

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

      Can you elaborate a little bit please.

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

        The main idea is -

        Let's say the input is -

        + 1          
        + 2             
        + 3               
        + 4               
        + 5             
        - 3             
        

        Let's say we have added nos in order [1,2,3,4,5], and now we want to delete 3 to have a knapsack dp count for [1,2,4,5].

        Firstly, notice that the knapsack dp count for adding nos in order [1,2,3,4,5] and [1,2,4,5,3] will be the same.

        So when we want to remove 3, we can assume that the insertion order was [1,2,4,5,3] instead of [1,2,3,4,5], because our dp values will be same for both order of insertions.
        So for - 3, we should revert the operation required to do + 3, assuming + 3 was the last operation.

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

      I was not aware that this problem F will be so much easier. After seeing the problem now with you solution, now it seems that I could've solve this one during contest. But the mentality is, it always feels like the last problems probably the harder that's why don't open.

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

      Good one. I assumed this would fail. I did Deleting from a data structure in $O(T(n)\log n)$
      submission

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

hard:(

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

Still struggling with C — 321-like Searcher At the end, I was able to figure out that the count will be 10, 45, 120, 210, 252, 210 etc. but can't able to code it. But overall the contest was good, the problems are quite fine.

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

    just generate all 321-like Number using recursion and then print (k + 1)-th of them here's My solution

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

    Notice that in 321-like numbers, each digit can appear at max once.
    Once we fix the possible digits, there will be a unique 321 no.

    So the maximum possible no of 321-like numbers are $$$2^{10}$$$, generate all of them, sort them, and print kth value in the sorted array.

    You can do it natively.

    a={""}
    Loop for 9
    a={"",9}
    Loop for 8
    a={"",8,9,98}
    Loop for 7
    a={"",7,8,87,9,97,98,987}
    
  • »
    »
    8 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You can easily observe that in 321-number there are only one time appeared in any number of $$$9/8/7/6/5/4/3/2/1/0$$$. So if you want to enumerate all of $$$1024$$$ 321-number, you can enum $$$2^{10}$$$ states that each bit indicates this bit appears in the new number. And then just add them into one number.

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

      how did you hardcode? I mean obviously, you wouldn't have typed all the numbers manually.

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

        ran a program which iterates from 1 to 98766543210 and if it is a 321 number, output it to text file. Then copied all the numbers from the txt file

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

    It's sequence A009995 https://oeis.org/A009995

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

For a beginner like me, it's a little bit hard.

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

I found B Hard. For the very first time so much wrong submission on B

»
8 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

In problem F, why is the order of enumerating is $$$x, x + 1, \dots, K-1, K$$$ when the operation is -?

I can understand the traditional dp order of enumerating is $$$K, K-1, \dots, x + 1, x$$$ when the operation is +, but I can not understand the question above. T.T

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

    You can assume the last added element is x(since the order of adding element doesn't matters) and think of it as "undo" the last operation of adding element x, so you do everything reversely.

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

    dp[i] = number of ways of getting a subset sum of i. When removing x, you want to subtract the number of ways of obtaining i-x from dp[i] without using this x.

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

    Backward knapsack algorithm. Because $$$dp_i\to dp_{i+x}$$$ and continues, we need to first delete the contribution of smaller i to make sure that the we won't count extra contribution of x.

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

able to solve only A and B, but the problems were pretty nice. I hope editorial will be out soon.

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

for D , can anyone tell why my code is failing

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

emm...My D solution is better than the editorial

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

How to solve G?

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

could any one tell me why my E get RE in two of the tests.my code

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

Thank you for the contest! finally became blue on Atcoder as well woo!
The problems were nice. (fun fact I solved C with digit dp and binary search)

»
8 месяцев назад, # |
Rev. 2   Проголосовать: нравится -19 Проголосовать: не нравится

I would suggest that Ex-difficulty tasks should return to ABC. This being said, you may be wondering how it could be done in such a situation with a lack of hard tasks. Here is my idea. https://codeforces.com/blog/entry/120695

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

Thanks for Suntory for easy problems in this contest.

With this contest, my rating difference went beyond +100 again.

Thanks.

»
8 месяцев назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

What a beautiful solution of F by SSRS_ !

»
8 месяцев назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

Problem F — #(subset sum = K) with Add and Erase : solution

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

How to solve E?

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

I can't watch the editorial of problem G because I don't know how to browse Youtube, do you have text editorials? thanks!

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

does atcoder provide editorials ? i am a complete beginner in cp. Any help would be appreciated.

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

    Yes, the Japanese version is normally available immediately after the contest (like in this one) while the one in English can take a bit longer.