Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

By Endagorion, 23 months ago, translation,

We are aware about the issues with rating in Division 2. MikeMirzayanov is on it and will fix everything soon.

Congrats to the winners!

Technocup edition:

Div. 1 round:

Div. 2 round:

Analysis can be found here (if it doesn't show the analysis, just wait for a little bit).

Scoring distribution:

elimination round: 500-750+750-1500-2000-2750-3250-3750

division 2: 500-750+750-1500-2000-2750-3250

division 1: 500-1000-1750-2250-2750-3250Hi Codeforces!

This weekend, on Oct/26/2019 14:05 (Moscow time) we will hold Codeforces Round 596. It is based on problems of Technocup 2020 Elimination Round 2 that will be held at the same time.

Technocup is a major olympiad for Russian-speaking high-school students, so if you fit into this category, please register at Technocup 2020 website and take part in the Elimination Round 2.

Div. 1 and Div.2 editions are open and rated for everyone. As usual the statements will be provided in English and in Russian. Register and enjoy the contests!

Have fun!

• +187

 » 23 months ago, # |   +85 I hope, that DDOS team will sleep this day.
•  » » 23 months ago, # ^ |   -39 We never sleep.
•  » » 23 months ago, # ^ | ← Rev. 3 →   0 once again a required hope prevailed UPD : And a few unspoken : extended queues, clear stmts, etc.
 » 23 months ago, # |   0 An English article is preferred ;)
•  » » 23 months ago, # ^ |   -30 Now it is in English!
 » 23 months ago, # | ← Rev. 2 →   +10 How can someone with rating >= 1900 register in div.2? :P Or CF doesn’t care about division anymore? I saw some blue competed as rated in last div.3.
•  » » 23 months ago, # ^ |   0 Wasn't it because of the temporary rating change rollback?
•  » » » 23 months ago, # ^ |   +11 I think you mean about div.3? If it’s that case, check this. It was rolled back once, but still not completely fixed.
•  » » 23 months ago, # ^ |   +1 Must be some bug, usually only standalone Div 2 rounds are rated for <= 2100. Endagorion, is this normal that I could register for both Div 1 and Div 2 rounds?
•  » » » 23 months ago, # ^ |   +4 Yeah, seems like someone put the wrong rating range.I clicked register and got a pop-up saying it's only for people up to 2099.
•  » » » 23 months ago, # ^ |   +26 Fixed now.
•  » » » » 23 months ago, # ^ |   +12 Thanks!
 » 23 months ago, # | ← Rev. 3 →   +46 What's going on?
•  » » 23 months ago, # ^ |   +45 Registered before becoming expert
 » 23 months ago, # |   -22 is it rated?
 » 23 months ago, # |   -32 is it rated???????
•  » » 23 months ago, # ^ | ← Rev. 3 →   +15 Div. 1 and Div.2 editions are open and rated for everyone
 » 23 months ago, # |   -39 Prepare yourself for DDOS
•  » » 23 months ago, # ^ |   +4 Is that a threat?
•  » » » 23 months ago, # ^ |   +79 Absolutely no. I just meant that I would be really sad if that happens again, but given the history of technocups on cf I think it is likely and I hope some steps were taken to prevent such disasters in future.
•  » » » 23 months ago, # ^ |   +4 Everyone knows online threats are very dangerous. /s
•  » » 23 months ago, # ^ |   +143 Hope not, I kinda like the problems
•  » » » 23 months ago, # ^ |   +9 Me too!!By the number of upvotes, this round is so underrated.
•  » » 23 months ago, # ^ | ← Rev. 2 →   +4 Don't abandon your posts though
 » 23 months ago, # |   +16 technocup = unrated...
 » 23 months ago, # |   0 Will need there a 12-hour hacking phase after the cont est or not?
•  » » 23 months ago, # ^ |   +165 2 hour hacking phase for DDosers only
 » 23 months ago, # | ← Rev. 5 →   -13 Why does it start so early?
•  » » 23 months ago, # ^ |   -14 I believe one possible reason could be codechef lunchtime today?
 » 23 months ago, # |   -7 Today,I wanna ,but NanJing Region .
 » 23 months ago, # |   -19 Will there be English statements?
•  » » 23 months ago, # ^ |   0 Of course
•  » » 23 months ago, # ^ | ← Rev. 2 →   0 Why do you ask such question,DST？It was mentioned in blog.
•  » » » 23 months ago, # ^ |   -8 It wasn't then.
 » 23 months ago, # |   +20 The experience of Technocup Elimination Round 1 was not good. Due to DDOS attack it was declared unrated. Hope the authority will try their best to avoid these circumstances today.
•  » » 23 months ago, # ^ |   0 Now, it has become one of the cliche comments. Every one of us wants the round to be safe from DDoS attacks.
 » 23 months ago, # |   +10 When will the number of problems and score distribution be revealed?
 » 23 months ago, # |   +4 Score distribution?
 » 23 months ago, # | ← Rev. 2 →   +6 How many problems are there in div 2? Edit: announecd now!
 » 23 months ago, # |   +5 >TechnocupINB4 404
 » 23 months ago, # |   +8 Unable to hack?.It's saying can't process your hack. Can anyone help me with it?
•  » » 23 months ago, # ^ |   0 Same here. I know a good input to hack, but unable to submit it :(
 » 23 months ago, # |   +3 Very nice questions but website went down..
•  » » 23 months ago, # ^ |   0 I agree. I wanted to submit a solution in the very last minute but couldn't because site went down :(
 » 23 months ago, # | ← Rev. 2 →   +4 I'm so sad I wasted so much time thinking in some dp solution for C while it's way easier than what I thought edit:next time I'll talk about how easy the problem is after it's judged lol it's wrong
•  » » 23 months ago, # ^ |   +1 What's the solution for C?
•  » » » 23 months ago, # ^ |   +9 Here is correct solution, but it needs all google servers or at least a quantum computer Spoilerint main() { long long pows[32]; long long basis[32]; int n, p; cin >> n >> p; pows[0] = 1; basis[0] = 1 + p; for (int pw = 1; pw <= 31; pw++) { pows[pw] = 2 * pows[pw - 1]; basis[pw] = pows[pw] + p; } map all_nums; for (int pw = 0; pw <= 32; pw++) if (basis[pw]) all_nums[basis[pw]] = 1; for (int cnt = 2; cnt <= 30; cnt++) { map tmp = all_nums; for (int pw = 0; pw <= 31; pw++) if (basis[pw]) { for (auto t : tmp) if (all_nums.count(t.first + basis[pw]) == 0) all_nums[t.first + basis[pw]] = cnt; } } if (all_nums.count(n) == 0) cout << -1; else cout << all_nums[n]; } 
•  » » » 23 months ago, # ^ | ← Rev. 2 →   +1 Your text to link here...just vary k here
•  » » » » 23 months ago, # ^ | ← Rev. 2 →   0 Since p can be negative we cannot simply add up the summands. There could be solutions with (possibly huge number of) negative summands.How to consider that?
•  » » » 23 months ago, # ^ |   +1 I think there is a short solution to it, mine got accepted, basically I used this, Spoiler//its not possible for more than log(n) terms to exist. ll nbits(ll n){ ll ret=0; while(n>0){ ret+=n%2; n/=2; } return ret; } void solve(){ ll n,p; cin>>n>>p; for(ll i=1;i<40;i++){ if(nbits(n-i*p)<=i&&i<=(n-i*p)){ cout<
•  » » 23 months ago, # ^ |   0 Same bruh! It's so tough to realise your approach is wrong and you should switch methods.
 » 23 months ago, # |   +5 Couldn't load question 'c' at last 10 mins during the contest although I could load other problems. Did you have the same problem ??
•  » » 23 months ago, # ^ |   +3 same, here
 » 23 months ago, # |   0 How to solve Div.2 E ?
•  » » 23 months ago, # ^ | ← Rev. 2 →   +7 SpoilerI am not sure if my idea is correct. But I think DP + BIT. dp states are current row, current column, next direction (right or down). From a state we can find till how much we can move in next direction. then dp can be expressed as a range summation, which can be optimized using BIT / segment tree.
•  » » » 23 months ago, # ^ |   0 You need to consider the pushed rocks, too. So dp[][][] is about position and somehow pushed rocks.
•  » » » » 23 months ago, # ^ | ← Rev. 2 →   0 I don't think your idea will pass, as n*m*n is really large. SpoilerIn my dp, I am making all moves in the same direction at once, so no need to keep pushed rocks in state. (P.S. I have not been able to submit yet, so not sure about my idea either).
•  » » » » » 23 months ago, # ^ | ← Rev. 2 →   +8 Yes, that is the "somehow" part... ;)But for sure, one cannot ignore the rocks.For a position x,y the number of remaining possibilities is dependend on the number of rocks which where pushed on the last move into that position.
•  » » » 23 months ago, # ^ |   +23 You don't need BIT if you do prefix sums.
•  » » » 23 months ago, # ^ |   0 can you please elaborate on your solution?
•  » » » » 23 months ago, # ^ |   0 My solution was same as the one explained in tutorial. I don't think I can elaborate more than the tutorial. If you fail to understand something from the tutorial, you can ask that specifically.
 » 23 months ago, # |   +32 Thanks for the GIFs in E!
 » 23 months ago, # |   0 test case 2 in div2 D?
•  » » 23 months ago, # ^ |   0 6 2 1 2 4 8 2 4
 » 23 months ago, # |   +25 Yet another hackforces?
•  » » 23 months ago, # ^ |   0 I would be very sad if that happens :(
 » 23 months ago, # |   +3 got a message that gave me a heart attack "my solution has been hacked or resubmitted" but nothing changed in my submissions
 » 23 months ago, # |   0 Hack for d2 C?
•  » » 23 months ago, # ^ |   0 Try for smaller P?
•  » » 23 months ago, # ^ |   0 5 2
•  » » » 23 months ago, # ^ |   0 output should be -1?
•  » » » » 23 months ago, # ^ |   0 Yes
 » 23 months ago, # |   +1 Nice problems.I was having such a good contest till my locked submission for C was hacked..
 » 23 months ago, # | ← Rev. 2 →   +14 Respect for E — reference to game Baba is you
 » 23 months ago, # | ← Rev. 2 →   0 So, what is the "trick" in C, how to solve it?Case p is positive, I found trivial solutions. But for negative p?What if there are only such solutions that 2^x is huge?
•  » » 23 months ago, # ^ |   +6 I thought that answer is always in a small range, I could be wrong though...
•  » » » 23 months ago, # ^ |   0 Since we can add up infinie number of reps we can add up infinite huge negative and positive numbers. So for negative p there should allways exist a solution.How to find that one?
•  » » » » 23 months ago, # ^ |   0 What I did was search for answer values only in range from 1 to 50, to get the answer..
•  » » 23 months ago, # ^ |   +12 I SOLVED IT OMG I AM SO PROUDok anyways so basically if you write n as sum of k (2^i+p), then n = (2^a + p) + (2^b + p) + ... + (2^x + p) rightn = (sum of k "power of 2s") + kpsum of k "power of 2s" = n — k * pSo what remains is to check whether n — k * p can be written as k "power of 2s" (with duplicates). This is kinda well known lmao. But basically def check(x, k): if k < x: return False if bin(x).count('1'): # counting the number of set bits in binary of x # This is because the binary expression is the unique way of representing x as sum of power of 2s with minimal number return False return True Sorry if you don't code in python but I'm sure you can code the "count set bit"Now loop through all k (while n — k * p >= 0) and check that(still proud plz upvote minecraft is the best)
•  » » » 23 months ago, # ^ |   0 I know for positive p, n-k*p > 0 was the breaking condition for loop. But i wasn't able to get breaking condition for -ve p. Can you tell how you came to know that answer will always be possible for -ve p? And also it was my intuition that incrementing and checking for every k will work.
 » 23 months ago, # |   +2 I just couldn't understand how this solution gives a TLE for B2. Anyone can help?
•  » » 23 months ago, # ^ |   0 have u declared an array for counting in every test case??
•  » » » 23 months ago, # ^ |   +1 That was exactly the mistake. Thanks!
•  » » » » 23 months ago, # ^ |   0 same was the case with me
•  » » » » » 23 months ago, # ^ |   0 Same , very sad , a map could do the work
 » 23 months ago, # |   0 So how to solve the problem D.
•  » » 23 months ago, # ^ | ← Rev. 2 →   0 Firstly,we use backet sort and convert the input to backet[number]={count}.And do next for all $i(1 \le i \le 10^5):$ find the minimum $p$ that satisfies $i*p = x^k$(we can use prime factorization for this.) count pair $(i,p * v^k)(1 \le v \le 500$ thanks to $k \ge 2$ and $N \le 10^5)$ We have to use valid pre-calculation for doing this.
 » 23 months ago, # |   +3 What's the hack in div1A?
•  » » 23 months ago, # ^ |   +27 9 4. ans will be -1 and not 2
•  » » » 23 months ago, # ^ |   0 daaaamn my solution is wrong but why it's wrong
•  » » » » 23 months ago, # ^ |   +5 9-2*4 = 1 cannot be represented as sum of two powers of 2.
•  » » » 23 months ago, # ^ |   0 :(
•  » » » » 23 months ago, # ^ |   0 I feel you bro :'(
•  » » 23 months ago, # ^ |   0 Something like 11 5.Basically, checking if N — i * p <= i.
•  » » 23 months ago, # ^ |   0 How to solve DIV1 — C?
 » 23 months ago, # |   +3 how to solve DIV2-D
•  » » 23 months ago, # ^ |   +6 Let the prime factorization of y be p1^k1 + p2^k2 + ... + pm^km. Then y = x^k if kj % k == 0 for every j<=m. So we only need to take care of modulo of kj with k.For each ai, find it's modulo prime factorization (i.e p1^(k1%k) + p2^(k2%k) + ...). Note that we need to remove pj^kj if kj = 0. Then aj * ai = x^k if modulo prime factorization of aj equal p1^(k-k1%k) + p2^(k-k2%k) + ... Let it be ai's reverse modulo prime factorization.Store number of each modulo prime factorization by map, iterate from 1 to n, for each ai add number of it's reverse modulo prime factorizations to result, then update it's module prime factorization.
•  » » » 23 months ago, # ^ |   0 thanks man, I understood and submitted accepted code
•  » » 23 months ago, # ^ |   0 refer my comment, let me know if its correct. https://codeforces.com/blog/entry/70852?#comment-553827
•  » » 23 months ago, # ^ | ← Rev. 20 →   0 Similar to livw, I also use prime factorization.Noted that if $a_i \times a_j = \sum p_i^{u_i}$, then $k|u_i$. So for each $a_i=\sum p_i^{x_i}$, We store every $(p_i, x_i \ \mathrm{mod}\ k )$ in an array . To satisfy the equation, $a_j$'s factorization must be $\sum p_i^{k-x_i \ \mathrm{mod} k }$. Therefore we only need to count how many arrays in which every element equals to $(p_i,k-x_i \mathrm{mod}\ k)$. map< vector< pair >, int> cnt; can do that.Complexity: As the size of each array is at most $O(\log n)$ , the final complexity is $O(n \log ^2 n)$
 » 23 months ago, # |   +24 Everyone knows how to solve div_1 B, except me :(
 » 23 months ago, # |   +3 That last half an hour period of unresponsive site was a nightmare .....My heart stopped for a second (Not literally... XD).
 » 23 months ago, # |   0 the time limit in problem E was very strict so that recursive do doesn't work sadly there were no time to change the recursive version to the iterative version
 » 23 months ago, # | ← Rev. 2 →   +79 Hello, HackForces !Although my solution on problem A was hacked, I gained 650 points just by hacking others!(Why there are only 40 participant in each room?)
•  » » 23 months ago, # ^ |   +5 Me too! 650
 » 23 months ago, # |   +19 Well-balanced contest
 » 23 months ago, # |   +41 Actually before the contest I was expecting some Hacking on Codeforces (DDOS)It turned out that there is indeed some hacking, and though I was hacked, I also hacked 7 solutions!
•  » » 23 months ago, # ^ |   +15 Wise decision! While it was too late when I realized it :)
•  » » » 23 months ago, # ^ |   0 same here xD
 » 23 months ago, # |   +54 Did anyone else faced this 504 GATEWAY TIMEOUT issue? Was hoping for extended round :(
•  » » 23 months ago, # ^ |   +3 Yep , Same here
•  » » 23 months ago, # ^ |   +9 Yes, lots of times. I tried to hack some solutions, and when I loaded the room, it gave me that error too.
•  » » 23 months ago, # ^ |   0 !!!
•  » » » 23 months ago, # ^ |   0 What is the hack for div 2 C and div2 A __
 » 23 months ago, # |   0 Flag is Win
 » 23 months ago, # | ← Rev. 2 →   +3 What is the hack for C div2 or A div1 and A div2?
•  » » 23 months ago, # ^ | ← Rev. 2 →   0 9 4. should give -1 and not 2.. for div2C
•  » » » 23 months ago, # ^ |   0 It should give 2...16-4+1-4
•  » » » » 23 months ago, # ^ |   +2 It's +4 in the testcase
 » 23 months ago, # |   +12 I think few people will pass problem C bacause there are a great deal of hacks and FSTs!
•  » » 23 months ago, # ^ |   0 My code passed :O omghttps://codeforces.com/contest/1247/submission/63459624
 » 23 months ago, # |   0 Can someone explain me how to solve Div2 D please?
•  » » 23 months ago, # ^ | ← Rev. 2 →   +10 For each number, do the prime factorization, and do a modulus of the powers with K. So for the given sample case in the problem, your array becomes 1 3 9 1 3 1. Lets iterate from left to right in this array. At say i = 2, (number is 9), what you want is 3 to make it "good". What you have is 9. See from some frequency table if you have what you need, and update answer. Also then, add what you have in this frequnecy table. See submission #63466377 of me, to get the above idea.EDIT: also take care of overflows [ https://codeforces.com/contest/1247/submission/63489009]
•  » » » 23 months ago, # ^ |   0 Thank you!
 » 23 months ago, # |   0 How to solve Div2-D? I think that separating case $k=2$ will be enough but I can't submit it as the site is not working in the last minute. Is this the solution because for case $k = 3$ I think that it might TLE?
•  » » 23 months ago, # ^ |   0 How do you solve that cases with small k, ie k==2?
•  » » 23 months ago, # ^ |   0 I think it will not TLE because, if $k = 3$, No. of Instruction will be around $217000000$ (Approx.) that is $(2.17 * 10 ^ 8)$. That should runs in less than a $1$ second.
•  » » » 23 months ago, # ^ |   0 How many instructions can run in one second? I every time think about time complexity in terms of Big-O notation.
•  » » » » 23 months ago, # ^ |   +3 Case by case. From my experience, If the instructions are complicate (like multiplication,division...), it will be $10^8$. If the instructions are quite simple (like addition,subtraction,easy conditional branch...), it can reach $10^9$.
•  » » » » » 23 months ago, # ^ |   0 Thanks!
•  » » » » » 23 months ago, # ^ |   0 I ran a loop once on codechef IDE, till 1e18, with just 1 operation, incrementing a variable, and it ran in 0 seconds....
•  » » » » » » 23 months ago, # ^ |   +3 It is very good optimization by the compiler.(maybe) Sometimes it will occur.
•  » » » 23 months ago, # ^ | ← Rev. 2 →   0 I solved it like this and it worked
•  » » 23 months ago, # ^ |   0 i did the same thing . Pretest Passed
 » 23 months ago, # |   +27 Systest when?
 » 23 months ago, # | ← Rev. 2 →   +2 Can div2-B be solved with window slidding technique? Counting the number of different elements in each subarray of length d?
•  » » 23 months ago, # ^ |   +2 Yes.
•  » » 23 months ago, # ^ |   0 Yes, I used an ordered map for it... :D
•  » » 23 months ago, # ^ |   +3 Facing TLE on test case 18 with window sliding technique. Does anyone know why?
•  » » » 23 months ago, # ^ | ← Rev. 2 →   0 You may have declared the count array for every testcase individually which leads to a complexity of O(tk) (As you need to initialize it with zeros). I did the same mistake and got TLE on testcase 18 as well :( .
 » 23 months ago, # |   +4 where do I find the Editorials of the problems?
•  » » 23 months ago, # ^ |   +9 Just wait! There will be a link given later.
 » 23 months ago, # |   0 I submitted div1 C but it's not showing up...
 » 23 months ago, # |   +1 Any one know how to solve Div2 D using single approach for all possible value of k
•  » » 23 months ago, # ^ |   +4 Couldn't submit, but this is how I approached the problem, for each element, find its prime factorization, say p1^m1*p2^m2...pn^mn be prime factorization of some element arr[i] in the array. Now take modulus of each m's by given 'k', and replace arr[i] by p1^(m1%k)*p2^(m2%k)...pn^(mn%k). Now store the count of these elements in a map.Now traveling the array, picking each element, find its counterpart (p1^(k — m1%k)*p2^(k — m2%k)...pn^(k — mn%k)) count in the map, increase the number. Note if counterpart is same as a[i], then decrease the count by 1 (not counting the array element with itself). Then return total count /2.
•  » » 23 months ago, # ^ | ← Rev. 2 →   +3 Let $a_i=\prod p_{i,1}^{c_{i,1}}\times p_{i,2}^{c_{i,2}}\times \dots \times p_{i,l_i}^{c_{i,l_i}}$.($p$ are increasing, $c$ are positive numbers)$i$ and $j$ satisfy the condition if and only if $l_i=l_j$ and $p_{i,x}=p_{j,x}$ and $k|(c_{i,x}+c_{j,x})$.So push all $(p_{i,x},c_{i,x}\bmod k)$'s into a vector, and use a map to calculate the times it occurs before.
•  » » 23 months ago, # ^ |   0 see mine its single approach i am working under modulo k
 » 23 months ago, # |   +1 can anyone explain how to solve div2 D??
•  » » 23 months ago, # ^ | ← Rev. 2 →   +1 With each $a_i$, add result with number of $a_j$ that $j  » 23 months ago, # | +95  » 23 months ago, # | +3 TLE on B2 for not using erase :( •  » » 23 months ago, # ^ | +1 why ? •  » » » 23 months ago, # ^ | 0 I didn't pay attention that the test cases number can be large and I kept initializing a 10^6 array each time instead of using map then clearing it. •  » » » » 23 months ago, # ^ | 0 Why does this result in TLE? •  » » » » » 23 months ago, # ^ | +1 Because sum of k is not guaranteed to be <= 1e6, so it's$O(t * k)$•  » » » » 23 months ago, # ^ | 0 Thanks!! Never try to extract elements thinking you will get in O(1) time using vector or unordered map in such cases ,its safer to use map cause its O(logn) always. I wish i could have joined codeforces before ,such an amazing platform!!  » 23 months ago, # | ← Rev. 2 → -7 This multiple test case thing is so irritating. Fucks me always. My B2 got TLE because I didn't declare one of the array's globally. Why cant you just put all the test cases separately? •  » » 23 months ago, # ^ | +11 Would you like a problem with 1e5+ test datas? •  » » » 23 months ago, # ^ | 0 But it's good to have it in the pretests •  » » 23 months ago, # ^ | 0 Same here, it is annoying that it does not pass because of a small technicality instead of the correctness of the solution. I started doubting the whole solution and did not suspect the initialization of the container :/  » 23 months ago, # | ← Rev. 2 → +6 What is the logic behind saying that it is guaranteed that sum of n <= 2e5 but sum of k IS NOT. WTF? I thought multitests' goal is to make pretests better and testing faster BUT not to make your fully correct solution fall on such stupid testcases •  » » 23 months ago, # ^ | 0 your code should be O(n) not O(k) unfortunately :( (I think) •  » » » 23 months ago, # ^ | 0 My main idea is O(n). The reason it falls is just how you clean your array between multitests. I... I..., I have no words... •  » » » » 23 months ago, # ^ | 0 Don't you just create a new array each test case? I use python so I just do for _ in range(int(input())): a,b,c=map(int,input().split()) arr=list(map(int,input().split())) # BLA is it different in cpp? •  » » » » » 23 months ago, # ^ | 0 You have used map. I used a vector. It costs O(k) time to initialize it. •  » » » » » » 23 months ago, # ^ | 0 Wait what? What was your algorithm? Can I take a look at code? I’m interested lol •  » » » » » » » 23 months ago, # ^ | 0 •  » » » » » » » » 23 months ago, # ^ | ← Rev. 2 → 0 That’s unfortunate. Why didn’t you use a map though, I thought it’s natural to use when you’re counting with a key? •  » » » » » » » » » 23 months ago, # ^ | 0 I could not imagine that sum of k would be greater than 1e6. I still don't see a logic of doing it.  » 23 months ago, # | 0 do wrong answer of pretest 1 gets penalty, i never noticed it, i submitted solution of one question to another. •  » » 23 months ago, # ^ | 0 I don't think so. •  » » 23 months ago, # ^ | 0 No, it doesn't.  » 23 months ago, # | +10 Poor Testcases :{ •  » » 23 months ago, # ^ | 0 Yes,I got FST on problem C,and my rating will drop below 1700... •  » » » 23 months ago, # ^ | +1 What is FST? •  » » » » 23 months ago, # ^ | 0 Failed system tests •  » » 23 months ago, # ^ | 0 I think it was better to not include the test cases > 60 in pretest and let many fail. People nowadays just guessing the answer without doing any work on what limits should one use.  » 23 months ago, # | ← Rev. 2 → +54 You have stolen my dreams and my rating with your empty pretests...  » 23 months ago, # | +16 22th testcase of d2 C...  » 23 months ago, # | +5 Mathforce and fstforce :)  » 23 months ago, # | 0 RIP half of all Div2C submissions. Good job Thanos. •  » » 23 months ago, # ^ | +5 RIP half of all Div2B2  » 23 months ago, # | 0 Uh, so does the DDOS attack affect whether this round rated? •  » » 23 months ago, # ^ | +1 It sometimes does, sometimes doesn't, depends on the duration and extent of DDOS attack i believe. •  » » » 23 months ago, # ^ | +4 Why part of people's rating changed but others not(like me)? •  » » » » 23 months ago, # ^ | +3 I have same doubt  » 23 months ago, # | 0 What is the expected time complexity of div2 B(hard version) ? •  » » 23 months ago, # ^ | ← Rev. 2 → 0 I did it in O(n*logn) during contest but it can be done in O(n) as well •  » » » 23 months ago, # ^ | 0 63468353 Why is this giving TLE then ? •  » » » » 23 months ago, # ^ | -7 Looks like cout issue. •  » » » » » 23 months ago, # ^ | 0 I have already synced out stdio. Or am I missing anything else ? •  » » » » » » 23 months ago, # ^ | ← Rev. 2 → +3 Oh, sorry, this code: for(i=0;i<=k;i++) { hash[i]=0; } runs 10000 times for k = 10^6 •  » » » » » » » 23 months ago, # ^ | 0 oh, I get it. What should have been the approach there ? •  » » » » » » » » 23 months ago, # ^ | +1 for (int i = 0; i <= n; i++) hash[a[i]] = 0; •  » » » » » » » » » 23 months ago, # ^ | 0 Ohk, thanks :) •  » » » » 23 months ago, # ^ | ← Rev. 2 → +2 For each test case you are declaring a hash array of size k, you need to use hash array globally •  » » » » » 23 months ago, # ^ | 0 63491783 Why now ? •  » » » » » » 23 months ago, # ^ | ← Rev. 2 → 0 for(i=0;i<=k;i++) { hsh[i]=0; } Still$O(tk)$. There is need$O(sum(n))$. •  » » » » » » » 23 months ago, # ^ | 0 yeah, got it. Thanks •  » » » 23 months ago, # ^ | 0 Why TLE ? : https://codeforces.com/contest/1247/submission/63464491 I did binary search. •  » » 23 months ago, # ^ | 0 Can be done in O(n).  » 23 months ago, # | +2 why? The same code got a TLE in System test, and got AC after System test.63463673 TLE63489980 AC •  » » 23 months ago, # ^ | +4 memset(vis,0,sizeof(int)*(k+5)); Sum of K is not guarranted to be <= 1e6 •  » » » 23 months ago, # ^ | 0 Year,I know. But,why i got ac after System test with the same code. •  » » » 23 months ago, # ^ | ← Rev. 2 → 0 And, i am shocked at my friend got ac who used memset(vis,0,sizeof(vis)) .(sorry for my poor english. •  » » » » 23 months ago, # ^ | 0 That's all random, my friend. Anyway I don't see logic of saying that sum of N is <= 2e5, but sum of K is not... •  » » » » » 23 months ago, # ^ | 0 It's very logic. You have to read input sum of N times, so sum of N need to small, for example ~ 2e5 so that people can read input in time. Other than that, there is nothing to do with sum of K. K can be 1e9, or even 1e18. You declared an array of size K for each T testcases without thinking about limit of K * T, that is your fault.  » 23 months ago, # | 0 can anyone explain the testcase 22 of problem c? •  » » 23 months ago, # ^ | +2 101 50If you outputted 2 it's not correct.$2^{a_1} + 2^{a_2} = n - 2*p$$2^{a_1} + 2^{a_2} = 1$$2^0 + 2^0 > 1$ » 23 months ago, # | ← Rev. 2 → +10 Lesson learnt from Div 2B (Hard Version): Pay attention to the sum of variables like$n$and$k$over all$t$testcases.  » 23 months ago, # | +9 For div2C: Reality is often disappointing  » 23 months ago, # | 0 How to solve d2c . I saw some submissions they used builtin function . Wondering what the function represent? •  » » 23 months ago, # ^ | 0 It tells you the count of set bits in a number •  » » » 23 months ago, # ^ | 0 ooo...got it ......of binary number.....thanks  » 23 months ago, # | +7 300iq, top 10 codeforces !!!  » 23 months ago, # | +17 Pretests way too weak :'( Lost a lot of rating points.  » 23 months ago, # | 0 Bye, Master.. (￣ヘ￣)  » 23 months ago, # | -15 Time constraints too strict in B2.  » 23 months ago, # | -74 Well done guys •  » » 23 months ago, # ^ | +21 that refers to indices, not values •  » » » 23 months ago, # ^ | -8 if we take two elements, the position of one will be guaranteed to be greater than the position of the second. Two elements do not stand in one position. This line just makes no sense. As well as the case when we can take the same numbers. They are either the same or one is larger than the second. In short, this absurdity cost me one task •  » » » » 23 months ago, # ^ | 0 I think the statement makes sense. It is specifically clarifying the point to not count cases like$a_1 \cdot a_1 = 1 = 1^3$. •  » » » » » 23 months ago, # ^ | -6 idk how it sounds in English (i use Rus language as u can see), but in the condition it is said to find PAIRS OF NUMBERS. Pair of one and one? May be my bad but i really confused •  » » » » » » 23 months ago, # ^ | 0 Not pair of numbers but pair of indexes. i and j are indexes •  » » 23 months ago, # ^ | +3$i = 1, j = 6, 1 < 6a_i * a_j = 1^3$•  » » » 23 months ago, # ^ | -8 A moment of entertaining terminology: commutativity. We can get i = 6 and j = 1; a[i] * a[j] == a[j] * a[i] == 1; F A N T A S T I C •  » » » » 23 months ago, # ^ | 0 What's the problem, dude. If you take i = 6 and j = 1, than i is greater than j •  » » » » » 23 months ago, # ^ | 0 But it still doesnt matter :D •  » » 23 months ago, # ^ | +2 i and j are the indices, not the values of elements. •  » » 23 months ago, # ^ | 0 but$1<6\$ is true man you misunderstood it sadly :eyes:
 » 23 months ago, # |   +5 my rating wasn't updated, why?
•  » » 23 months ago, # ^ |   0 Ratings are being updated I guess.
•  » » 23 months ago, # ^ |   0 Same here.
•  » » 23 months ago, # ^ |   0 Same here
 » 23 months ago, # |   +1 got hacked on C due to my carelessness. so sad:(
•  » » 23 months ago, # ^ |   0 I would have said "due to weak pretests" if I were you.
 » 23 months ago, # | ← Rev. 14 →   +1 Unable to go to the contest page. :(Oops! Probably Codeforces can't be reached right now or your Internet connection is broken
 » 23 months ago, # |   +1 Why is my account unrated?
 » 23 months ago, # |   0 When can I start to upsolve? What is going with the contest right now, there is an error... Does anybody know?
 » 23 months ago, # |   +1 Problem B2 : O(n) solution shows TLE. I used an array, whereas my friend used a map. He got AC. Why?
•  » » 23 months ago, # ^ |   +3 Maybe you clear the array so many times and the solution is O(n*d) (I dont remember the letter, seems to be d)
•  » » 23 months ago, # ^ | ← Rev. 7 →   +1 You are clearing the whole array in every testcase .. But you can make array cnt global and clear only used a[i] for every testcase
 » 23 months ago, # |   +20 Why has rating not been updated on my account ?
 » 23 months ago, # |   +19 Why is this round rated for someone while not for others? @Endagorion
•  » » 23 months ago, # ^ |   0 May be it is still updating
•  » » 23 months ago, # ^ |   0 Even mine too.
 » 23 months ago, # |   +11 ![ ]() Whats happening ?
 » 23 months ago, # |   +2 Is rating updating or what?
 » 23 months ago, # |   +4 rating is very funny !! unrated solved 4 problems .. and become unrated !!
 » 23 months ago, # |   +4 Why my rating is not evaluated after end of the Codeforce round 596-div2?
 » 23 months ago, # | ← Rev. 2 →   0 Why I got the time limit exceeded in question B2 in 18th test case. Instead of using vector when I used map then I don't got the error.
•  » » 23 months ago, # ^ |   0 Answer is here And hide your code in a spoiler or smth
•  » » 23 months ago, # ^ |   0 I made the same mistake. You are declaring a new vector of size k for each test case. Now in the problem k <= 1e6 and no. of test cases t <= 1e4 which makes your solution a O(t*k) time complexity which is 1e10 operations in worst case leading to TLE.
•  » » 23 months ago, # ^ |   0 You initialize v2 array for every test case.and it takes too time for every test case in 18th case.
•  » » 23 months ago, # ^ |   0 limit of t... 1≤t≤10000 .limit of k.... 1≤k≤10^6 so your code run for 10^4*10^6 = 10^10 times .because of vector v2(k+1,0); this .
 » 23 months ago, # |   0 Can someone help me. I have little trouble with div2/B2. My solution got TL at the main tests, but same solution(absolutely same) got AC. Here is my solutions: https://codeforces.com/contest/1225/submission/63468733 https://codeforces.com/contest/1225/submission/63494209
•  » » 23 months ago, # ^ |   0
 » 23 months ago, # |   +1 Too much mess with this round, lol
•  » » 23 months ago, # ^ |   +15 Looks like Thanos snapped half the ratings too along with the submissions.
•  » » 23 months ago, # ^ |   +2 Just give me my +85 :(
•  » » » 23 months ago, # ^ |   0 Ittne me itna hi milta hai re baba
 » 23 months ago, # |   +3 Rating system got dddrunk!!!
•  » » 23 months ago, # ^ |   0 :3
 » 23 months ago, # |   0 I want to upsolve but I only can see the "bugs"
 » 23 months ago, # |   +1 Even there contest rating failed after user rank #368 Karma
 » 23 months ago, # |   0 Baba is you!
 » 23 months ago, # |   +5 Come on, any update on rating changes?
 » 23 months ago, # |   +1 Sir, please clarify that whether the Div. 2 version of this round is rated only for the Top 370 contestants or the round is unrated or something others?
 » 23 months ago, # |   +3 where is rating change?my contest performance is very low :p.unrated is not expected as so.. please... give rating change as soon as possible. :D
 » 23 months ago, # |   +4 Endagorion is this round even rated for everyone
•  » » 23 months ago, # ^ |   +8 I'm sure it'll be resolved soon. Anyway, I can't help with this
•  » » » 23 months ago, # ^ |   0 Thank you
 » 23 months ago, # |   +3 why hasn’t my rating changed?
 » 23 months ago, # |   +3 Div. 1 rating has been changed 2 hours or more ago,still why Div. 2 rating has been paused?
 » 23 months ago, # |   0 Why im not rated in this contest
 » 23 months ago, # |   0 Even rating updater is ratist :sadness:
 » 23 months ago, # | ← Rev. 10 →   +7 I'm wondering whether codeforces authority even noticed that div2 rating update has been stopped at rank 368 where div1 rating changes has been finished 1 or 2 hours ago. At least we deserve to know what's going on. Endagorion MikeMirzayanov
•  » » 23 months ago, # ^ |   +8 You're right. Now we are trying to figure out what’s the matter and soon it'll be fixed.
•  » » » 23 months ago, # ^ |   +1 Atlast, someone from headquarters,
•  » » » 23 months ago, # ^ |   0 Thank you for the official reply and reassurance. Now we can rest easy knowing that Headquarters is on the case.
 » 23 months ago, # |   -6 Any idea why my contest rating has not been updated yet? The contest is not appearing in my profile
•  » » 23 months ago, # ^ |   +13 Rating changes for the last round are temporarily rolled back. They will be returned soon.****watch at the top at codeforce !!!
 » 23 months ago, # |   0 Missed D by a bit and did silly mistake in A ;PHoping the problem related to rating will be fixed soon!
 » 23 months ago, # |   0 Finally rating updated !!!
 » 23 months ago, # | ← Rev. 3 →   0 my rating shows 1475.why still pupil??
 » 23 months ago, # |   0 It would be great if someone can explain me easier way solution of div2-C. I cant understand the solution and I,m not so fimiliar with binary numbers, bit cnt etc.Thanks a lot. :)
 » 23 months ago, # | ← Rev. 2 →   0 In div2-B2, why I tle on test 22 in the contest and I just submitted the same code, it was accepted!
•  » » 23 months ago, # ^ |   0 Answer is O(tk) because you are resetting b` every time.
•  » » » 23 months ago, # ^ |   0 thx
 » 23 months ago, # |   0 Jury's answer to 10 7 is -1. But can't 10 7 be made by 10 numbers of the form (2^3 — 7)?
•  » » 23 months ago, # ^ |   0 its 2^x + p so your input should be 10 -7.and 10 = (2^4-7) + (2^3-7)
•  » » » 23 months ago, # ^ |   0 Thanks
 » 23 months ago, # |   0 Can someone help me to figure out why my submission for problem D is giving WA for test case 12? Submission ID: 63491511Any kind of help would be greatly appreciated. Thanks!