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

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

We will hold GAMEFREAK Programming Contest 2023 (AtCoder Beginner Contest 317).

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

We are looking forward to your participation!

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

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

Where is ABC316?

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

WOW,I do not know anything about it.

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

It was happened on benshu Island,Japan.

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

Anyone?

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

Yes,I think so

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

Anyone thinks problem D is confusing?

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

oh hell yes I love ABCs when my rating is based on "how fast I can solve ABCDE" but the E is implementation hell (/s)

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

what is mistake in this code for D? Can anyone give a counter test https://atcoder.jp/contests/abc317/submissions/44966049

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

    If I had to guess, I'd say you are overflowing. We have $$$N=100$$$ and each district allows up to $$$1\,999\,999\,999$$$ votes in total. Try using 64-bit integers and see if you still get an error.

  • »
    »
    9 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    ll int extra=ceil_div(vec[index][1]-vec[index][0],2);
    

    $$$extra$$$ could be negative here, which I believe should not have been the case. Not only is it being negative a problem, you should anyway only be considering the districts where the opponent is winning, to add to yours.

    Also (unrelated), as a minor optimization, you could rewrite ceil_div this way:

    ll int ceil_div(ll int a,ll int b)
    {
        return (a + b - 1) / b;
    }
    
»
9 месяцев назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

Crazy F.

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

How to solve $$$G$$$? (was able to do $$$A$$$-$$$F$$$) I think it was similar to Sudoku Pattern but couldn't think how to proceed actually.

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

Can someone help me with Problem D, I couldn't figure out why it's passing only half of the test cases Edit: Solved!, using long long helped

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

When you solve $$$F$$$ with $$$10D$$$ DP.

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

On these submissions for C, 44981045 and 44981274, the only difference is that the graph in the first one is initialized with null values while the graph in the second is initialized with zeroes. Why does the first submission work but not the second?

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

    I figured it out. In the code with the graph initialized to 0 values, impossible permutations get calculated. When the graph is initialized to None values, the impossible permutations get skipped since I don't update to the next node when the next node is impossible to get to.

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

E is how NPC works in Pokemon. Classic.

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

Hey guys! can anyone help me see what's wrong with this solution for problem E? It's the exact same approach as editorial but I can't see what's wrong here

My Solution

Link to submission

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

    drgrenkenstein your solution will fail on testcases like-

    Sv.

    ..<

    G..

    Your code output=2, correct = -1. Because you're changing the values of '.' to '#' so after you encounter 'v' in first row you will change the input to :

    Sv.

    .#<

    G#.

    and thus '>' will not do anything since it's adjacent value is already '#'.One possible way to do this is to mark those cells visited rather than changing their value to '#'.

    Accepted code (modified)- submission

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

      Really appreciate it! I was lost where exactly I am making the mistake? Thanks for the help!!

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

Anyone overkilled C with bitmask dp or is it only me.

My contest submission

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

why does the editorial solution for C has a time complexity of O(n.n!), i couldn't really see why?

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

Can someone provide a counter-example for greedy approach for problem D? Here is my code: https://atcoder.jp/contests/abc317/submissions/45121156