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

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

We will hold AtCoder Beginner Contest 458.

We are looking forward to your participation!

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

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

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

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

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

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

Hope I can solve D and E

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

goodluck

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

PE makes me want to go play valorant right away

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

can anyone help me out with D after the contest

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

    may i can help u after the contest xD

  • »
    »
    4 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится -7 Проголосовать: не нравится

    Use PBDS along with find_by_order().

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

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

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

    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 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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 месяца назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

MathCoder

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

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

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

Solid contest!

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

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 месяца назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

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 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

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 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

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 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve F?

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

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

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

900 solve on F,what a joke.

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

Any hints for today's problem D.?

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

    Hints:

    Hint a
    Hint b
    Hint c
    Hint d
    Spoiler
»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why is there a discussion about atcode on Codeforces?

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

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

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

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

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

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