Comments

Hint: Any good subarray will contain atmost 30 distinct elements.

That was a constructive reply.

The editorial of make permutation is available now. Do check it.

Note the unusual timing.

Is there any approach different from the editorial of problem G?

.

Problem E is easy if you solved this recent Indian ICPC problem.

On line $$$137$$$, do $$$snukes[x][t] += a$$$. Also provide the base case of recursion, like $$$t == 1e5 + 1$$$ return 0; code

Let, $$$dp_i$$$ = number of rolls needed to reach position $$$n$$$ starting from position $$$i$$$. Hence $$$dp_n = 0.$$$ $$$dp_i = \frac{(1 + dp_{i}) + (1 + dp_{i+1}) + \dots + (1 + dp_{i + a_i})} {(a_i + 1)}.$$$.

If you solve the equation, you get $$$dp_i = \frac{a_i + 1 + (dp_{i+1}+\dots + dp_{i + a_i})} {a_i}.$$$.

So you can traverse from $$$i = n - 1$$$ to $$$i = 0$$$ and calculate $$$dp_i$$$. To calculate the value of $$$dp_{i+1}+\dots + dp_{n + a_i}$$$ you can use fenwick tree or segment tree.

On Rhodoks → Codeforces Round #810, 4 years ago
+9

There should be atleast one strong Chinese tester in each round.

ABC 257 starting in less than a minute!!

Nice problem set!

We want screencast

+3

list, coding style seems very close

+4

A team needs at least one programmer. Hence the number of teams can be at most a. A team needs at least one mathematician. Hence the number of teams can be at most b. A team needs at least four members. Hence the number of team can be at most = total people / 4 = (a + b)/4.

So finally the number of teams = min of above three = min({a, b, (a + b)/4})

+20

Game theory problems loading

0

At the time of the round the CheReKOSH olympiad will be held, where the problems from this round will be used!

On Markadiusz → Codeforces Round #743, 5 years ago
0

I feel you.

On Markadiusz → Codeforces Round #743, 5 years ago
+1

Thanks codeforces. I will be back again.

On Markadiusz → Codeforces Round #743, 5 years ago
0

Sed lyf, but the chances of being unrated is 99.99%.

On Markadiusz → Codeforces Round #743, 5 years ago
-7

If unrated, my possibility of becoming CM will be ruined for this time.

I believe you are classmate of these two.

Anyways hope is a good thing.

What generally erase does !!!!!

In multiset we use s.erase(s.find(key)) to erase one occurrence of a value. In pbds i don't think there is such operation.

I think you are asking how to find number of values less than equal to some x in pbds with pairs. s.order_of_key({x, n+1}) where n=number of elements in array. Or you can use any big value instead of n+1. s=name of pbds you initialized.

Try pbds with pairs, insert{a[i],i}.

Clashes with Codeforces Round #723. Can you please delay the contest by one hour?

IITians !!

+3

I solved problem 2 but I am not sure if it is correct or not.

pre[i][0] = sum of subarray elements starting from o to l where(l < i)

pre[i][1]= sum of subarray elements starting from l + 1 to i

such that absolute difference between pre[i][0] and pre[i][1] is minimum.

also calculated suf[i][0], suf[i][1] for subarray from i to n — 1.

link to my code

+12

(https://ideone.com/iLQvgv)

Link to my code

I quit

Matured testers

MiFaFaOvO Registered ...

On ABalobanov → Contest in a gym, 6 years ago
0

Problem I

On ABalobanov → Contest in a gym, 6 years ago
+5

Can you please make the codes visible?

I had done the same mistake in a round.

If n = 5 and inputs are 2 1 1 1 1, then for loop breaks in the fourth iteration and the last one is acting as n for next test case.

Wait, it was GRAPH!!

Atcoder is a competitive programming website just like codeforces. It holds a beginner level contest almost every week named Atcoder Beginner Contest(ABC in short).

Now scheduled :)

Scheduled !

What is your favourite topic in cp ?

Btw i have learned so many things just by reading your codes, especially in dynamic programming.

Thank you

I think this works in log(n).

Is multiset is too slow for 2e5? or I had something wrong in my code for problem F: Your text to link here...