atcoder_official's blog

By atcoder_official, history, 15 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

| Write comment?
»
15 months ago, # |
  Vote: I like it +37 Vote: I do not like it

Where is ABC316?

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

Anyone thinks problem D is confusing?

»
15 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)

  • »
    »
    15 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.

»
15 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

  • »
    »
    15 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.

  • »
    »
    15 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;
    }
    
    • »
      »
      »
      15 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

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

      Thanks for ceil_div

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

Crazy F.

»
15 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.

»
15 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

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

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

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

E is how NPC works in Pokemon. Classic.

»
15 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
»
15 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

  • »
    »
    15 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

»
15 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

»
14 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

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

    Correct answer should be 57.