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

Автор errorgorn, история, 5 лет назад, По-английски

Hello again Codeforces!

errorgorn, oolimry and iLoveIOI are glad to invite you to participate in Codeforces Round 723 (Div. 2) which will be held at May/28/2021 17:05 (Moscow time). The round will be rated for the participants with a rating lower than 2100. Participants from the first division are also welcomed to take part in the competition but it will be unrated for them.

You will be given 2 hours and 30 minutes to solve 6 questions. One of the puzzles is interactive, please read the guide of interactive problems before the contest.

We would like to thank:

We hope you find the bugaboos interesting and fun! Wish you high rating!

Here is scoring distribution because you guys deserve it <3

  • 500 — 1000 — (750+1000) — 2250 — 2500 — 3500

Btw, remember to downvote all testers who writes stupid comments to beg for likes.

UPD: editorial released

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

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

stupid comments to beg for likes

»
5 лет назад, скрыть # |
← Rev. 4  
Проголосовать: нравится +98 Проголосовать: не нравится

As a participant of the testing contest, sir antontrygubO_o has barred us to post "as a tester" comments. So following his order, Enjoy another consecutive contest under lord Anton ! The authors did a great job with the problems ! Wish you high rating. !

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

'Btw, remember to downvote all testers who writes stupid comments to beg for likes.'

The testers right now:

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

Smart comment

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

Jokes apart, the problems are really nice and errorgorn sir doesn't like long problem statements so it's going to be a nice contest.

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

Is it ok for non-testers to ask for upvotes?

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -6 Проголосовать: не нравится

The last round had very nice problems!! Expecting even more nicer problems this time!!

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

Thanks to the last round, I can be rated this round :D

»
5 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится -23 Проголосовать: не нравится

.

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

Div 1.5 on it's way :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -23 Проголосовать: не нравится

Which problem is an Interactive Problem? It should not be anyone one of A, B and C. :(

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

Don't forgot to consider the UNUSUAL START TIME

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +42 Проголосовать: не нравится
»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +206 Проголосовать: не нравится

..2 hours and 30 minutes to solve 6 "questions"

Radewoosh triggered

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

It will be my first div2 round. Just do it!

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

How do you fix contest duration?

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -18 Проголосовать: не нравится

Ignore.

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

Can anyone tell me, how does this "750+1000" scoring works?

I hope the contest overload Codeforces server with great participation just like now when I am reading this announcement :)

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

Race to specialist begin ...

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

I came looking for bugaboos, I WAS NOT DISAPPOINTED

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

nice contest

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

Can a tester say the round was bad for once please :D

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

Why are we not using bugaboos instead of questions?

»
5 лет назад, скрыть # |
← Rev. 7  
Проголосовать: нравится +75 Проголосовать: не нравится

Just couldn't resist more.

Codeforces Round #753 Memeset

The following memeset is divided into 5 memes, one of which has two parts, so basically 6 memes. You will have 30 seconds to waste on it.

I sincerely hope you all enjoy it.

Odd Bugaboo

A

Bugaboo Ragnarok

B

Arei Syndrome

C

Bugaboo Apocalypse

D

A no namer cyan posting memes, meanwhile THE red coder-

E1

Close up Rade-vieew-shh:

E2

Thanks and don't wait for editorial.

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

I am damn Sure that Binary Search will be Used in One of the Problem in this Contest.


How?
Smartly Written Post!

Upvote if you Found it Helpful !

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

CF never disappoints us. Bugabooset

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

now that cf changed problemset to bugabooset, i can happily tell, i cant wait to solve more bugaboos in this round with you all!

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

I hope there will be short tasks.

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

Hope I reach Pupil today. Wishing high rating to everyone:)

»
5 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +5 Проголосовать: не нравится

pretests || system tests

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

Bugabooforces

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

C score distribution is 1750?why it is in brackets?

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

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

Wish I would be able to solve at least 2 bugaboos in this contest

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

iLoveIOI What happened to you after 2018?

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

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

Hope the question statements will be short and clear

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

zadgavgava.

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

2 hours and 30 minutes for 6 problems? This one is going to be tough

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

hope this contest will be the one to break my negative rating streak :D

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -14 Проголосовать: не нравится

.

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

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Problems were very Interesting!! Thanks to the setters.

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

I literally hate 1111.

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

Now, we all hate 1111

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

My Health gone negative today.

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

lmao ‎‎‎‎‎‎‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎

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

Gave my best, but this contest was too hard. Solved 0 out of submissions for a, b and c. Have to improve my intuition.

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

E is just this paper. Did authors know about this? It was a bit too easy to find.

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +14 Проголосовать: не нравится

Had a very bad contest. Was C some sort of greedy?

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

Out of curiosity, is it possible to compute the optimal swapping cost in problem D for two arbitrary strings in less than O(n ^ 2)?

After realizing the answer was always made up of contiguous blocks, I bricked on this subproblem for an hour before realizing I could calculate it in O(n * characters) as long as one string had that property.

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

Some one please tell me about approach of B

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

What's your approach to Kill Anton?

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

every random logic passed first pretest on problem D but failed on second. What was story behind putting "ok You are epic!" in pretest 1 of D ?

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

    The first pretest is just the sample test from the statement. And the OK message is probably the same for all test cases (in this contest at least), but obviously the system won't show more testcases before the end of the contest.

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

I love Anton Sir very much. (:

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

problem statement for D was quite entertaining and funny loved it ♥

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

The title of problem B is giving a clue for solving the question

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

What the hell was problem B! Spent almost the entire contest thinking on it!!!!

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

I got RE#5 of problem D, can anyone help me? Thanks!

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

:(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

as a first AC, you are late AC.

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

From problem C I saw the real power of Priority Queue! Good contest :)

  • »
    »
    5 лет назад, скрыть # ^ |
    ← Rev. 9  
    Проголосовать: нравится -19 Проголосовать: не нравится

    Actually there are few cases at each index(from left to right). If current value is negative and reduces the total current sum to < 0, then just check minimum element from priority queue(of negative numbers which have seen and added to the sum until this step during the iterations) if this value is less than it, just ignore this step and go to the next, otherwise just pop priority queue and push this value into it, also change current sum. Note that 1) We need all the positive numbers, it's not the problem of course. 2) If current value is bad to choose this time, it's also bad idea to pop pq twice or more, it's much better to skip this value only(or swap with minimum negative to improve current sum). If current value isn't bad, then just increase total amount and change current sum too(also if this value is negative, push it into our pq of negative numbers).

    // Below see code

    include <bits/stdc++.h>

    using namespace std;

    define ll long long

    int main() { ios::sync_with_stdio(false);

    int n;
    cin >> n;
    
    vector<ll> vec(n);
    for (int i = 0; i < n; i++) cin >> vec[i];
    
    ll res = 0;
    
    priority_queue<ll> pq;
    ll cur = 0;
    for (int i = 0; i < n; i++) {
        if (cur + vec[i] < 0) {
            if (!pq.empty() && cur - (-pq.top()) + vec[i] >= 0) {
                if (-vec[i] > pq.top()) {
                    // don't need do anything, if this value doesn't improve sum
                }else {
                    cur = cur - (-pq.top()) + vec[i];
                    pq.pop();
                    pq.push(-vec[i]);
                }
            }
        }else {
            if (vec[i] < 0) pq.push(-vec[i]);
            cur += vec[i];
            res++;
        }
    }
    
    cout << res << endl;

    }

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

How many of you are getting bad rank because you came 30 minutes late because of your carelessness. It happened to me as well. :(

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

It was a very strange round for me.

A) No idea, let's random shuffle
B) Spent some time, maybe 5-10 mins wandering whether my solution will pass and why it passed and whether I should optimize it just because thought that 500 * 10000 amounts to billions
C1&C2) Made some stupid mistakes and got -150 for incorrect submissions
D) Immediately got what the answer should look like. Spent an hour googling how to find inversions and copy pasting some functions from stackoverflow until it worked.

After which surprisingly found that I am quite at the top and left the contest because knew that I wouldn't be able to solve E even for an entire hour

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

Thank you for the round. I really liked these problems, but due to my low level i couldn`t solve all of them. Waiting for more rounds from you :)

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

.Pics-Art-05-28-10-35-34

  • »
    »
    5 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится +1 Проголосовать: не нравится

    The place under the picture should be mine

    Cause I still don't know how to solve A constructively, just random shuffled it

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

      I did the same after noticing that the upper limit for n was laughably small. Also having no idea how to solve problem A constructively made me finally switch from Ruby to D programming language. Because a 20x-100x speedup surely increases chances for a non-optimal solution to be accepted.

      It's interesting that there were two persons using D and only one person using Ruby among more than 10k contestants today.

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

Today's contest was shit for me

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +39 Проголосовать: не нравится

MikeMirzayanov When will you update the rating ?

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

 ok Nice! (Bugaboo A)

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

It was a nice contest with understandable problem statement. I loved doing this contest thanks for the contest

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

Thanks for the fun bugaboos! Here's a link to my screencast. (An HD version will be ready within the next few hours.)

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

Codeforces these days is coming with tricky and tough questions to think upon in contests..isnt it ?

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

Can someone share more problems based upon Chicken Mcnugget Theorem .

Thanks in advance .

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

I solved problem C1 in the last minute, but got so excited that forgot to submit C2 :(

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

Is the next Codeforces Round for DIV2 going to be in 2 weeks?? If yes then why such a long wait?

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

    A DIV1+DIV2 contest is in two days and you are eligible to participate in it. Also more DIV2 contests are likely to show up in the schedule. Many of them are announced with just a few days notice.

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

errorgorn and the testers are madlads for having this as a test case for 1526A - Mean Inequality.

ORZ, ORZ, ORZ

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

Problem C is a known problem. 11 days old blog link . Similar problem link.

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

After the contest i was assigned to a room.What does that mean actually?

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

What is wrong in this solution for question c2 ?

include <bits/stdc++.h>

define ll long long

define ld long double

define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

const ll MOD = 1e9 + 7; const ll N = 2e5 + 5;

ll n, a[N], sum = 0, ans = 0;

int main() { IOS;

cin >> n;

set<ll>s;

for(ll i = 1; i <= n; i++)
    cin >> a[i];

for(ll i = 1; i <= n; i++)
{
    sum += a[i];
    ans++;
    s.insert(a[i]);
    if(sum < 0)
    {
       ll x = *s.begin();
       sum -= x;
       s.erase(s.begin());
       ans--;
    }
}

cout << ans << endl;
return 0;

}