SlavicG's blog

By SlavicG, history, 9 months ago, In English

Hello Codeforces!

mesanu, flamestorm and I are very excited to invite you to Codeforces Round 886 (Div. 4)! It starts on Jul/21/2023 17:35 (Moscow time).

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.

Many thanks to all testers: MikeMirzayanov, erekle, Bakry, Dominater069, Gheal, andrei_boaca, zwezdinv, sam571128, Sho, Wibo, Phantom_Performer, moonpie24, mafailure, Kalashnikov, SashaT9, Qualified, haochenkang, ZiadEl-Gafy, MADE_IN_HEAVEN, AdOjis485, qwexd, mkisic, Killever, sabbir-hasan-anik, peshkoff, donghoony!

And thanks to Vladosiya for translating the statements!

We suggest reading all of the problems and hope you will find them interesting!

Good Luck to everyone!

UPD: Editorial is out!

  • Vote: I like it
  • +259
  • Vote: I do not like it

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

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

i am so excited it is my first *out of competition contest :)

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

As a Newbie participant, I hope not to be Newbie again after this contest

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

As a tester, I would say this is a great Div. 4 Round.

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

As a tester, there will be a lot of wisdom bestowed upon you.

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

As a Newbie participant, I hope to be Pupil after this contest

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

My first unrated round! :)

»
9 months ago, # |
  Vote: I like it -23 Vote: I do not like it

As a gray participiant, I hope to be a LGM after this contest)

If you want to race

GL & HF

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

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

I hope not to encounter any crazy, confusing story or analogy like the previous Div 2 contest.

Super Pumped & Excited !

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

As a newbie Eagerly waiting for Div:4 contest...

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

Finally Div:4 after long time. I think because Div.4 it's easy to reach pupil .

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

By the way, what is the difficulty of this game

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

    Division 4 is the easiest division. It's aimed at people with a rating below 1400.

    • »
      »
      »
      9 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      I only solved 3 of them what that means?, btw this is the first time I join a contest.

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

Excited! I hope i will do well in this round.

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

As a tester, please stop posting cringe unfunny memes

Also the problems are pretty good

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

official participant with highest rating

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

Looking forward to my first out of competition round!

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

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

    Will it not be better if you use specialist instead of pupil.

    • »
      »
      »
      9 months ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      no the newbie is refering that pupil is the highest rated color for Div.4

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

Dattebayo

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

First unrated contest

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

another chance to be a pupil

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

I am going to lose my 888... and get 999 or 1111. :P

»
9 months ago, # |
  Vote: I like it -7 Vote: I do not like it

As a participant , I will test my speed through this contest

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

This is my first round as a TESTER. Wish you all the best & hope you will enjoy this round.

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

As a participant, I hope to be Specialist after this contest

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

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

Hoping to reach specialist after this contest!

  • »
    »
    9 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Well, it's practically not possible. But I get what you want to convey. Same here. Skill issue

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

After so many fuck ups DIV-4 is the only hope for me.

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

This is my first programming contest, I am excited.

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

Thanks for creating these! Fridays are a bit complicated for me in schedule but it's still fun to participate and continue to learn. Look forward to this contest!

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

Excited to become Newbie for the first time !

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

I hope there will be very interesting problems)

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

Contests for all div 1,2,3,4 in the next 5 days...balanced, as all things should be

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

Ahhh! Finally the blog is here. Best of luck to all newbies like me.

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

As a tester, it tasted like mother's cooking.

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

why only 120 minutes why note 135 minutes

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

Waiting....

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

Good luck to everyone

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

Hello everybody!

I wish you all good luck! I would like to become a student (green). I hope that the competition will be interesting.

Best, Jelal

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

Hoping to solve all problems!

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

What will be the topics?

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

hopefully i reach spec again after this

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

First unrated round

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

pupil I'm coming (:

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

I hope this is the last contest Div. 4 rated for me:>>

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

Hope it be my last rated div 4 contest

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

yes div 4

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

Alright, iron contest!!!

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

wait so Div. 4 is easier than Div. 3 (or Div. 2 (or Div. 1))? I thought the reverse, but seeing that this competition is rated for participants with rating $$$<1400$$$, and the previous one (with Vika) is for rating $$$<2000$$$ or something, I now think this round is gonna be easier..?

  • »
    »
    9 months ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Yes, that is correct. Div. 4 is easier than Div. 3 which is easier than Div. 2 which is easier than Div. 1.

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

pupil soon ;)

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

It's been 3 minutes without Div4, I can't stop shaking and I'm having serious mental breakdowns. I woke up today trying to log into Div4 but the site was down, I had a big panic attack but I managed to calm down after a few hours. I couldn't go to school today, I'm so worried that I even took my father's gun from the shed, thinking about killing myself. I am nothing without Div4, it's my life, it's my destiny, without Div4 I wouldn't be able to do anything. Div4 is the best thing ever made and I can't shake the addiction, it's the best oj out there. I can't stop shaking and crying, I'm so worried. I spent all my time on Div4, got rating and contribution.

  • »
    »
    9 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    If Div4 has a million fans, then I am one of them. If Div4 has ten fans, then I am one of them. If Div4 has only one fan then that is me. If Div4 has no fans, then that means I am no longer on earth. If the world is against Div4, then I am against the world.

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

I hope i become a specilast again

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

Bruh, my browser is always being checked. What's wrong?

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

div5

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

Problem set is good. The statements are short and easy to understand. A good div4 round...

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

My first *out of competition :)

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

My first rated competition.

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

i spent like 35 minutes on problem H, just to realize that i misread the question. literacy issue ngl. very good problemset btw :D

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

    I did the same on problem E, thinking c was just the sum of the borders and not the cardboard "behind" the image.

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

the first contest that I aked !!!

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

what was the upper bound for binary search of problem E?

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

    l = 0, r = 1e18.

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

      No, the bound is around 1e9.

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

      given w>=1 how can l be 0

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

        it is actually doesn't matter, answer won't be 0 anyway

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

          Why the upperbound cannot be 1e18 ?

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

            Because the upper bound of c is 1e18.

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

            let's say n = 1 then c = (2 * w + a[0]) * (2 * w + a[0])

            since c up to 1e18, w can't be greater than ~5e8

            for example if we will take w = 6e8, it will be

            (2 * 6e8 + a[0]) * (2 * 6e8 + a[0]) = (1.2e9 + a[0]) * (1.2e9 + a[0]) > 1e18

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

          true but for binary search we have to take a range such that answer is possible in that range

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

    ig sqrt(1^18), so 1e9

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

    I too couldn't figure it out at first. Then I started upper bound from 1 and kept on doubling it till it was less than my required value. After that used binary search

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

    Sridharacharya formula ftw

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

It was fun.. Thanks

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

Div 4.5

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

I really enjoyed this round. Hope not getting hacked :/

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

What's wrong here. I am pretty sure it's a graph problem(Last problem.)

My code
  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You're treating it as an directed graph.It is an undirected graph,add both the edges.

  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Input:
    1
    3 2
    2 1 1
    3 1 2
    
    Your Output:
    NO
    
    Correct Output:
    YES
    
    Explanation:
    idx | pos
     1  |  3
     2  |  2
     3  |  1
    
»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can anyone help me out in the "F" problem , i got stuck in the 6th testcase, like shouldn't the answer be 6 when the trap is placed at position "24" Help me out!

this is my approach

int32_t main() {
    int t;
    cin >> t;
    while (t--) {
       int n;
       cin>>n;
       vector<int>nums(n ,0);
       unordered_map<int , int>m;
       for(int i=0 ; i<n ; i++) 
       {
           cin>>nums[i];
       }
       int ans=INT_MIN;
       int pos=0;
       for(int i=0 ; i<n ; i++)
       {
            int temp=n;
            int x=0;
            while(temp--)
            {
                cout<<x<<"  ";
                m[x]++;
                if(x!=0) 
                {
                    if(m[x]>=ans)
                    {
                        ans=m[x];
                        pos=x;
                    }
                }
                x+=nums[i];
            }
            cout<<endl;
       }
       
       cout<<"answer :"<<ans<<endl;
       cout<<"pos :"<<pos<<endl;
    }

    return 0;
}

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

Yo can someone pls help me out I dont get whats wrong with this code on problem 5. https://codeforces.com/contest/1850/submission/214926782

I tried to find the multiple that appeared the most, since that would catch the most frogs.

  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Input:
    1
    10
    2 2 2 2 2 3 3 3 3 3
    
    Your Output:
    5
    
    Correct Output:
    10
    

    Explanation: You can place a trap at position $$$6$$$ to catch all frogs.

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

Hey, I am new to Code forces, can you explain these 2 points in little bit more detail please?

  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)

  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated

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

    After the contest, the participants have 12 hours to "hack" any target solution, this means they can submit a test case where they think the target solution will fail (of course still within the problem bounds). If successful the hack is added to a pool of tests that will later be applied to all solutions (all successful hacks are applied to all solutions), so in the end you have accepted solutions that have passed every valid test.

    Edit:Div3, Div4 don't give points for hacking.

    Old (mistake, only Div1, Div2)
  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    After the contest everyone can download everyone else's submissions and try to find a test case where a code would fail. After the 12-hour hacking phase all hacks are added to system tests.

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

    it means if you tried to be cheeky with solutions and somehow squeezed them , then you are at risks of masters giving overflow or time/memory limit errors with new test cases

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

my answer in E could have been accepted during the round but i was automatically logged out during the competition and had difficulty logging in..when i finally was able to logged in, the competition was over..

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

Is it so dumb to take too much time for the E (divide first would be the more suitable name for the problem)?

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

    No it's not dumb. Dumb is that i was using quadratic formula to solve for 'w' and in the end couldn't submit because for some reason it wasn't working for very large inputs

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

      I used the same approach. You took int for some variables. change that —

      long double x=4*n , y=0, z=0;

      And typecast your output-

      cout << (long long) ans << endl;

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

        Hmmm, ok I'll try this later because contest is frozen right now. However, in my local IDE the outputs are different somehow. For example: 7654319 instead of 7654321. This will probably give WA because there is no permissibile range mentioned in the question.

        Update: it works

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

Tried my best as it was my first contest in codeforces hope will do better in next time

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

I couldn't solve E what's wrong here?

void solve(){ ll n; long long c; cin >> n >> c; vector arr(n, 0); ff(i, 0, n) cin >> arr[i];

ll sum = 0;
ll ss = 0;
ff(i, 0, n) ss += (arr[i] * arr[i]), sum += arr[i];

ll sq = sqrtl((sum * sum) - n * (ss - c));
cout << (sq - sum) / (2 * n) << nl;
return;

}

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

    I think it fails because of sqrtl, I had the same issue as well, find the square root by binary search. Also, if you are solving it by the quadratic formula, shouldn't it be $$$w=\frac{-4\cdot sum+\sqrt{16\cdot sum^{2} - 16\cdot n\cdot \left ( ss - c \right )}}{8\cdot n}$$$ ?

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

      ya I just took 16 outside and divided it by 4.

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

      this is what i did lmao and i really struggled with big numbers, ended up using double

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

    It will overflow long long.

    Suppose n=1e5, c=1e18 and all inputs are 1. then n*(ss-c) will be approx. 1e5 *(1e18-1e5) almost equal to 1e24.

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

We want div-4 contest more often as beginer

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

best div 4 contest ever

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

Wow. That was nice contest. Overall, good problemset.

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

My first contest. Wish to come out with my best.

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

Good Problem Set. It seems that the difficulty difference between Div3 and Div4 is much higher than Div3 and Div2.

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

Toi bi cung chim

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

Thanks for the awesome round !! Really enjoyed solving the problems ;D

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

Thanx Man i Really enjoy this Round

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

good round, was too scared to implement dfs for H and ended up staring at it for 1 hour :(

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

What was the solution for G? My solution was to project all the points onto {1,0}{1,1}... all the directions. Group them into bins based on if they landed at the same point (after correcting for length of points), and then adding n choose 2 from each of those bins to ans. However, I got some error that I couldn't figure out if was due floating point inaccuracies or because my solution was wrong / nonsense.

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

    x , y , x-y , x + y If one is the same, it's a pair

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

    You don't need floats here

    Find points count on each existing line

    vertical[y] += 1
    horizontal[x] += 1
    diagonal1[x + y] += 1
    diagonal2[x - y] += 1
    

    Then iterate over all of them and add C(n, 2) to the result (where n is count of points on current line)

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

      Why do you add $$$\binom{n}{2}$$$?

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

        Because he had studied combinatorics in school. (It's just a joke..)

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

        Because it's a count of all different pairs on that line.

        Also forgot to mention that you need to multiply the result by 2 (to count reverse too)

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

          Oh, I didn't notice your solution iterates over all the lines. I thought it iterates over every point, in that case you would have to add $$$n-1$$$.

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

best div 4 contest

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

Honestly at this moment the cheating at its best, answers are flowing everywhere during the contest and thousands of people just copying those answers. SlavicG MikeMirzayanov can you guys do something about this. The questions were quite interesting, cheating is not going to affect my individual skill but it do low my confidence seeing this. It's disheartening to see this, there is no fair competition anymore.

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

Hi Coders, I have done the problem E, with a linear approach, which was very slow and then i thought about binary search but some test cases passed and some not. Please can someone advice on what is wrong with this code below ?

#include <bits/stdc++.h>
#include <iostream>
#include <vector>

using namespace std;

void solve() {
	int n;
	long long c;
	cin >> n >> c;
	vector<long long> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	int l = 0;
	int r = 1e9;
	int w = 0;
	while (l <= r) {
		w = l + (r - l) / 2;
		long long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += ((2*w + a[i])*(2*w + a[i]));
		}
		if (sum == c) {
			break;
		} else if (sum < c) {
			l = w+1;
		} else {
			r = w-1;
		}
	}
	cout << w << "\n";
	return;
}

int main() {
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t;
	cin >> t;
	while (t--) {
		solve();
	}
}
  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    there might be overflow in your mathematical expressions

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

    there is an overflow

    for (int i = 0; i < n; i++) {
    	sum += ((2*w + a[i])*(2*w + a[i]));
    }
    
    • »
      »
      »
      9 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, it is definitely an overflow issue. It passed with long double instead of long long.

      • »
        »
        »
        »
        9 months ago, # ^ |
        Rev. 2   Vote: I like it +10 Vote: I do not like it

        yeah it passed because of long double has 80 bits.

        but better to use __int128 instead, because there can be some unexpected values while dealing with doubles

        another way u could write something like

        for (int i = 0; i < n; i++) {
        	sum += ((2*w + a[i])*(2*w + a[i]));
                if(sum > c)break;
        }
        
      • »
        »
        »
        »
        9 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        use __int128 instead

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

          the worst part is that my compiler compiled the outside test cases and CF wasn't able to , and i didn't know about __int128 after contest i did this i got accepted then :(

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

    I found a fast solution using linear approach.

    void solve() { int n,k; cin>>n>>k; int sum=0,sums=0; f(n){ int arr; cin>>arr; sum+=arr; sums+= arr * arr; } int wm = static_cast(std::sqrt( (k — sums — 4*sum)/(4*n)) ); int i = wm + 1; while(i>0){ if( (k-sums) == (4*n*(i*i) + 4*sum*i)){ cout<<i<<ln;return; } else i--; }

    }

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

      Can you provide editorial for your approach ?

      • »
        »
        »
        »
        9 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        void solve() {
            int n,k;
            cin>>n>>k;
            int sum=0,sums=0;
            f(n){
                int arr;
                cin>>arr;
                sum+=arr;
                sums+= arr * arr;
            } 
            int wm = static_cast<int>(std::sqrt( (k - sums - 4*sum)/(4*n)) );
            int i = wm + 1;
            while(i>0){
                if( (k-sums) == (4*n*(i*i) + 4*sum*i)){
                    cout<<i<<ln;return;
                }
                else i--;
            }
            
        }
        

        just finding closest estimated width nearest to and which is always greate than actual width using: w = sqrt( (C - sigma(s^2) - 4*sigma(s)) / (2*n) ) actual expression is C - sigma(s^2) = 4*n + 4*sigma(s))

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

    use the Quadratic equation :> ps: don't use long long but double instead TvT

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

      I don't think using double is a good idea

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

      Actually, i tried double, it did not work then I tried long double and it was accepted.

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

        yeah :< but in the contest i used long long and...:<

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

      why double accepted, but long long overflow, in statements said w is integer, i tried long long cause thought roots = (-b-+sqrt(D))/2*a too should be integer but its rounded.

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

        I don't think double will get AC, he probably mean long double

        it AC because long double has 80 bits, meanwhile long long has 64 bits

        upd: I was wrong, double got AC, may be double can hold more than long long, but sometimes it cost accuracy.I believe in this problem better to use __int128

      • »
        »
        »
        »
        9 months ago, # ^ |
        Rev. 5   Vote: I like it +1 Vote: I do not like it

        also (x1+2w)^2 + ... + (xn+2w)^2 = c

        c = x1^2 + 4x1w+(4w)^2 ...

        c-=(x1^2 + x2^2 + ... )

        new_c = 4x1w+4x2w+..+4w^2+...(n times)

        c = 4w(x1+x2+...+wn)

        godamn i got it now i did c/=4

        then nw^2 + w(x1+x2+x3...) — c = 0

        and its exceeded in long long but accepted double

        but i can make c/=(n*4) cause 4x1+4x2+4x3... (n times) and (4w^2+..) n times

        and it's accepted long long

        https://codeforces.com/contest/1850/submission/214943996

        upd: seems like (w(x1+x2+x3...+xn))%n doesnt have to be 0 but it's accepted

        Can someone explain why it's have to be 0

        this should be accepted cause gcd should return at least n

        https://codeforces.com/contest/1850/submission/214927321

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

        :> cuz long long is not as precise as long double

  • »
    »
    9 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it
    Input:
    1
    10 90
    1 1 1 1 1 1 1 1 1 1
    Output:
    1
    
»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

the problems are very nice TvT

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

There should be more contests in division 3-4 like this one for making new coders confident.

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

Now, waiting for the Editorial

»
9 months ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

Amazing contest!. Problems were clear and easy to understand. Difficulty was a bit easier than normal Div4, but great problems nonetheless. Thanks a lot SlavicG mesanu flamestorm and all testers.

»
9 months ago, # |
  Vote: I like it -12 Vote: I do not like it

Worst experience , either you make your platform better or just don't rate the contest, total time waste

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

Can someone please give me hint on problem F?

Going through test cases I deduced:

1) You can ignore numbers > n

2) I could figure out that trap would be the LCM of some remaining numbers. ST LCM<=n.

But couldn't proceed further.

For, 9 11 9 12 1 7 2 5 8 10

We can ignore 11,12 And LCM( 10, 2, 5,1) = 10 Trap can be set up at 10. So these 4 frogs can be caught.

How to proceed from here?

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

    Let's say you place the trap at point p, think about which frogs will be able to step exactly on that point.

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

      The ones with jump=x and p%x = 0.

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

        Exactly, that's the solution.

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

          Ah.

          Simply iterate over all initial jumps possible. Then see where all can they jump to.

          Position with maximum reach is the answer. In a way, it's brute force.

          I just overthought the problem; Since it was an 'F' problem, I assumed it'll involve some number theory or AP or something. My bad.

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

Is Carrot working for anyone?

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

can someone explain the problem E like how the answer of 1st test case is 1

thanks....

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

editorial?

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

why this is an invalid input for F?: https://codeforces.com/contest/1850/hacks/931609/test I think because the output is bigger than 256 kb, but what to do if I want to test the limits?

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

    one cannot see others hacking test cases, and if you are talking about the test case you wanted to try is large then you can write a code to generate that test case and submit that code.

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

      AH OKAY, so I guess it's not legal to paste it to ideone and give the link.. actually that's what I did, I made a generator. when I make the number of frogs low it passes, if I put it 2e5 , it will not even when with one test case so the sum will not exceed 2e5

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

My G got hacked (TL). Is it because of Python defaultdict? https://codeforces.com/contest/1850/submission/214881069

def solve():

ways = 0
n = int(input())

# read n points

xm = defaultdict(int)
ym = defaultdict(int)
sm = defaultdict(int)
dm = defaultdict(int)
points = []
for i in range(n):
    x, y = map(int, input().split())
    points.append((x, y))
    xm[x]+=1
    ym[y]+=1
    sm[x+y]+=1
    dm[x-y]+=1

for x,y in points:
    ways += xm[x] - 1
    ways += ym[y] - 1
    ways += sm[x+y] - 1
    ways += dm[x-y] - 1



return ways
»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

https://codeforces.com/contest/1850/submission/214941507 Can anybody explain why am I getting TLE for problem F, isn't harmonic series nlogn?

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

    Your approach is not harmonic. The countertest is n = 2*1e5 and all array elements are 1.

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

      Thanks

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

      What should I ideally do?

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

        Read the editorial or try to think about a faster approach.

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

        keep frequency map. and increase it by count of each number in array. rather than doing it for every element individually.

        code
»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Seems the only codeforces contest with highest participation and with highest problem a solver

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

    Sadly, many people see problem A, if it's difficult, they don't submit ,and hence don't participate. In this contest, A was too easy, thus almost everyone submitted, and participation flooded.

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

Can someone hack my G or H?

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

    G, I don't think so. Many Gs were hacked which used unordered_map. Since you used regular map, it won't be hacked, acc to me.

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

      no I didn't use regular map , I used unordered_map

      scroll up and you will find :

      #define map unordered_map
      

      but I think it still won't be hacked because I have hash struct passed

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

        "#define map unordered_map" ohh didn't see this. "but I think it still won't be hacked because I have hash struct passed", then it would be safe ig. GG

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

          Can you tell me why map works but unordered map doesn't?

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

            Unordered map takes O(n) avg time complexity to insert n items. But for certain inputs, it can take O(n^2). Thus, solutions using Unordered_map can be hacked by putting in those specific inputs.

            Refer to this blog bro, for more details- https://codeforces.com/blog/entry/62393

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

My first AK contest on Codeforces!

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

I used binary search for problem-E but it has some error which I am unable to figure out. Can anyone please help me find error in my binary search logic for my submission 214950555. ? edit : when i set r = 1e10 the sample test-cases passed but on submission it fails again on some test case.

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

    You need to handle overflow for both multiplication and summation. Better to calculate the sum like this: sum+=(a[i]+2*w)^2 and check if sum > c.

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

      Thanks for the reply.

      But it should not overflow as I have taken unsigned long long. also on codeforces custom invocation it did not show any overflow errors. also the code works when i set r = 1e10.

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

        4*n*m*m would definitely overflow. It’s roughly around 10^23. Put some debug print and check how your binary search behaves for larger n.

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

          Yes you are right. I was only checking for the overflow of the sqr_sum and sum initially but the actual culprit was the expression ull val = sqr_sum + 4*n*m*m + 4*m*sum;

          Thanks.

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

      I lost so much time on overflow prevention I have to use long double so my brain didn't get fried

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

Me trying to solve problem E be like: photo-2023-07-21-19-46-30
gimme smileys

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

Can anyone tell me where did i wrong in this code

t = int(input())

for _ in range(t):
    n, m = map(int, input().split())
    d = [[] for i in range(2 * n)];
    check = [False for i in range(2 * n)];
    checkpos = [-1e18] * (2 * n);
    def dfs(val, u):
        check[u] = True;
        checkpos[u] = val;
        res = True;
        #print(u, val)
        #print(u);
        for v in d[u]:
            #print(v[0], v[1]);
            if(checkpos[v[0]] != -1e18 and checkpos[v[0]] != val + v[1]):
                return False;
            if(check[v[0]] == False):
                #print(u, v);    
                res = res and dfs(val + v[1], v[0]);
        return res;
    def dfscheck(val, u):
        check[u] = True;
        res = True;
        for v in d[u]:
            if(not checkpos[v[0]] - checkpos[u] == v[1]):
                return False;
            if(check[v[0]] == False):
                res = res and dfscheck(val + v[1], v[0]); 
        return res;
    def dfsclear(u):
        check[u] = False;
        for v in d[u]:
            if(check[v[0]] == True):
                dfsclear(v[0]);
    ans = True;
    for i in range(m):
        a, b, dis = list(map(int, input().split()));
        d[a].append((b, dis));
        d[b].append((a, -dis));
    for i in range(1, n + 1):
        if(check[i] == False):
            ans = ans and dfs(0, i);
            dfsclear(i);
            ans = ans and dfscheck(0, i);
    print("YES" if ans else "NO");
»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

if I haven't solved 5 problems in 5 contests am I unrated for this contest ?

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

    If you have $$$< 1400$$$ rating, you are always rated in Div. 4.

    If you want to appear on the official leaderboard (i.e. standings, when "show unofficial" is off), you need to do what you stated. This does not affect if the contest is rated or not.

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

Can someone please tell me why am I getting wrong answers for large test-cases Solution

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

What time will the rating results be released?

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

I guess div-4 is a round, where Atleast newbie’s understand problem statement very well, thanks question setter and cf as well. Take love

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

I HATE Div.4

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

why in the solution to problem F for the second loop we increment it by the counter of the first loop , how does that work

»
9 months ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

Can someone explain how this $$$\mathcal{O}(n)$$$ solution gets TL? I mean, the constant must be big because of using unordered_maps but still... Is it the case?

https://codeforces.com/contest/1850/submission/214910960

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

    It's not about the constant, single unordered_map operation takes $$$\mathcal{O}(n)$$$ in worst case. See this

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

Can someone tell me what wrong with my solution for E. https://codeforces.com/contest/1850/submission/214901900

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

Weak test

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

hope there will be more chance for me to play like this

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

The most fun contest I've had in a while. Can't solve much problem in Div.3 so when I got 5 problems in this contest I feel somewhat awarding about my learning progress hehe.

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

i lost the game aaaaaaaa

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

Can someone explain why long double works while long long fails. Also I had to divide my equation with 4, else it failed on 7th test case even with long double. WA on test 7: https://codeforces.com/contest/1850/submission/214987856 Accepted: https://codeforces.com/contest/1850/submission/214987923 How to be sure whether long double will work or not using the constraints? Please explain.

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

anybody have idea for problem G? Help me?

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

Why my rating didn't change after this contest?

mesanu flamestorm

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

When will the system testing begin for this contest?

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

Hope to reach pupil after this contest

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

    Download some rating prediction extensions. You'll know your rating change during and after contest, before the official release.

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

I saw in some people's code of 5th problem, they have used __int128, i am seeing it first time, i want to know how this works!

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

    __int128 is a type with 128 bits, ranging from $$$[-2^{127}, 2^{127}-1]$$$;

    while int is a type with 32 bits, ranging from $$$[-2^{31}, 2^{31}-1]$$$.

    You need use a special way to read and write __int128 which you can see in their code.

    In most cases, You can use it like int or long long. But in some STL function, it can't work.

    I found there is a article that may help you.

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

For problem F, can anyone explain why my solution gives a TLE on test 9 when it has the same time complexity as the editorial O(log(n)) and almost the same code.

#include<bits/stdc++.h>
using namespace std;

#define mii             map<int,int>
#define test            int t; cin>>t; while(t--)
#define io             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)


int32_t main(){
  io ; test{

    int n;
    cin >> n;
    int a[n];
    mii cnt;
    for (int i = 0; i < n; i++){
      cin >> a[i];
    }
    sort(a, a + n);
    for (int i = 0; i < n;i++){
      if(a[i]>n)
        break;
      for (int j = a[i]; j <= n; j+=a[i]){
        cnt[j]++;
      }
    }
    int mx = 0;
    for(auto x:cnt){
      if(x.second>mx){
        mx = x.second;
      }
    }
    cout << mx << "\n";
  }
}
  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This issue with this kind of a naive approach was explained here before, in the worst case if all frogs have a hop length of at most $$$1$$$ the time complexity of this code isn't harmonic series $$$O(nlogn)$$$, but rather $$$O(n^2)$$$, because you are going to iterate $$$n$$$ times over all elements of an array of length $$$n$$$.

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

      understood, thanks :)

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

      can you explain why in the second loop we increment the counter by the value of i , I still don't understand how that works

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

        If by the second loop you mean this nested loop:

        for (int j = a[i]; j <= n; j+=a[i])
        

        this basically simulates leaps of a frog, all frogs start at an integer point 0 on a coordinate line, after the first jump frog i will be at a position a[i], then after a second jump at a position 2 * a[i] and so on.

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

          where did j=a[i] and j+=a[i] , in the second loop come from

          • »
            »
            »
            »
            »
            »
            9 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            • In this problem we are asked to place a trap at some integer coordinate that lies inside (ends included) a segment $$$[1;n]$$$ so that we maximize the amount of frogs caught.
            • Finding the answer to this problem is the same as counting for each point in a $$$[1;n]$$$ range the amount of distinct frogs that are going to visit that point and then taking the maximum amount.
            • A straightforward way to do that is to simulate the leaping process of each frog.
            • Knowing that at the beginning each frog sits at a point with a coordinate $$$0$$$ and knowing a hop length of each frog we can simulate a frog hopping from 0 with a for loop
               for (int j = a[i]; j <= n; j+=a[i])
            

            We start at a position of a frog i after its first jump (j = a[i]) and then the frog keeps hopping with its hop length a[i], increasing its position after each jump (j+=a[i]), as mentioned before.

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

Sorry,may I ask a stupid problem? Why is it different between the rank I see in "common standing"and "friend standing". I am sure that its both "only show official". Thx

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

    In common standings, all the participant's world rank will be visible. Whereas, in friends standings, you can see your rank in your friend list, and ranks of your other friends in your friend list, and their world rank in bracket().

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

Problems are cool, thanks a lot for authors!

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

This was my first contest ever. I solved three of them but didn't get any rating. Can someone please explain?

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

    Well, nobody got the rating changes now, but we're waiting for them to be updated. So, you need to wait(i don't know how much)till you get your rating.

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

In this contest can my E be WA, G be TL?

My submission in E in contest: 214829184. I don't know how it's passed pretests. In code wrongly I did: x = s[i] + 2 * md + 1 and printed l but x should be s[i] + 2 * md and printed l — 1. Like this code: 214997775 which I submitted after contest. Please let me know if it's hackable.

My submission in G in contest: 214869824. Can it be TL or ML? It passed pretests with 1668 ms 76900 KB(Time limit is 2s). After contest I optimized it (removed set) and passed pretests with 904 ms 39300 KB(214997753). Please let me know it's hackable.

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

Why this contest showing unrated?

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

    It will show rated, but we have to wait until we get the new ratings.

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

when the contest rating will be out?

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

me waiting for system test and rating changes

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

Why this round is unrated for me :) ?

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

respected authorities, When will the result of the Codeforces round 886 (Div4) rating will add to our profile? 16 hours are gone, but still in our profile graph, round 886 rating is not showing...

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

for problem E, to use quadratic equation, it's not necessary to use int128. It's ok to use long double to store, and convert it back to long long at last. Submission. Note that I defined ll as long double

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

Can somebody please explain why this contest wasn't ranked for me?

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

    you need to wait, usually 2-3 days after contest for the rating changes

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

study time

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

dayum, i got hacked on F and G because i using unordered_map, lesson learned haha

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

what about points? when this will given?

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

Questions were easy, started late and wasted time on E thinking that I won't be able to do F but after contest realized that F was easier than E :')

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

Does anyone have an idea why would my submission get WA2 on C even though it previously got AC in the contest 214793463 ?

I don't have any undefined behavior nor do I see any other error.

Thanks.

UPD: I found the bug, turned out I had an j instead of an i somewhere but it's weird it somehow passed the pretests during the contest.

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

(sighed) i got T again on an easy greedy preblem due to using the Arrays.sort()214808599...Sometimes i really cant tell the difference between using Arrays.sort() or Collections.sort()215048831 ,let alone passing the pretest -_-|

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

why was the contest frozen ?

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

It that the contest is unrated?

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

Sometimes problems are good in their own sense but often we make it more beautiful the way we approach problems. This is for G, I was thinking about the rotation of the axis by 45 degrees and then come to the conclusion that the coordinates after rotation of (x, y) are ((x + y)/sqrt(2), (-x + y)/sqrt(2)). So, I just have to store x+y and -x+y values in a map. We can also think of it as a straight line which is a more direct way but I felt this good (:

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

Still newbie after rating updations...

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

why I use "map<int,int>"could pass G, but use "unordered_map<int, int>" couldn't pass it ?

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

Can anyone explaine how Wrapper function works? This is my hacked submission: https://codeforces.com/contest/1850/submission/214906792. And then i fixed it by Wrapper function which make my submisson accept https://codeforces.com/contest/1850/submission/214984466 *sorry for bad english

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

    Anh cũng chịu em ơi, bị hacked 2 problems TLE không hiểu lun

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

    it allows for you to define a custom hashing function, which makes it less likely to be hacked by anti hashing tests

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

thanks to this contest i got to specialist :D

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

Regarding Maths solution for E problem

Why I get compilation error for this solution: https://codeforces.com/contest/1850/submission/215091151

but this other solution works: https://codeforces.com/contest/1850/submission/214911845

im going crazy, literally same thing

Pleasse help someone

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

Although I participated in my first-ever contest and I did solve 3 questions in quick time, why is there no change in my rating?

Could anyone please let me know about this??

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

    You just upsolved three problems. Upsolved meaning, you have solved those three problems after the contest has ended. if u had solved those three problems during the allocated contest period, then you definitely would have got some positive delta.

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

    You need to register on codeforces.com/contests.

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

For E, "You can also use the quadratic formula, but be careful about implementation of square root and precision issues."" so how can I be careful about the square root and precision??

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

Hello guys can somebody explain to me the the 5th question?

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

Hello can anyone tell me problem F topic (I know it will be number theory but witch concept in number theory should I learn to solve it)

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

    1/1 + 1/2 + ... + 1/n = O(ln n). That's why standart colution is O(n log n) but NOT O(n^2)

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

    Seive of eratosthenes

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

Hey I am a newbie, why this contest as unrated for me? According to this statement "take part in at least five rated rounds (and solve at least one problem in each of them)" they marked as unrated for me

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

    The ratings are rolled back. The system is filtering out the cheaters. It will give the ratings back after checking in a few hours.

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

Hello everyone, there was some misunderstanding here. In short, I wrote this round through this account and after that I inserted the solutions into the main account where the round was held as an unrate and after that my account zhan.anri was banned. Here is submissions: 214769062 214885200

214783118 214885350

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

Why I've got WA on 2 case in F?Can somebody help me,please? https://codeforces.com/contest/1850/submission/216045789

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

Nice contest.

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

In G I get TLE when using unordered_map but Accepted when changing it to map. I thought the access time was faster when using unordered_map, then how come the program is slower with unordered_map?

https://codeforces.com/contest/1850/submission/239099614