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

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

We will hold AtCoder Beginner Contest 430.

We have updated the rating system. As these changes will apply starting with this contest, please see this post for details.

We are looking forward to your participation!

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

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

We finally get to use the new judge!

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

Truck Driver ran over my logic, my confidence, and my will to continue.

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

The problems are generally good and all, there were no critical issues in the problems, except for just one thing...

I am very curious what they were thinking while preparing problem E...

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

E<<<(a,b,c,d)

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

What G states: Find the maximum number of elements among $$$S_i$$$...

What I read: Find the maximum elements among $$$S_i$$$...

Therefore, I deserve yet another failure to gain 1 dan.

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

100

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

E should be used to teach string matching algorithms and not for a contest.

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

Personally, C was logically easy but hard to code nice contest though

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

Can we solve F by creating a directed graph for nodes 1 to n and finding the number of topological sortings possible?

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

https://atcoder.jp/users/hyx_xingxing

This guy, gets rk43, I think he used AI.

D: https://atcoder.jp/contests/abc430/submissions/70616970

F: https://atcoder.jp/contests/abc430/submissions/70619227

He only used 8 minutes to write 1904 Byte.

And G: https://atcoder.jp/contests/abc430/submissions/70622170

He only used 12 minutes to write 4478 Byte! How can a normal man do that? And his code seems like AI, too.

Sorry for my weak English : (

And I find lots of new users that use AI to get a high rank, these people ruined our competition experience. A question to those AIers: If you use AI, it means you have already been replaced by AI. And once replaced, how will you live in an even more intelligent future?

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

Do you also hate it when some big segment tree beats code doesn't work for some reason and the only test which might give you a glimpse of what could be wrong has $$$n, q \ge 20$$$?

Well I don't have any advice for that! Now I even think that STB doesn't work in this problem but can't understand why

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

G looks really interesting. Any hints please? Is lazy segment tree wrong (I think yes, but idk)? Would some sort of sqrt rebuilding work (again, I think yes, but idk)?

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

G

Knowing this makes solving $$$G$$$ easier, just have to extend for max and count Submission

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

After how much time rating is updated now ? When I used to give contests on atcoder 1 year age, then it used to get updated in just 20-30 mins. But till now it didn't.

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

I solved E using a hash algorithm, is there a better algorithm?

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

G can be solved in $$$O(Q \log N + N + \max x)$$$ time with $$$\max x$$$ std::sets and one lazy segment tree.

The lazy segment tree maintains the number of elements in each set and supports queries on the max and frequency of max. Separately, for each $$$x$$$, maintain a std::set $$$is[x]$$$ of disjoint active intervals of sets containing $$$x$$$.

On an add update, add the interval $$$[l, r]$$$ to $$$is[x]$$$, with additional updates to keep the intervals in $$$is[x]$$$ disjoint. Propagate all these updates to the segment tree: whenever an interval $$$[l, r]$$$ is added/removed to $$$is[x]$$$ (corresponding to updating $$$S_l, \dots, S_r$$$) add $$$\pm 1$$$ to $$$[l, r]$$$ in the segment tree.

Removal updates are similar. On queries, query the segment tree.

https://atcoder.jp/contests/abc430/submissions/70628647

(KACTL IntervalContainer is really nice here, just modify it to update the segment tree)

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

i love this contest :)

The difficulty level is moderate; it would be even better if there were number theory problems included.

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

E was just there for the sake of it

»
11 месяцев назад, скрыть # |
Rev. 4  
Проголосовать: нравится +35 Проголосовать: не нравится

Hello, my account on atcoder simply disappeared. I had an account called Settop. I was doing the ABC today and after the contest, I was browsing the standings page on the website. At some point, my account logged out, and I tried to log in again, but I couldn't: it said the password and username were wrong. So, I used the "Forgot my username" option. When I entered my account email, it sent a message saying there was no account for that email, but I'm sure that was the correct email; I even have a screenshot. Then, using the same email, I created another account and checked the standings to see if I could find anything about the account, but it was simply gone. I hope I can recover my account. Can someone help me please?

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

I found a O(n logn) solution to problem D, but it gives TLE on test 8. I don't know why can someone explain?

https://atcoder.jp/contests/abc430/submissions/70631585

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

I tried to solve C using dp, where dp[i] = dp[i-1] + la — lb + 1, if (la > lb). There are other cases too, but this is the core recurrence. Did anyone try a similar or any DP approach for C? Did you AC?

»
11 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
ll kmp(string&s,string&t){
    string temp=t+'$'+s;
    ll n=temp.size();

    vll lps(n,0);

    rep(i,1,n){
        ll prev=lps[i-1];

        while(prev>0 && temp[i]!=temp[prev]){
            prev=lps[prev-1];
        }

        lps[i]=prev+(temp[i]==temp[prev] ?1:0);
    }

    // for(auto it:lps) cout<<it<<" ";
    return lps.back();
}
void solve(){
    string s,t;cin>>s>>t;
    ll fir=kmp(s,t);
    ll sec=0;
    ll ans=s.size()-fir;
    while(fir<t.size()){
        if(t[fir]!=s[sec]){
            cout<<-1<<endl;return;
        }
        fir++;sec++;
    }
    cout<<ans<<endl;
}

I can't seem to figure out why this should fail for problem E. Any help will be greatly appreciated.

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

Does anyone know why the following solution for D gets TLE? Mycode

I think it's essentially the same solution as Solution 2 in the editorial. Any recommendations will be greatly appreciated.

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

Why is kenkoooo not working again on my computer?(Please do not downvote my comment if you don't like)

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

Can E be done using string hash? If so, what is the hash function?
I have tried the function of $$$h(A)=(\sum_{i=0}^{|A|}a_i\cdot 2^i)\mod 998244343$$$, where $$$A$$$ is the string. However, it got 21 WAs in AtCoder. Here is the submission link. Sorry for my poor English.