atcoder_official's blog

By atcoder_official, history, 8 months ago, In English

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!

  • Vote: I like it
  • +38
  • Vote: I do not like it

»
8 months ago, # |
  Vote: I like it +37 Vote: I do not like it

Where is ABC316?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

WOW,I do not know anything about it.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It was happened on benshu Island,Japan.

»
8 months ago, # |
Rev. 2   Vote: I like it -24 Vote: I do not like it

Anyone?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Yes,I think so

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone thinks problem D is confusing?

»
8 months ago, # |
  Vote: I like it -15 Vote: I do not like it

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)

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Same ,i read E and i know i can solve it but i don't want to.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    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;
    }
    
    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      yes, while taking input at that time only i have considered only where opponent is majority and have pushed that elemnts into vector

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks for ceil_div

»
8 months ago, # |
  Vote: I like it +19 Vote: I do not like it

Crazy F.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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

»
8 months ago, # |
  Vote: I like it +13 Vote: I do not like it

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

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

»
8 months ago, # |
Rev. 2   Vote: I like it +2 Vote: I do not like it

E is how NPC works in Pokemon. Classic.

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

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

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

My contest submission

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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