Comments
On kostka → IOI 2025, 4 years ago
+3

why not botswana?

boku no pico

masturbate

"the number of items in a set that are strictly smaller than our item". you can see here https://codeforces.me/blog/entry/11080

My solution for C, and i think it's easy to understand and code. First, calculate minimum steps to make array equal. Easy to see, it's sum of all different of pair i and i-1, call it K. Now after K steps we have an array with all elements equal to x, we need to find x, if we can find it, just plus abs(x) to K, it's the answer. We know number of steps to make first element (a[0]) and last element (a[n-1]) equal to x is K (because of suffix and prefix). Call L is number of steps to make first element equal to x, and R is number of steps to make last element equal to x. We have two conditions L+R=K and a[0]-L=a[n-1]-R. Basic math, after calculate L or R, calculate x and print the answer.

On Mangooste → Global Round 19 Editorial, 5 years ago
0

can you tell me why timecomplexity of prblem E not O(n^2.logm)? For example, testcase like this: 1 5 9 1 2 3 4 5 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 every pairs is bad, expect {1,2} or {2,1}. I ran the code of tutorial and count number of steps, it returns 23 (5^2-2). I think it run like that: for i from 5->3, it don't have break, because all of pair with 5->3 in it is bad. for i from 2->1, just 2 pair is not bad. Where did i go wrong?

On Aris → Codeforces Round #780 (Div. 3), 5 years ago
0

i don't use map or dp, just few lines of code with normal idea. But it took me 1,5 hour with 10 submissions to fix @@. No time to read another problems. https://codeforces.me/contest/1660/submission/151627303 check whole string and calculate number of occurrences of every characters. When you see the array have character appear two times, just add 2 to cnt and assign all array to zero. Answer is string.size()-cnt.