Comments

tried with a vpn on wifi. It's working for me then. :p

Me: 2020 cannot get any worse, it's about to end

*rng_58 retires *

PS: Everyone will miss you :)

On Okrut → Good Bye 2020, 6 years ago
0

The way he eliminated Carlen was orzzzzzz so yeaaa... Dubov is <3

My two fav things from Russia 1. Codeforces 2. Daniil Dubov

On Okrut → Good Bye 2020, 6 years ago
0

I was cheering for dubov... The last game was orz

On neal → [not important] Magic moment, 6 years ago
+5

Ngl, at first I thought this was about this magic moment.

ура и счастливого Рождества

How to be a tester? (Asking for educational purposes)

Perform (WA) easily...

https://stackoverflow.com/a/63220955/10015362

This link has explained it very well. Also the gfg practice question and gfg solution is not optimal and hence wrong.

Example testcase:

5 5

7 6 2 1 10

It was 69 when I saw it :(

People just don't listen.

Please don't upvote the above comment. It is aesthetically pleasing as of now.

fails for testcase, I guess 7 2 [[38, 43]]

0

Ok sounds like fun. I wont have to put print statements everywhere now. Just a little noobish question. System.getProperty("Local") is false for my local system. How should I change it for different places. You already mentioned codeforces. So i'm guessing in codeforces the variable Local will be false and dbg won't run.

For my local system what should I do? Thanks.

0

Can you like show an example or something> It would be easier to get used to this then.

Great Contest, good editorial, nice question. Loved it :)

On i.e → Codeforces Round #669 Editorial, 6 years ago
+152

excuse me? Ahahahahahahahaha should be the reply

On i.e → Codeforces Round #669 Editorial, 6 years ago
+315

top 3 reason for depression

  1. breakup

  2. Substance Abuse

  3. WA in div2 A

How so? I am also making pairs of (a2, b0), (a0, b2) and (a1, b0). Just like they did. Please give any testcase where it is failing. Thanks

Can someone tell me a testcase where my code for problem B is failing? https://codeforces.me/contest/1401/submission/90608794 Thankyou

Hi I understood most part of the solution by this line is confusing me.

forn(i, n) res[i % ans].push_back(a[i]);

I understand you are assigning the elements into ans arrays and in a sort of cyclic order. But how do you guarantee that the element in the array will follow the constraint. I tried some test cases and it does!!

Is there some sort of proof or something. Even some intuition might do as well. Thankyou very much

PS: it was nice editorial

ok I understood it. Cannot delete it now. sad.

fails for test case [1 1 2 2] [2 1]

correct ans= [1 2][1 2] my ans= [1 2] [2] [1]

I tried a different approach but it is failing on testcase 11. The checker says that jury has better answer, but I don't think that is possible. Please help

My Approach: I have sorted the m array(size of array of original input) in decreasing order. I have taken frequency of every element entered in m and stored in a hashmap.

Now, I also maintain a variable alpha which keeps track of number of element in the new array. when c[m[left]-1]- alpha<=0 I start a new array. This means that when the allowed limit of the element found at left index - no of element already in the list <=0 I start a new array

for example if the input array is 1 2 2 3
then after sorting it will be m=[3 2 2 1]
So in the first iteration, the ```left=0``` the frequency of ```m[left]=1``` so I put it in the array and decrease its frequency by 1 and increase left by 1

now in the second iteration of inner loop, ```left=1``` and the frequency of ```m[left]=1``` Also, alpha is 1 now. so c[m[left]-1]-alpha is equal to zero and I terminate.

Now in the the second iteration, ```left=2``` and the freq of ```m[left]=2``` Alpha=0 as new iteration started. so now I add it again to the new array 

now in the second iteration of inner loop, ```left=3``` and the frequency of ```m[left]=1``` Also, alpha is 1 now. so c[m[left]-1]-alpha is equal to zero and I terminate.

And for the third iteration, ```left=3``` and the freq is 1. alpha=0 so I add it to the new array and left=4. now since the limit is more than 1... I do not terminate and the new array has [2, 1] inside.


Thus, the final list is [3], [2], [2,1]

Now what I think is that this way leads to the optimal solution. Please explain why does it fail for test 11

The link to the code is as follows: https://codeforces.me/contest/1342/submission/78422553 @pikmike

@vovuh any link for scanline algo? I can only find it for computer graphics. Is that the one?

Lovely explanation. Never thought, I'd be using vectors and vector spaces for finding if product is square. Honestly, it still won't come to me at first sight. LOL

Will read the blog again.