atcoder_official's blog

By atcoder_official, history, 7 months ago, In English

We will hold AtCoder Beginner Contest 422.

We are looking forward to your participation!

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

»
7 months ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

This time is magical.

Surprisingly, it started at 12:10 noon on Sunday.

qp

»
7 months ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

This new start time is very good.

»
7 months ago, hide # |
 
Vote: I like it -12 Vote: I do not like it

Hope this round won't be as bad as the last one...

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

pretty early for me, but i will be there!

all the best to everyone :)

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

Hi, everyone. I surprisingly discovered that yesterday was the 15th day of the seventh lunar month on the lunar calendar. Which is the Zhongyuan Festival in China or maybe the Chūgen Festival in Japan. It's the ghost fesival in China which means the gates of hell are opened up and ghosts are free to roam the earth where they seek food and entertainment. We go on the road and burn paper to guide these goasts So, I think it's the reason why they put off the contest until today. The time 11:10~13:50 (UTC+9) is also the peak of masculine energy according to some mystery.

(It there's anything incorect about the introduction of Chūgen Festival in Japan, welcome to leave your comment.)

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

    I don't think the competieion was postponed because of Zhongyuan Festival, but because of conflict with ARC.

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

So surprisingly that there is a similar contest on the same time. https://atcoder.jp/contests/jsc2025advance-final

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

Rlly hope I don't sell this time ;-;

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

I hope this game will be much better than last time

qp

»
7 months ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

qp

»
7 months ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

qp

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

Great round. Will the contest still be rated, even with so few participants?

»
7 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

Bro I cannot solve problem D.

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

    I guess we can build answer recursively...

  • »
    »
    7 months ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it

    You can build the solution from the last step to first step.

    You can start with [k], before that you can have [k/2,k-k/2], before that, you can have [(k/2)/2,(k/2)-(k/2)/2,(k-k/2)/2,(k-k/2)-(k-k/2)/2] and so on...

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

    Is there a solution to this through some linear spacing of the remainders. Or is divide and conquer the only way to go?

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

Today's problems after C were better than yesterday's ARC imo. Especially; the problem F >>

I guess they have swapped ARC and ABC :))

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

Has anybody solved using divide and conquer for E?? If successful, please share it.

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

The solution of C is always surprisingly short.

»
7 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Is there any particular way to solve problem E without using RNG?

»
7 months ago, hide # |
Rev. 4  
Vote: I like it 0 Vote: I do not like it

why this giving error , this problems like c are so bad just one line code if someone guess 10 sec to solve if someone not no matter what he do always wrong i first utilise the b then simply take contri of a and c , any case you think about ??


void solve() { // executing code from here int t;cin>>t; while (t--) { int a,b,c;cin>>a>>b>>c; int ans=0; ans=min({a,b,c}); a-=ans;c-=ans; // dbg(a);dbg(b); if(a>c){ // dbg(min(c,a/2)); ans+=min(c,a/2); }else{ ans+=min(c/2,a); } cout<<ans<<endl; } }
  • »
    »
    7 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    3 0 3 ans should be 2 (AAC + ACC)

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

      thanks sir

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

      Can you please explain me the solution for the problem E as in editorial they are mentioning the randomized approach but i didn't hear that , and one more thing that my approach to make a map of slope and y_intercept and then i will who are having the freq>n+1/2 then thay our answer but for that complexity will go upto n^2 and not allowed can you please help

      • »
        »
        »
        »
        7 months ago, hide # ^ |
        Rev. 3  
        Vote: I like it 0 Vote: I do not like it

        Let's assume that there exist n/2 points that are on the same line (if not then the answer is NO and it's fine)

        Then if you pick 2 random points from our set, there is a $$$(1/2)*(1/2)=1/4$$$ chance that both points that we picked are on that line.

        So we just pick 2 random points, and check how many points are on the same line as these two. (That's easy to o in $$$O(n)$$$)

        And we repeat this process multiple times to achieve good enough probability of success

        For example if we pick 2 random points 100 times, the chance that we won't find such line is $$$(3/4)^{100}$$$ which is almost 0%. So if we didn't find such line after 100 iterations, then we can say the answer is NO

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

Why problem F couldn't be solved with Dijkstra?

Submission
»
7 months ago, hide # |
Rev. 2  
Vote: I like it +6 Vote: I do not like it

Can anyone prove my solution for F? I claim that every vertex only have $$$m$$$ pairs of (current weight, fuel used) being useful , but I can't prove it.

my solution

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

all nice problem!!! althought I just solve 3,but solve the rest problem with Editorial help me learn a lot!!:)

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

    True. Contests with nice problems back to back.

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

      Can you please explain me the solution for the problem E as in editorial they are mentioning the randomized approach but i didn't hear that , and one more thing that my approach to make a map of slope and y_intercept and then i will who are having the freq>n+1/2 then thay our answer but for that complexity will go upto n^2 and not allowed can you please help

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

Is it fair to have random in E? The same solution can be judged differently just by random.

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

    Nope. Using a fixed seed can avoid this problem. Also, the error rate is significantly low, so it almost doesn't matter.

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

    well,it has been prove that the Lower bound of time complexity is $$$O(n^2)\to O(n^{2-O(1))})$$$(3SUM). But since the problem didn't mention how to handle the "no solution" case, just using randomness is okay.

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

For problem D, first fill vector by $$$\frac{k}{2^n}$$$. Then keep incrementing numbers in even position by 1 alternating between left and right, continue till you have n%{2^k} remaining. If there is still some left then do the same for odd position. The imbalance will always be 1 when there is remainder other than 0.

Why this solution is incorrect??

»
7 months ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

problem D spj maybe wrong? Without considering K.

https://atcoder.jp/contests/abc422/submissions/69146833

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

    can you please let me know fault in my approach what i am doing is first fill all values with k/2^n then just calculate how much sum is left then just first sort the array and then splitting array like this for

    6 6 6 6 7 7 7 7 i make it like 6 7 6 7 6 7 6 7 and then i am calcuating answer for that

    int answer(vector<int>&vec){
        int x=-1e9;
        vi temp=vec;
        while(temp.size()>=2){
            vi kar;
            // help(temp);
            for(int i=0;i<temp.size();i+=2){
                kar.push_back(temp[i]+temp[i+1]);
            }
            int maxi=*max_element(temp.begin(),temp.end());
            int mini=*min_element(temp.begin(),temp.end());
            x=max(maxi-mini,x);
            temp=kar;
        }
        return x;
    }
    void coderaryan() {
        // executing code from here 
        int n,k;cin>>n>>k;
        int mini=k/(1<<n);
        vector<int>vec((1<<n),mini);
        int diff=k-(mini*(1<<n));
        for(int i=0;i<vec.size();i++){
            if(diff<=0)break;
            vec[i]+=(diff+vec.size()-1)/vec.size();
            diff-=(diff+vec.size()-1)/vec.size();
        }
        int i=0,j=(1<<n)-1;
        sort(vec.begin(),vec.end());
        vi kalo;
        while(i<j){
            kalo.push_back(vec[i]);i++;
            kalo.push_back(vec[j]);j--;
        }
        cout<<answer(kalo)<<endl;
        help(kalo);
    }
    
»
7 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

There is a discuss of D's checker was wrong :Portal

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

For Problem E, there’s a minor issue in the editorial code: https://atcoder.jp/contests/abc422/editorial/13837

Hack:

3
0 0
1000000000 500000000
-1000000000 1000000000

If the algorithm randomly selects the last two points and computes the line coefficients, it gets a = 5e8, b = 2e9, c = -1.5e18, so |c| > 1e18, which yields a wrong answer. However, the same line has a valid reduced triple (1, 4, -3000000000) after dividing by gcd.