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

Автор SlavicG, история, 3 года назад, По-английски

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, moonpieXXIV, mafailure, MagnusCarlsen321_alt, JuicyGrape, Qualified, haochenkang, ZiadEl-Gafy, MADE_IN_HEAVEN, AdOjis485, qwexd, mkisic, SmartCoder, 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!

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

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

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

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

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

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

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

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

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

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

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

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

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

My first unrated round! :)

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

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

If you want to race

GL & HF

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

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

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

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

By the way, what is the difficulty of this game

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

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

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

As a tester, please stop posting cringe unfunny memes

Also the problems are pretty good

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

official participant with highest rating

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

Looking forward to my first out of competition round!

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

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

Dattebayo

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

First unrated contest

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

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

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

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

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

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

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

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

Hoping to reach specialist after this contest!

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

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

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

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!

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

Excited to become Newbie for the first time !

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

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

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

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

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

why only 120 minutes why note 135 minutes

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

Waiting....

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

Good luck to everyone

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

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

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

Hoping to solve all problems!

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

hopefully i reach spec again after this

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

Hope it be my last rated div 4 contest

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

Alright, iron contest!!!

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

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 $$$ \lt 1400$$$, and the previous one (with Vika) is for rating $$$ \lt 2000$$$ or something, I now think this round is gonna be easier..?

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

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.

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

    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.

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

I hope i become a specilast again

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

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

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

div5

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

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

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

My first *out of competition :)

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

My first rated competition.

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

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

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

the first contest that I aked !!!

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

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

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

Div 4.5

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

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

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

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

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

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;
}

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

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

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

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

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

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

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

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

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

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;

}

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

We want div-4 contest more often as beginer

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

best div 4 contest ever

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

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

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

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

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

Thanx Man i Really enjoy this Round

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

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

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

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.

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

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();
	}
}
»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

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.

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

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

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

Is Carrot working for anyone?

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

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

thanks....

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

editorial?

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

why this is an invalid input for F?: https://mirror.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?

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

My G got hacked (TL). Is it because of Python defaultdict? https://mirror.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
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

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

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

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

Can someone hack my G or H?

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

My first AK contest on Codeforces!

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

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.

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

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

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

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

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

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

    If you have $$$ \lt 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.

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

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

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

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://mirror.codeforces.com/contest/1850/submission/214910960

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

Why my rating didn't change after this contest?

mesanu flamestorm

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

Hope to reach pupil after this contest

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

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!

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

    __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.

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

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";
  }
}
  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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$$$.

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

      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

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

        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.

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

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

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

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

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

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

    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().

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

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

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

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.

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

Why this contest showing unrated?

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

me waiting for system test and rating changes

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

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

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

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

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

study time

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

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

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

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.

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

(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 -_-|

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

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 (:

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

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

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

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

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

thanks to this contest i got to specialist :D

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

Regarding Maths solution for E problem

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

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

im going crazy, literally same thing

Pleasse help someone

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

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??

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

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??

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

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)

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

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

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

Nice contest.