atcoder_official's blog

By atcoder_official, history, 4 months ago, In English

We will hold AtCoder Beginner Contest 458.

We are looking forward to your participation!

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

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

Is it just me or is the font of the words in this contest different from other contests

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

Excuse me, will the new judge have a significant impact on me?

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

Hope I can solve D and E

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

goodluck

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

PE makes me want to go play valorant right away

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

can anyone help me out with D after the contest

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

    may i can help u after the contest xD

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

    Use PBDS along with find_by_order().

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

    You can use 2 stacks to maintain the median in a stream, similar to the Leetcode problem...

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

    I think this problem has appeared in leetcode contest maybe. Anyways, you can solve this using two priority queues, maintain two priority queues, one for the smaller numbers than current median, and one for the larger numbers than current numbers. Let's say current median is 5, and we now add two numbers 2 and 3, now since both are less than 5, so we add them in the left pq, now to find the median, we take out the largest value from the left pq and throw it into the right one until the size of left is just 1 more than the right one, there the largest among the left one is median, similarily if right one has more elements, then we can throw smallest from the right to left until the size is fine.

    My solution: https://pastebin.com/vVjwfwpF

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

    This was my solution using the multiset

    #include <bits/stdc++.h>
    using namespace std;
    
    #define int long long
    
    //For msb -> __lg(n)
    
    /*
    Problem is Easy
    
    */
    
    /*
    small observations--
    
    */
    
    void solve() {
        int x,q;
        cin >> x >> q;
    
        multiset<int> a,b;
    
    
    
        while(q--){
            int A,B;
            cin >> A >> B;
    
            int e0 = min(A,B),e1 = max(A,B);
    
            if(x <= e1 && x >= e0){
                a.insert(e0);
                b.insert(e1);
            }else if(x < e0){
                a.insert(x);
                b.insert(e0);
                b.insert(e1);
                x = *b.begin();
                b.erase(b.begin());
            }else if(x > e1){
                a.insert(e0);
                a.insert(e1);
                b.insert(x);
                auto it = a.end();
                it--;
                x = *it;
                a.erase(it);
            }
    
            cout<<x<<'\n';
        }
    
    }
    
    int32_t main() {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        solve();
        return 0;
    }
    
    
»
4 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

MathCoder

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

Solved 4 questions in 19 minutes,but rank is 2700+

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

Solid contest!

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

its my first time solving questions from A to D, is this contest slightly easier than the previous beginner contests? I hope not, I want to believe that I have improved 🙃

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

in D i did coordinate compression, then used a frequncy array for the elements and each query found the median using binary search on prefix sums (using segment tree) :pray: 100 lines of python, O(n * logn * logn) and still AC :D

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

You are right but F is another version of abc305_g. It's no doubt that someone is submitting problems which are used in other contests before for ABCs.

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

    I think its almost identical to this G — Banned Substrings https://atcoder.jp/contests/abc305/tasks/abc305_g like damn I have the gist that it gonna be making dp based on automation transition of valid and invalid state then turn that dp into matrix to solve for large n and something, yeah sadly I did not solve it... I don't remember/understand much about ahocorasick automation sufficiently enough to use it in correct ways so I'm having mental breakdance mid compettition trying to remember how the hell I did solve that Banned Substrings before but damn... no luck. 🥀🥀🥀

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

Anyone who get WA 12 and AC 48 on problem F can try this test case:

3 2 b abc

The answer should be 15625, you might get 15674.

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

How to solve F?

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

The problem E is too difficult ! I don't want to see counting-problems anymore !

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

900 solve on F,what a joke.

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

Any hints for today's problem D.?

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

    Hints:

    Hint a
    Hint b
    Hint c
    Hint d
    Spoiler
»
4 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why is there a discussion about atcode on Codeforces?

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

My lucky day! My [Atcoder] rating skyrocketed from 294 to 334!

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

I think this contest is not good.because some problems are in Luogu.

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

welp, I managed to do the first two... TLE on C and D :(