Hello Codeforces!

The series of Educational Rounds continues thanks to the support of the Neapolis University Pafos.

On Apr/12/2024 17:35 (Moscow time) Educational Codeforces Round 164 (Rated for Div. 2) will start.

This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest, you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given **6 or 7 problems** and **2 hours** to solve them.

The problems were invented and prepared by Adilbek adedalic Dalabaev, Ivan BledDest Androsov, Maksim Neon Mescheryakov, Roman Roms Glazov and me. Also, huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Big thanks to the tester shnirelman for his valuable advice and suggestions!

Good luck to all the participants!

**UPD:** Editorial is out

Hope it would be the best Edu round

Good luck for everyone!

After the contest I will be live discussion problems I manage to solve. stream link

Good job, I appreciate that!

Thanks bro ❤ that will help

No testers?

It will be tested in production

Testing complete. It's div $$$1\frac12$$$

what does this mean?

=1,5 , that means it's harder than usual TT

Disagree, It's the first time i did ABCD in a long time and I don't think D was on par with the usual div 2 D problem

BledDest round. les go

BledDest orz

BledDest orz

BledDest orz

BledDest damn

BledDest orz

BledDest orz

lgo

Hope able to solve ABC

Waiting

Good morning ;)

I'm just wonder why there are few Educational Rounds on Saturday...(They are my favourite) As a boarding school students, I only have space time to participate contests on each Saturday, so I can only vp it. :(

Wish there will be more Educational Rounds on Saturday :)

Hope this contest will be best for everyone. Best of luck guys.

This comment is in queue……………

I hope no queue issues during the contest

Hoping to become cyan

Why only

Cyan? when you can becomeSuperCyan!hoping for no in queue difficulty :)

good luck for everyone

I wish, i would regain CM today.

same

I will pray for your +19

My home was near the flood in our city, so i had to move on to my grandmother... Thus, I was late for the contest for one hour... So sad(

Are you alright? Atleast now you can spend some quality time with your grandmother

I am okay, thank you <3

You are right!

Hope to blue soon !

too much

cant participate :( hope everyone have a great time :>

I hope for green today

sounds like it's mathforces time!

"Single interger X" but it's a string XD, so tragic for me

B > A >= C

C is way too easy than B.

both are very easy, there is little to no difference

C is easy Gready problem and the solution can be noticed through the tests sample

B is simple Sliding Window problem but this may be not clear as it is in C

So B > C

Bad C in my opinion

C was kinda easier than A, and definitely easier than B

for me it took very long time to do C. i could not proof my approach for so long...

Isn't it basically

`a^2 - b^2 = (a - b)(a + b)`

?yes, i knew i have to minimize the difference but i was doing silly stuff, i dont know why i am getting dumber by day... :(

I solved A and B in-contest, having penalties on B, but solved C in a few minutes after reading it post-contest!

Lmao, solved B,C,D in 30 minutes, but took 30 minutes and 5 penalties on A. Could have had 2100 perf instead of 1850.

A was straight forward.

what kind of data structure might help to solve problem like D, is this well known problem? like evaluate sum of value on every subset?

noticed value of a[i] is small must has something to do this, any hint?

Its simple DP problem

The key observation is to know how to calculate efficiently the number of groups for each set of color

NiceD butnotC(I don't know how my code for C is true).if 2 numbers are closer to each other, their product will be bigger, e.g.: n^2 > (n — 1) * (n + 1) > (n — 2) * (n + 2) > ...

Solution can be proved using induction. My first thought is using (x + y) ^ 2 / 4 >= x * y. The equal sign happens when x = y => Then we should make x and y closer

If you have 2 numbers $$$x$$$ and $$$c-x$$$ whose sum is a constant $$$c$$$, then their product is $$$x \cdot c - x^2$$$. Differentiating with respect to $$$x$$$ you get $$$c - 2x$$$, and differentiating again you get $$$-2$$$, which is always negative. Thus, setting the first differential at $$$0$$$ gives you $$$x = c/2$$$, which means that the original numbers being closer to $$$c/2$$$ will have the higher product. This is "kind of" common knowledge, but now you have a proof. Algebraic proofs are also common. This one's for the calculus lovers.

$$$xy = \frac{(x+y)^2 - (x-y)^2}{4}$$$ , and as $$$x+y$$$ is constant we should minimize $$$|x-y|$$$

I'm genuinely shocked so many people solved C (of course I might just be dumb, as everyone is saying it's easy). Any hints please?

try to make numbers as close numerically to each other as possible 5*5 = 25 , 6*4 = 24 if numbers become equal product is maximum

The intuition behind it is that if the sum of two numbers is fixed, their product reaches max when each of them is set to SUM/2 (you can easily prove this). Since the sum won't change your goal is to minimize the greater number and maximize the lower one, so just figure out the first different digit of each and put the lower of the remaining digits in the one where first different digit is greater and the others in the smaller one.

I remember seeing a proof like this. I was thinking something similar during contest, but I wanted to make the sum of x digits close as possible to sum of y digits (instead of actual numbers).

hint: compare prefix from 0 to n-1

for the first index, you take the maximum of the two, then for the rest of the index take the minimum of the two. why that works? i dont really know lmao

Suppose $$$1 \le x \le y$$$, then we can show that $$$xy > (x-1)(y+1)$$$. Try solving it from here.

Hint 1$$$x+y$$$ is constant after operation

Hint 2$$$(a-b)(a+b) = a^2 - b^2$$$

Hint 3from Hint 2, we want $$$x$$$ and $$$y$$$ to be as close as possible

Need to make the difference between the two numbers as less as possible. It's a general rule to maximize product of two numbers.

can any one look at my submission and see if it's correct I passed system test but after I read your comments I don't know if it's correct any more https://mirror.codeforces.com/contest/1954/submission/256352583

it's correct i think

C is not at usual level at which C should be it is kind of easier than A

yes I agree its way easier than A and B

solved C after 10 seconds of the contest because I wrote == instead of = it would have been the first time I solve 3 question in div 2 contest

Why the orange+ contestants are not out of contest (no asterisk before CF handle at least)?

Asterisk = unofficial participants != unrated participants. Basically there are no unofficial participants in div1/2 contests. In div3 or below, some class of people must participate unofficially to give less motivations to cheat by making official standings consist of "cleaner" people.

Got it, thanks! I think I still don't quite understand the difference between

unofficialandunrated. Do you have a clear understanding of that?Refer to the last div3 contest's announcement for the exact condition to be considered official participants, but in sum:

Unrated: When the contest will not affect your ratings due to your current rating range being out of the bounds from the contest. You will be shown in final standings. It depends on your current rating( & no of contests you have participated in for new users).Unofficial: You will not come in final standings unless you mark the check box with [] show unofficial. This also includes people who have submitted post contest or during virtual contests. It has nothing to do with your current rating.Please correct me if someone has a better explanation.

I also think this is weird. In normal div2 contests they don't appear on the scoreboard unless you tick the "Show unofficial" option. For some reason in educational contests they appear even though the contest is unrated for them, and the option to filter for div2 appears only after the hacking phase (or sometime after the contest, anyway)

In early days educational rounds weren't rated for anyone, so it's not a surprise that everyone was official participant. It's just that at some point it started to be rated for Div. 2 people, among all 'official' participants.

Maybe I should only participate in educational contests

How did you solve problem E? Your solution looks like it's O(n*logn) (or at least faster than n*sqrt), can you please explain it?

In a few hours, if there is no editorial yet

Idea: Ans for k is sum of amount of alive "islands' after 0, k, 2k, 3k hp deleted We can calculate this for every k' from 1 to 10^5. Then for each k just straightforward sum

I love how you clearly explained it in a couple of sentences. Cool solution, could you share how you got there?

visualizing an array like this helps me a lot in solving problems like this

How to prove it, or at least how to see it?

Instead of basic chain attack we might consider the one that attacks all enemies at once but we pay $$$c$$$ cost for each attack where $$$c$$$ is number of maximal segments (segments that we cannot expand) of consecutive alive enemies (then we want to compute the cost instead of attacks count). One might notice that if we are able to quickly compute $$$c$$$ after some number of attacks in $$$O(1)$$$, then we can compute all answers in $$$O(MXlogMX)$$$ by simple simulation. To compute $$$c$$$ efficiently we can precompute how many maximal segments will remain after dealing $$$x$$$ damage to all enemies, which is pretty standard problem. My solution for reference

Maybe I really should :(

i don't know why it took me more than 40 minutes to implement a simple knapsack!!!

knew the solution within a minute, i did so many implementation mistakes and so much shitty things, even tried to separate odd and even in dp and tried prefix sums in dp.

was simple knapsack!

Me too lol I forgot to add the number of ways to the new state and got WA on pretest 5 three times lol

can anyone tell me why my solution for D doesn't work? (it failed tc 13)

my solution

Had the same issue, tmp[{sum, mx}] += cnt; tmp[{tsum, tmx}] += cnt; You should take mod of them. Since they can get big.

bruh, really :(? will try to fix that later. tysm for pointing that out. I forgot it can go as big as 2^n

you didn't use mod in this line. The wrong answer was because of overflow.

I fixed it and resubmitted, but got TLE on testcase 16.

yeah, maybe because i use both sum and max as a key. I thought it would work somehow XD

interesting D, thanks for the contest

7 penalties on A. What about you?

very classic problems. dislike

It’s an Edu round

“Useful, even well-known ideas will be reused in order to introduce them to a wide range of participants”

Oh man I didn't know that thanks!

Don't click me if you are IndianI think you entered the wrong site address, it's not codechef.com it's codeforces.com eejit

you can read this comment from awoo him self where he says:

I personally stopped treating edus differently from common div2s, and maybe you should too.Could you please tell me why were these classic and if yes where can i pratice problems like these, is there any archive or a filtered problem list?

awful wording in E. for 20 mins, I was thinking that each instance of the lightning propogates both left and right. should have just said "choose a subarray such that all elements are +ve and decrement it"

Python users on C have a big advantage

how?

U can simply brute all the flips, choosing the maximum

Submission: 256304596

No language has any advantage, If The number can Go upto 10^100 then ofcourse you shouldn't even consider making it a number anyway, as the biggest number would almost take 300+ bits to be stored, If anyone even as to tries to store them in a int ( say someone stores it in a Big-integer in Java) then it just makes accessing individual digits harder, so a number isn't the way.

Actually, it's not really about large numbers, just the property that the product would be maximized when the numbers are closest to each other.

SpoilerI also had the same intuition(256377521) but I am not able to prove it, is there any proof of this property that you can provide?

Let us call the constant sum of $$$x$$$, and $$$y$$$, as $$$c$$$. Then,

$$$x = c - y$$$

The product, $$$p$$$, can be written as

$$$p = (c - y) \cdot y$$$

Differentiating with respect to $$$y$$$, we get

$$$p' = c - 2 \cdot y$$$

WLOG, we can assume that

$$$x \geq y$$$

i.e., $$$2 \cdot y \leq c$$$

$$$\implies p' = c - 2 \cdot y \geq 0 \ \ \ \forall y \leq x$$$

Here, we see, that the first order differential (or the rate of change) of $$$p$$$ is positive over all valid $$$y$$$, i.e., $$$p$$$ increases with $$$y$$$, so we just have to maximize $$$y$$$ (while ensuring that it is less than $$$x$$$)

A simpler proof without calculus:

Let $$$c$$$, be the constant sum, and $$$p$$$, be the product.

WLOG, let

$$$x \geq y$$$

For some non-negative $$$d$$$,

$$$x = c/2 + d$$$

$$$y = c/2 - d$$$

$$$p = (c/2 + d) \cdot (c/2 - d)$$$

$$$p = c^2/4 - d^2$$$

Thus, on minimizing $$$d$$$, $$$p$$$ is maximized, as $$$c$$$ is a constant, which is effectively what you're doing

I don't see any point in adding the additional constraint on the number of balls in D.

You didn't use knapsack?

how did you solve it? I did knapsack and that is a pretty important constraint.

Ehh? How did you do it without using the bound on the sum?

The number of groups is max(maximum value, ceil(sum / 2)). So the sum values less than 2 * a[i] and greater than 2 * a[i] can be dealt separately.

A rough inadequately explained solution:

In the sorted array

Let dp[i][j]: number of subsequences ending at i and having sum j

f[i]: sum of ceil(sum / 2) over all subsequences ending at i

Then the sum of values of subsequences ending at i will be:

a[i] * (dp[i][0] + ... + dp[i][2 * a[i]]) + f[i] — sum(dp[i][j] * ceil(j / 2)) [j from 0 to 2 * a[i]]

So I would only need sum up to 2 * a[i] to maintain the dp.

If the total sum of $$$a_i$$$ does not have that constraint, then the maximum total sum will be $$$5000^2$$$. How you can deal with it?

my solution was O(n * sum(a[i])) memory and time. is there a faster algorithm?

factor of n can we reduced from memory.

I didn't see the additional constraint during the contest. I solved it for a[i] <= 5000.

Any hints for E?

Problem E.Let's call F[i] is the number of connected components when there were i damages dealt to all elements. We can find this by DSU or simple array. Lets for k from 1 to max(a[i]). Consider when the damage strike is k. At damage 0, F[0] = 1, so we need one strike. Next, when the damage is k, we need F[k] strike (because there were F[k] components). F[2 * k], F[3 * k], F[4 * k], ... is similar. The complexity is n / 1 + n / 2 + ... + n / n = n log n.It is confusing for me. Maybe I misunderstand something. For example, a = [5, 2, 7] and k = 2. Then F[2] = 2, and the strike need to be done is 6. (2 != 6)

I think what he means is that if k = 2, it takes f[0] + f[2] + f[4] + f[6] + ... + f[i] casts to kill all, where i is a multiple of k and i <= max(A).

I don't understand, fuck you

I spent all my time to solve B but it didn't work. But after the contest i realise that exercise C ist easier than B. It takes me only 5 minutes to solve C. I was so dumm !!

Got 4 WAs and realized after contest that I was using the wrong modulo value in D :(

Why there is not a bigger example for problem F? I took the wrong modulus (1000000007 -> 998244353), got WA verdict and did not realize it until the end, sad.

I did the same mistake in D

just realised I was getting WA in E because I was taking mod.

Heavy cheating in today's contest as solutions were released when the contest was running

Nullify this contest otherwise it will be unfair for everyone Here are the links to the cheater's videos' A: https://youtu.be/yXRyAn_SYXk?si=LbSIstKeOXdzgcb1 B: https://youtu.be/jDsYHXQJoWc?si=S4zptf35hazQqu6o C: https://youtu.be/3TrPpil9Xw0?si=BL35v3FAe8phfAID D: https://youtu.be/eJy82kVvRKg?si=ctsUvPCAI8vWN80T

I see you draw attention to the channel

And if this will be considered with less than 1000 watches then this channel can stop the rating for CF div2 till its owner die

is it possible to ban these cheaters IP address so that they can never visit codeforces website again with their device...

My Problem B submission 256318074

Can someone please help in finding out that what is wrong in my logic for problem B, Thanks!

When you want to "merge" 2 nearest numbers, neither of which is equal to a[0], you merge them using only v[i] — v[i-1] — 1 deletions. (However, you are correct in your count of moves, necessary to made first and last numbers in array differ from each over).

3 3 5 3 3 5 3 3 3 For this test case the answer should be 2 right ? I cannot exactly get my mistake And can you please guide me that how can I deal with this type wrong pretests as mostly my logic is correct but I am stuck by a small mistake

Yes, the answer should be 2. Your mistake is that between indices v[i] and v[i-1] there are only (v[i] — v[i-1] — 1) other indices, and not (v[i] — v[i-1]) (as you count in your submission). Essentially, you are deleting 1 more element than you really need.

I can assure you, that the so-called "+-1 errors" are increadibly common for all programmers, and even after a years of programming you can still make this mistake. But i can afford an approach, which can probably reduce a chance of this mistake for you: in such cases, try to think about every index as a half-interval on the numeric line from zero (not inclusive) to i (incluzive), When you subtract one index from another, you get a length of half-interval from first index (not inclusive) to second (inclusive), meaning length as number of indices this half-interval cover.

So, in that approach to get the number of indices between i and j, you should just remove 1 excess index from half-interval "j — i" (and that's how you get number j — i — 1).

Not sure that this is exactly what you needed, but in my experience half-interval thinking often simplifies case analysis "where to assign an extreme value"

Thanks brother it helped a lot

Thanks a lot bro, I get my mistake I even came up with this test 3 3 5 3 3 5 3 3 3 during the contest but still somehow managed to mess this problem up. Anyways Thanks a lot for help

This is your code after the mentioned changes 256361851

Thanks a lot bro, I get my mistake I even came up with this test 3 3 5 3 3 5 3 3 3 during the contest but still somehow managed to mess this problem up. Anyways Thanks a lot for help

D was simple Memoization.

I think I'm the only one who didn't notice that line:

Additional constraint on input: the total number of balls doesn't exceed 5000Very nice contest. Problems were really good. Thanks for the round adedalic BledDest Neon Roms awoo and all testers.

Perhaps E can be strengthened to $$$n\le10 ^ 6$$$

I think they set $$$n$$$ to only $$$10^5$$$ on purpose, letting $$$O(n^{1.5})$$$ solutions (easier to come up with) to pass.

Couldn't solve'C', in 'C' i just realize multiplication works like Bits So greedily we'll allocate max of (s1[i], s2[i]) where (s1[i] != s2[i]) at the highest significant place of 's1' (at i) and then from there, iterate to the least significant side and allocate max of (s1[i], s2[i]) in place of 's2' (at i) and min of (s1[i], s2[i]) in place of 's1' (at i)In contest, i knew to get the max multiplication possible, we have to do something such that difference of both numbers is less as possible.. but couldn't

proveany soln for this. and ppl found 'C' the easiestLOLBro, look at the "Announcement" again. It's 'Neapolis University Pafos' instead of 'Harbour.Space University'!!!

I CAN'T BELIEVE IT. This contest is going to pull me out of the swamp of 1790... but too strong.

My first 5 solves Div2, first orange Performance, and

Candidate Master is on the way!!D solutionD: If the maximum of a subset is greater than the sum of the rest of the elements, the value is the maximum; otherwise, the value is ceil($$${sum/2}$$$). Sort the array in ascending order first, DP for the number of subsets at sum j in all subsets formed by the first i elements, and iterate over dp[i-1] when considering all subsets with a[i] as its maximum.

E solutionE: At first I thought this might be some segtree problem. But later I realized I need a way to maintain the left and right boundaries of each segment of living monsters. Dealing 10 damage to all monsters once is the same as dealing 2 damage 5 times.

I maintain the number of segments after all monsters take i damage segs[i], by first sorting the monsters by HP asc. , then "deleting" each monster and updating the whether monsters on its sides are bounds(isLeft, isRight). Finally the answer with damage d is $$$\sum{segs[kd]}$$$ and takes $$$O(nlogn)$$$.

Can you pls provide a proof of "If the maximum of a subset is greater than the sum of the rest of the elements, the value is the maximum; otherwise, the value is ceil(sum/2)" for problem D (for the ceil(sum/2) part)

If one color accounts for more than half of the total, all the rest is not enough to pair up with it;

Otherwise, you can repeat: group one of each of the 2 colors with the most balls and take them away. In this way, you will not get a 1-ball group except the final one.

This might also help:

Let's assume we have three (you can assume more too) color balls with count: a a+x a+x+y such that a+x+y<a+a+x for the 2nd process => y<a

This is what will happen with them as with repeat the process a a+x a+x+y a a a+y a-floor(y/2) a-ceil(y/2) a a+1 a a 1 0 0

Hope this helps in understanding that at max 1 ball will be left only.

How well known is the trick to C? I couldn't solve it and was surprised how many other were able to. Is there a website they went to for tricks like that?

Pretty well known. I guess high-school math covers such stuff

I just wrote the samples on a paper in this form 73 = 7*10 + 3 31 = 3*10 + 1

73 * 31 = (70 + 3) * (30 + 1) = 70 * 30 + 70 * 1 + 3 * 30 + 3 * 1 (Tried swapping numbers later)

I noticed that after I find the most significant number in a that is larger than a number in b (assuming a > b), b is more important in making the product a larger number, so I need to maximize the numbers in b after that first different number.

That's how I concluded it, not sure if everybody did the same.

you could have written a brute force solution and tried to find a pattern

you can easily see the trick by quantities, x*y and (x+1)*(y-1)

here when y>x+1 its always better to reduce from bigger quantities i.e., y and and increase in smaller quantities i.e, x.

Do anyone have memoization solution for problem d ? if yes please provide.

I tried to wrote one but it is failing 256352960

A >> D

What about D? describe main approach...Anyone pls

Could somebody help with D solution?

simple recursive dp 256322429

Bro, I need text solution) It's not hard for every one to find code for this problem

Can you Please explain your recurrence ?

sort arr 3 cases 1. pick element and stop (last picked element is max) 2. pick and continue 3. dont pick and continue

base case return value will be max(sum/2,max_ele=arr[index])

can't be pick element and stop will come automatically in pick not pick. Because pick not pick gives all 2^n possibilites. why it will not going to work in that case.

if you do pick element and stop you will just get one element

Thanks you BledDest and all testers. It was a pure edu2 contest. I think all programmers are glad to participate.

Just 3 minutes off of E feels so bad

can some1 give me hints in D on how to calculate groups for a certain set

groups will be max(sum/2,max_element)

If you brute force over all possible sets, that would be $$$2^{5000}$$$, which is infeasible. A hint here would be to consider that the sum of all possible subsets is very small, and you can probably do just as much with a $$$CountOfSubsetsWith[SubsetSum]$$$ as brute-force.

TagDP

B > C, It was an easy problem No C.

Good Edu Round!

In the third question it is not writtern that the length of the numbers will be same!!

You are given two integers x and y of

the same lengthBut it has mentioned in the first line, "You are given two integers x and y of the same length"

mention in first line. read the statement carefully

How do you solve F? Initially it looked like a trivial application of Burnside Lemma, but the set of all reachable reachable states $$$X$$$ (here states are different in the usual string comparison sense) isn't acted upon by the cyclic group $$$C_n$$$.

You can still apply Burnside Lemma here, but first you need to extend X to contain all shifts of reachable states. This is equivalent to making X contain all the combinations with no more than k+c 1s and having at least one (cyclic) contiguous segment of c 1s. After applying Burnside's Lemma, you'll end up with a similar subproblem for every divisor of n. Now every subproblem can be solved using inclusion-exclusion principle.

I believe that this approach can be optimized to solve the problem in $$$O(n*\log\log(n))$$$ time

What observation should I make on D?

/hint

For a given subsequence, the value or the number of pairs we can form is the maximum element, if it is greater than the sum of remaining elements otherwise $$$\lceil sum/2 \rceil$$$

But the only way to compute that would be to check each combination and calculate their sum. How does one incorporate dp in that to make it O(n^2)?

You can calculate the number of sets that sum to a particular number using dp

dp[i][k] = dp[i — 1][k] + dp[i — 1][k — A[i]] where dp[i][k] represents the number of subsets with sum k that can be formed using elements up to the ith index

during calculation of ans,why did u multiply the VALUE with dp[i-1][j] and not dp[i][j]?also what does your dp[i][j] represent.

edit:nvm,i got what u did

Since we are dealing with subsequences, the order does not matter so sort the array.

In this sorted array we can calculate $$$dp[n][sum(A)]$$$ in $$$O(n^2)$$$ where $$$dp[i][j]$$$ = number of subsequences using first i elements having sum j

Invert the sum:

sum over subsets f(subset) = sum over values v * (number of subsets with f(subset) = v)

if you need a reference see Concrete mathematics chapter on sums.

what I'm doing wrong here? problem D 256376695 any help will appreciate

You should sort array.

unsure why it matter but got AC thank you.

Consider array: 7 7 7 1 Without sorting when the sum is equal to 15 you are using 1 3 times and 7 0 times. With sorting you are using 1 0 times and 7 3 times.

Your code assumes that the biggest number you are taking in this case is 1 because you consider it after 7. Hope this will help.

that make much sense now, when update cnt any value less then 7 should be accounted otherwise will not counted but for greater number it doesn't matter because greater number will takeover.

I solved E but I don't know how to solve D >_<

This was a really good round (even if I didn't compete), the problemset was superb. I loved D and E. C was a little too easy to be in its position, but still entertaining nonetheless.

Is the system testing done?

No

https://mirror.codeforces.com/contest/1954/submission/256346898 this is my submission for B can anyone tell me a test case where it fails ,i tried but couldn't find one?

Tests Sample3

13

2 2 2 2 2 1 2 1 2 2 2 2 2

13

2 2 2 1 2 2 1 2 2 2 2 2 2

13

2 2 2 1 2 1 2 2 2 2 1 2 2

Your Code Answers5

3

2

The Right Answers1

2

1

The Deleted Numbers Order7th number

5th and 6th numbers

5th number

okay got it i thought you can delete numbers from start and end only

my bad!!

how did you come up with the test cases?

is there any tool for it?

thanks!

These aren't (or may be) a part of the main tests.

I put them as a sample of counter examples of your code.

I think you can't know the exact test's input when its order become high like +80.

okay thanks anyways

Is it unrated???

UPD:Now It's rated.=)May be, because cheating happened.

I chose two user randomly, and I looked so many users, all of them are unrated.And I can ensure that I didn't cheat.

Why???

There were some YT videos with solutions during the live contest. That's y the contest might have been made unrated.(I am also not sure) U have not cheated but there are some guys who have cheated.

Is it that Cf shows “unrated” when the rating hasn't been updated yet? I'm new to Cf and don't know if this happened before.

System testing is pending. After that, the ratings will be updated. Till then, it will be shown as unrated.

HELP HELP HELPHow can my iterative code giving Stack overflow it does not make sense

256427774

Because you are declaring arrays

`ways`

and`dp`

of size`N*S`

which can get as high as $$$5000^2$$$.And since you are declaring them inside

`main`

function, it uses the`automatic`

storage class, which is allocated in the stack frames.Stack frame's memory is quite limited and $$$5000^2$$$ integers is a lot.

I changed the arrays to use

`static`

storage class with constant size 5000*5000 here 256430212 and your code passes :)Thanks for pointing out the issue,

I am coding in C++ for over 3+ years i did not know that this kind of limit exist.

Note that Codeforces' compiler options make C++'s stack size unusually large. On Windows, the default stack size is 1MB but on Codeforces environment it's set to 256MB (see Codeforces Command Lines). On normal programming, you should never write that kind of code.

(Small rant: large stack size gives advantages to C++ (and a few other compiled languages that has similar settings), which is kind of unfair to other languages. On C++, you can recklessly write deeply recursive functions thanks to the large stack size -- on the other hand, it's not possible to write deep recursion on Python.)

damn i'm tempted to switch to c++ , just so i can learn stuff like this

You can not create such a big C array in function. The stack of a function is only several Megabytes and is only suitable for around $$$10^5$$$ integers. You can try to use a global array which can be much bigger or use std::vector.

When are we getting the final results? Have the submissions been rejudged yet?

Is this unrated?

I was also unrated. I dont know why.

Is this unrated?

Is this unrated?

please provide an update on when the rating will be updated?

My rating is 609, will I be rated for it?? As im my contests section this round is regarded as unrated but here it says it's rated for all below 2100? #help__

Bro not rank, its rating

It also not given editorial

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).if you read the blog for latest div 2 contest it states that

"UPD: The rating changes for Educational Codeforces Round 164 will be applied after this round."That means the rating will be given after the div 2 right?blogpost link

When are we getting rating updates? it’s been over a day already

look at the previous comment

Rating are not updated yet ?? It is rated for div 2 still there are no updates yet.

No idea

Can someone explain for me why l = ⌈a[i] / ⌈a[i] / r⌉⌉ in problem E?

Hello codeforces, my account is public so that the code can be accessible by anyone.It's not fault.Please save me for this time.