atcoder_official's blog

By atcoder_official, 14 months ago, In English

We will hold AtCoder Beginner Contest 426.

Starting with this contest, the rules against generative AI have undergone significant changes. Please make sure to review this post and the rules.

We are looking forward to your participation!

  • Vote: I like it
  • -118
  • Vote: I do not like it

| Write comment?
»
14 months ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

Now we have significant changes for the rule against generative AI. Not only ABC, but ARC and AGC are also affected. I suggest reading the new rules for all AtCoder contestants.

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

if u use ai in abc, it's useless to improve ur coding ability except for a high rating(but its useless

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

This will be my first contest on the AtCoder.

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

G is a totally shit. It's the same as this one: https://www.luogu.com.cn/problem/P6240

ABC now becomes a contest that copy other Online Judges' problems, and that is really bad for those who try to solve problems properly.

Also, ABC doesn't ban people who use AI, and that's bad either.

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

I love Atluogu.jp !!!

»
14 months ago, hide # |
← Rev. 2  
Vote: I like it +20 Vote: I do not like it

Problem D is great, but EFG are shitty.

E: Totally math problem;

F: Segbeats template;

G: Cattree Divide and Conquer template.

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

Why there's so many problems that be solved with Segment Tree?!

  • »
    »
    14 months ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Because it's a great Data Structure. Also, if you are talking about C, it can also be solved with Fenwick Tree.

    Edit: It can also be solved using just a loop and tracking the latest OS version. Just realized it.

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

      But C can be also solved with brute force.

      This is my code, it's easy to understand. Though variable $$$L$$$ do not decrease, the time complexity could be $$$O(N+Q)$$$.

      #include<bits/stdc++.h>
      #define ll long long
      using namespace std;
      ll n,q,L,arr[1000005];
      int main(){
      	ios::sync_with_stdio(false);
      	cin.tie(0);
      	cout.tie(0);
      	cin>>n>>q;
      	for(int i=1;i<=n;i++){
      		arr[i]=1;
      	}
      	while(q--){
      		ll x,y,ans=0;
      		cin>>x>>y;
      		while(L<=x){
      			ans+=arr[L];
      			arr[y]+=arr[L];
      			arr[L]=0;
      			L++;
      		}
      		cout<<ans<<"\n";
      	}
      	return 0;
      } 
      
»
14 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve E?

Did I need to use calculus in E?

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

    Nope. You only need to calculate a local minimum of a quadratic function. It can be easily done without involving derivative.

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

    Minimum distance from a point to a segment is enough, though I did with ternary search and got 2 flags :skull:

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

Extremely disgusting E. E can be easily solved by chatGPT in just a few seconds, but human being will get stuck and keep getting wrong answer. This will give cheaters great advantage. They can even have time removing comments and modify the code to make it appear less AI generated looking.

Master like me has already fall below 1600, guess I will eventually reach 1200, and will become Master in codeforces and Pupil in atcoder simultaneously if the problem quality is keep as low as this.

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

Is G too classic?I think too many people had tried it before the contest began.

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

I tried ternary search on problem E, but got WA. Is there some corner case for which ternary search would not work?

  • »
    »
    14 months ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Did you use ternary search?

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

    The function of the distance is conbination of two parts,which means you have to divide the function into two parts and use "ternary search" in each part.

  • »
    »
    14 months ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it +8 Vote: I do not like it

    The distance between Takahashi and Aoki (as a function of time) is convex unimodal when both of them is moving OR one has stopped, but not when you put the cases TOGETHER.

    So you need to do ternary search separately for both of the cases.

    Edit: it's not "convex", should be "unimodal".

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

      Oh you're right, I didn't realize that.

      Let DT and DA be the amount of time Takahashi and Aoki take to reach their destinations. Let's do a ternary search on [0..min(DT,DA)] (both moving) and another ternary search on [min(DT,DA)..max(DT,DA)] (one stopped, other still moving).

      Got AC doing that.

      Thank you very much!

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

      ternary search separately.

      Thanks for this.

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

    I know now why you and me got it wrong, the reason is we forgot to case work in two part 1)where both walker not stop moving yet and 2)the case where one walker stop moving while the other walker can still move, an attempt to solve it without case working it this way will gives wrong answer cuz the function will not be truly unimodal and our implementation fail to realize this case, at least that was the case for me, this is truly an amazing feeling, never before I want to K*ll my self before go to bed but at least I learn new thing today man 😭

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

Please use yuantiji.ac before publishing contests...

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

wtf is this??????????

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

S**t F,G.

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

Please do not give geometry problems that involve only simple math anymore.

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

Hi solved problem D in todays Contest using 2p + dq. Let me know if you guys are interested in a video explanation

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

What is the problem with my solution for problem E.

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

I am Carbon Twelve!

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

g is p6240 in luogu, so I got the first accepted in g and f is a segbeats template, but remember to use int128.

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

    Storing the count of valid non-zero elements in intervals, rather than the sum of the number of intervals, will not cause a long long overflow.

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

In the solution to Problem E, "$$$\frac{t}{q}\vec{AB}$$$" should be "$$$\frac{t}{p}\vec{AB}$$$".Because it is $$$\frac{\vec{AB}}{p}$$$ that is the unit vector.

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

    Why to use ternary search in E?

    • »
      »
      »
      14 months ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      My approach is to directly solve for the minimum of a quadratic function (treating $$$|\vec{OF}+t\vec{FG}|$$$ as squared and t as the unknown), and the reason for using ternary search is probably also because this function is unimodal.

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

    Or according to the code, $$$\vec{AB}$$$ in the formula should be $$$\vec{AE}$$$.