*I almost copied my previous blog post to separate two discussions: about Div. 4 in general and about Round 640. Please, visit this blog post to discuss Div. 4 rounds.*

Hello Codeforces!

Yes, it is not a mistake I decided to run the first Div. 4 round: Codeforces Round 640 (Div. 4)! It starts on May/09/2020 17:35 (Moscow time).

The format of the event will be identical to Div. 3 rounds:

- 5-8 tasks;
- ICPC rules with a penalty of 10 minutes for an incorrect submission;
- 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
- after the end of the open hacking phase, all solutions will be tested on the updated set of tests and the ratings recalculated
- by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are unrated participant/newcomer).

I urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism, but simply to take part unofficially. Please do not spoil the contest to the official participants.

Only *trusted participants of the fourth division* will be included in the official standings table. This is a forced measure for combating with unsporting behavior. To qualify as a *trusted participants of the fourth division*, you must:

- take part in at least two rated rounds (and solve at least one problem in each of them),
- do not have a point of 1600 or higher in the rating.

**Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.**

Please, read some of my thoughts about the problems of this round:

- Don't expect A+B level problems :-) It is a real contest with easy but problems. I hope most problems fit in range D3A-D3D problems.
- I'm not sure about order of problems. Try to read all problems or at least most of them. Testers expressed skepticism about the order of the problems but suggested different pairs of problems to swap.

We are just starting, so the complexity of the problems may deviate somewhere from your or my expectations. Wait and see.

The first "thank you" is sent to antontrygubO_o, who helped with the review and selection of problems.

Many thanks to the testers: pashka, 300iq, vovuh, Golovanov399, spookywooky, kocko, Sho, igor_kz, Sho, scott_wu, bfs.07.

I hope you enjoy the problems, and the round will be interesting!

Please, leave in comments your thoughts about exactly this round. If you want to write something about the general idea of Div. 4, then visit this blog post.

**UPD**: Editorial is published!

finally ,, thank you :) ; i think this is my chance to become a specialist after 4 years in codeforces

really i solve 2 problem in Dev2 .. so i will try my best here

.

If you only solved two problems in yesterdays contest, think you need more practice at basic implementation problems :)

Really i had failed... ;'(

is it rated for unrated accounts?

Yes

All I want is a smooth and queue free contest today

How to become tester for CF round? Are testers author's friends or something else?

maybe it's predecided by author or mike!

For testers this problems is easy. Maybe before the round gives this problems to grey people?

I don't think so! Usually high-rated people tend to keep the problems secretly!

Hello!

If i have 1400+ and only 1 rated round and i'll write this div.4 will the rating be recalculated?

Thanks for the new contest :)

I think it won't be rated for you.

Sorry, no. Actually, I have plans to reduce the initial rating (from 1500 to 1200 or even 900). It will remove a series of rating drops in the first contests.

This will be a lot better.

Maybe to 1300 or 1400?

Please be careful, new rating may become more expensive than the old one (new rating will be harder to get than it was earlier, so it will be impossible to compare old participants with new one).

Also without additional measures you may get the same rating drop but starting from a new initial rating.

Have you considered a few "qualification" rounds instead? Eg. first 2-4 rounds participants has only hidden rating and they get their rating and color only after qualification series finished. This system implemented in some games, eg. Starcraft.

eg. CSGO xD

Mike now that new comers start with 1500.They lose points. Which is gained by experienced users. But if you start their ratings st 900. It will become more difficult for experts and specialists to gain rating changes.

GOOD LUCK TO EVERYBODY!

Affect of Div.4 contests on us:

SpoilerPast: We can only take part in Div.4 contests.

Present: We can only take part in Div.5 contests.

I am looking forward to the problem A. How much difficult it is!

A was not that easy.

Will it be unrated? Like last round?

Because I know you all have so many questions, I have compiled an FAQ:

Q: Is it rated?

A: Yes.

Hope Not to See Atcoder's ABC's A and B problem :)

Today ,we are going to witness a historical moment and be part of it .

Upcoming generation will witness this post and will be enlightened by our high intellectual comments and will praise our intelligence. (First div 4 round on CF)

What is the meaning of D3A-D3D problems?

Div3-A to Div3-D

By seeing the upvotes of this blog we can imagine how codeforces comunity got disappoint after div4 got introduced :(

I am new to CodeForces and I am sorry for this question but why does div4 disappoints the community?

Or maybe the majority of people upvoting are pupil and noobies (happy with the free rating increase for them) which constitutes 90% of the codeforces traffic.

There seems to be an unwritten rule to not post an editorial before end of hacking phase. I do not see the point. People discuss problems in the comments anyway after the coding phase.

Is there an official opinion?

No such official rule. I think it is quite OK to post an editorial before the end of an open hacking phase.

Thank you MikeMirzayanov for running an awesome platform not only for advanced users! Maybe it will be helpful for newbies like us.. We will try to give our best shot :)

Is it rated?

Read the post's statements carefully. :-D

(Yup rated but not for all)

this(division 4) will be helpfull. great idea..... :)

All time high.. 26K+ participants ..wow

28.7k is ever highest

Still long queue?

Common, at most 1 minute long on the start. It seems we are starting to forget what a queue is.

Yeah! everything fine now:) Thanks.

is this a really Div.4 are you sure???

And you expected "a + b — c" kind of problem?

Well, usually I hate problems with test cases, but not in this case.

Samples are so strong so I can just submit the solution without carefully checking the answer, since WA 1 doesn't count.

I really appreciate it. Thanks, Mike.

I would recommend checking for the sample tests before submitting though. It's the least we should do to put less load on the server.

Since Mike wanted to test the system under load, I think, it's even better to submit a solution whenever you think you're ready. (and, probably, resubmit after WA1)

meanwhile specialists today: " i am superman!!!"

Nice contest!! (Although there can be a slight increase in difficulty of F or G as also in Div3 end questions are around 1700-1800 rating.)

End questions in div 3 are not 1700-1800. More like 2000-2400.

End is relative :)

The queue time almost does not exist! Thanks for the great round!

well there are 40+ pages on queue so...

40 pages = 2-4 min of queue

40+ pages of pretest. The setters are trying their best to put a lot of good test cases in a small amount of cases. I dont think it would be an issue.

What div.1 and div.4 have in common for me: having nothing to do for about half an hour before the end.

ayaya that made me laugh but its mutual

Thx! That's why I chose Codeforces. It's a good website to learn English and get contribution as well.

Very good work of the codeforces administrators, the queue time was significantly reduced. The queue time for round 639 was around 40 minutes while in this round the cap was 2 minutes. I think codeforces is ready for div 1 and div 2. Thank you for your wonderful work.

I solved all problems in this first contest of Div 4!!!

I'm so happy about it!!!

Officially, I have the 12 place in official list of participants!

Predictor says that I will have +330 rate!!!

Amazingg~!!!!!

Love you, Mike Mirzayanov!!!!!

P.S. Mike made my dreams come true!!! I really want T-shirt with your autograph, cause you are my superstar!!!

Congratulations. Keep this motivation, and you will be successful.

Well done! Now make sure you won't get hacked :(

I doubt if you've done it yourself. I'll personally check all your submissions on my MOSS and report any plagiarism case to codeforces. Simply not possible for a grey (unless alt ofc)

Bro chill. No need to report him to CIA.

If I remember correctly, you are that guy who defended Karan Gujjar. Now u r accusing everyone of cheating. This contest was no big deal anyone could have solved all the problems. Instead of motivating him, you are accusing. Grow yourself

I think the order was a little unbalanced. It should be

A C B D E G F

OR

A C B D G E F

OR A C B D G F E

I dont think so F was the most difficult problem acc to me

A C B D E G F seems to be the order of difficulty according to the AC counts.

Really? I thought E was simple and didn't require any experience dealing with similar problems, even though you had to work around the memory limit some. Meanwhile I had no clue how to approach G since it wasn't something I was familiar with.

Solution of E Odd numbers in decreasing order then 4 then even numbers in decreasing order. For n = 8 7 5 3 1 4 2 6 8

Damn, knew it was some trivial pattern I was missing. Thanks!

I also didn't find a pattern at first, so I did a dfs search to find the solution.

Can you explain further how can dfs be used to find pattern ?

You consider all the numbers as nodes. The edges are between the pair of numbers that are 2-4 away from each other. The you start dfs searches from all the n numbers and try to somehow get all of them in one search. You can check my code for details. The complexity is O(n^2) however.

Isin't this the solution of G.

He asked G :)

If you are a Newbie,I think ACBDGEF is better

(But it is ACM-ICPC so it doesn't matter)

Problem of long queue has improved a lot wrt last div1/2 contest!

When you solve 4 problems in div3, but here you solve one......

I like problem A. It is easy but interesting and has an educational value.

Unofficial editorial in Python 3. For more editorials see my discord http://interview.solutions

## Problem A

Problem A - TutorialEach number like 1234 should be written as 1000 + 200 + 30 + 4. We ignore any zero digits, so 10203 = 10000 + 200 + 3.

Problem A - Solution## Problem B

Problem B - TutorialIf the task is possible, we should write either: [1, 1, ..., 1, x] or [2, 2, ..., 2, x].

This is because the requirement for the last number is that it has the same parity, and it is positive. The requirement of being positive is the same as the sum of the other numbers being as small as possible. Therefore, we make the requirement strictly easier by decreasing the other numbers by 2 (if possible.)

Problem B - Solution## Problem C

Problem C - TutorialThere are three possible solutions.

Solution 1 (lifting): Say k >= n. We could remove the first n numbers from contention: k -= n — 1, and now we start counting from n + 1 instead of from n. For example, if n = 10 and k = 15, we know that in the first 10 numbers, there are 9 not divisible by 10, so we start counting from 11 with k = 15 — 9 = 6. If we did this naively, we would get TLE because k could be really big and n really small.

We could scale all the numbers involved to do this faster. For example, let's scale by 1024: if k > n * 1024, we know that in the first n * 1024 numbers, there are (n-1) * 1024 not divisible by 10, so we start counting from 1024 * n + 1 with k -= (n — 1) * 1024.

Solution 2 (binary search): Let f(x) be the number of positive integers <= x that are not divisible by n. This is a monotone increasing function and we want the first x such that f(x) == k. We can binary search for the answer.

Solution 3 (math): Write k = (n — 1) * q + r [with 0 <= q, 0 <= r < n — 1]. The first q groups of n numbers has (n-1) * q not divisible by n. If r > 0, then the k-th number is just q * n + r. If r == 0, then the k-th number is just q * n — 1.

Problem C - Solution## Problem D

Problem D - TutorialWe just simulate each turn of the game carefully. Here, the pointers i and j will represent the next candy that Alice or Bob respectively will eat if given the chance to.

Problem D - Solution## Problem E

Problem E - TutorialWe should find all special numbers — numbers that can be written as a sum of two or more consecutive terms in the array. After, for each element of the array, we check if it is a special number.

Problem E - Solution## Problem F

Problem F - TutorialNotice we can replace 0 by 00 to satisfy the n0 requirement, and replace 1 by 11 to satisfy the n2 requirement.

So let's satisfy the n1 requirement: let's write 010101... first. Then replace the first 0 and first 1 with repeated zeros and ones.

For example, say n1 = 3. We write 0101 first. Now n0 = 4 and n2 = 5. We modify this to 00000 111111 0 1 (spaces added for clarity.)

Also, if there is no n1 requirement, then the string must be all zeros or all ones.

Problem F - Solution## Problem G

Problem G - TutorialSolution 1 (even/odd walk):

Since we shouldn't walk to adjacent numbers, let's walk along all even and all odd numbers. In general, our walk is going to start with [2, 4, 6, 8, ...] and end with [..., 7, 5, 3, 1], and we just need to handle what happens in between. We can deal with this based on cases where n is even or odd.

Solution 2 (reduce by 5):

Look at the sequence [ 1 4 2 5 3 ][ 6 9 7 10 8 ][ 11 ... ] ( brackets added for clarity ). It repeats every 5 terms. If N is very big, we could write a group of 5 terms in this way first, reducing the problem to a problem about N — 5. Afterwards, it remains to just handle N <= 8 individually.

Problem G - SolutionIn E you could also check if any window on this array sums up to

`a[i]`

. Sliding window works for`O(n)`

, so the total time complexity would be`O(n*n)`

and no additional memory needed, except for the array itself.P.S. Okay, I didn't see that you use only

`O(n)`

memory, so nevermind, your solution is better.Thank you so much，mogul!

For G you can reduce by 4 and then handle 3 cases

I think simplest solution is starting with length==4 and then add odd numbers to the left, and even to the right until the wanted size is reached.

Thank you!

Really concise and to-the-point editorial.

I loved Problem G! It reminded me of one of my favorite problems on Codeforces: 24 Game

Hi everyone! I uploaded screencast of this contest by this link (Solved all problems in 48 minutes!).

Hey which approach in problem E would cause MLE?

I used a set to store all possible sums, which caused MLE.

Ohh then I think space complexxity with O(n^2) will cause MLE

My workaround was to only store possible sums $$$\leq max$$$ and that passed.

This solution got MLE, submitted to PyPy 3

I switched to C++ so I could use a

`bitset<8000*8000>`

instead.for all i <= n we have a_i <= n so you don't need to save sums > n.

You're right! That totally slipped my mind. I forgot that you only needed to check numbers within the array itself if they're special anyway. Good catch.

problem set was great. and I think your experiment has become successful. Today There is no Inqueue problem.

Since I was tester in this round I was not able to participate. But I used the time to write an unofficial editorial

The problems were easy but very interesting!

I think there are some problems with that. According to the prediction results of CF preidcitor, the div4 rank1 will increase 341 score after this round. So, his new rank will be 1733 (1392+341). I think it unbelievable. Maybe his new rank is too high.

Yes. this is unbelievable. By participating div2 or div3 one can be hardly rated like this. so I think Mike should change his strategy.

Yes, I think so.

If we could solve all questions in 47 mins, he definitely deserves expert

I'm just taking rank1 as an example. I mean maybe the strategy should be changed a little.

It seems that we can't view other's source after the contest?

UPD: it's ok now

I'm not sure if it's only me, but while submitting a solution I kept receiving a message saying "Unexpected error". This happened for about 5 minutes and then everything was normal again. What could be the reason?

I think it could've been div3 if one more difficult problem was added, and 1-2 current problems removed?

I don't think so Problems were relatively easier than Div3 No Graph dp or greedy.. Div3 contains at least 2 problems including such topics and hard brainstorming :)

According to me problems feel significantly easier than Div3, even F and G feel approximately the same level as an average Div3 D / Div2 C. Usually Div3 F is also fairly tricky and comparable to Div 2 D level problems.

G was Div2 B at most. Answer was trivial

how is it possible to have runtime error on c++ 11, but not on c++ 17, when someone uses only vector?

I was about 30 seconds short or else I would have officially done that last problem...

Anyways I enjoyed this round and it really for first time in life taught me that i should have good typing speed

I encourage to have more div.4 rounds

It motivated me a lot

Not satisfied with the order of problems!!!

With me, the G problem is easier than the F and E, but I couldn't solve it in time:((

The first time I solved all of the problems. What an amazing first experence to me. I'm so happy to attend this round even though I'm out of competiton.

Thanks

MikeMirzayanovfor providing such contests. Finally I have solved a problem in an online contest. Thank you for providing such contest . Also, introducing Div4. contest was an awesome initiative. Keep continuing such kind of contests.Why am I in practice mode, and how do I hack?

Good time , why my code for problem A with g++11 compiler got wrong but with g++17 got Accepted? from the begining I try to change my code and fix it , after the contest I got problem is the compiler I choose for code :(((

please help me, I'm confused :(

In my pc with compiler g++11 code worked but in website not Accepted and only with g++17 Accepted!!

It will be easy for people to help if you add link to your submission.

OK

https://mirror.codeforces.com/contest/1352/submission/79569105 this is a sample of wrong answer with g++11

https://mirror.codeforces.com/contest/1352/submission/79568929 this is a sample of Accepted with g++17

both code are same

Make your own pow() function. Hope it will work.

Thanks this approach worked. so problem is g++11 pow() precision?

As pow has return type double and you are typecasting it to integer then there might be precision loss.

Simple solution for problem G: if n<4 clearly no answer exists else first keep 3,1,4,2 in a deque and alternate appending elements between left and right. My submission link

I too used the same approach :)

I wrote a naive brute-force recursive function which seems to work fine. check this

I did not like this but simple like you. My submission

Simple solution for G again!

Put odd elements first in decreasing order then from even elements first put 4 then 2 then same order from 6 till last even element in increasing order.

Although it's div4, I still think it's very difficult. Maybe I'm too bad.

Same bro, feel you!

Did anyone else feel that the level of Div 4 was somewhat similar to Div 3? I mean, there is a noticeable difference between Div 2 and Div 3 but I don't think i can say the same about Div 3 and Div 4. (In the previous three Div 3 contests, I could comfortably solve 2 questions well within 30 mins but could only solve A and C today). Anyways, the problems were good, hope to see more such contests.

Yes even I feel the same, Last time I was able to solve 3 div3 questions but today I got struct at problem 2nd

That was because ABC of div4 had identical difficulty to ABC of div3. The difference was DEFG of div4 were same as D of div3

Why does not O(n^2) solution for E TLE? I thought they reduced constraints to keep those away, and tried to do that in LogN time. Still, 8000^2/2 is a lot of time for one second, and solution passes in 70 ms. What about cases with all 1's?

$$$O(n^2)$$$ for $$$n=8000$$$ is $$$64000000$$$ which is less than $$$10^8$$$ operations. Codeforces can comfortably handle $$$10^9$$$ basic operations in one second, so a $$$O(n^2)$$$ algorithm is safe to use.

10^9 operations take 2 seconds or more.

n*n*logn is giving tle. I checked using map. So 10^9 not possible in 1s i think.

use

`unordered_set`

instead of`map`

which will give constant O(1) time on average for element access and insertion and also would use less memory than`unordered_map`

I solved it using integer array instead of map. I was just checking whether n*n*logn passes or not.

Heyy i just saw a something unusual

When i generated a testcase of 8000 1's and fed to my program it tool

`~3.5 seconds`

and on codeforces same solution and same testcase have time of`155ms`

for solution EUPD: Now i just ran my program with -O2 command for optimization. Sorry for such noobie question

The 3.5 seconds benchmark is from your computer?

Yehh i just don't know what happended

But when i used -O2 in compilation command it reduced to

`~0.29 seconds`

I am not able to find what cause such an optimization to my byte code

Then it's not comparable. You can use codeforces custom test to make valid comparison

Thanks buddy

correct! map is a self balancing BST! so operations like searching are O(log n) and for inserting its O(log n + balancing time). unordered_map is a hash table so average search time is O(1) , worst time could be O(N) if collision occurs in hashing data.

PS: if anyone could explain me about balancing time of BST.

To explain balancing of BST a few tree is necessary to draw. The BST are generated in such a way that it has equal left and right child. So that searching complexity is always log(n). For this purpose tree may need to be rotated after insertion of value.

You better search google for more explanation using graph. Red black tree is one of the self balancing BST.

thanks! I have recently started with trees and graphs.I ll try to search it and learn more!

yeah Correct, but it depends on heaviness of operation too, like modulus and division are costly for processor.So for safe limit I take 10^8.

I solved just one problem. It was still fun because I could finally read the problem statements and know what was expected of me. I hope to get better in the upcoming rounds

A very cool round. Keep the good work going, Codeforces administration team.

Nice problem set

Screencast of this round. Click here , I was able to solve upto F.

Congratulations. I would have probably solved problem F had the contest duration been 2:15 hours instead of 2:00 hours.

I doubt,that one test included n=0

I'm talking about last problem

Why do you think so? Constraints says n>=2

Because I tested it for all 2<=n<=1000,there was no problem. then I tested it on test n=0 which gave me runtime error. Verdict was also runtime error.

You are using a for loop until i<=ans.size(). It should be i<ans.size()

thanks.

Nice problems! My screencast of the round

in Chinesebilibili BV1tT4y137wS, don't forget to 一键三连!Interestingly, the Div4 seems to be harder than the first few Div3 rounds (although Div3s are relatively harder now). Do you have the same feeling?

i request you to screencast in english that will help lots of people who don't know chinese.

You see, there are some other English screencasts, you can watch them. My English is not good enough to record a screencast fluently. And for the same reason as yours, I also want to help those Chinese that are not so good at English. Sorry~

Could someone try and hack my D? PS : I think the worst case is with 200 test cases each having 1000 elements. Also I didn't use 2 pointers, and it is most possibly O(n^2) per test case.

Can you show a link to your solution, thanks

Link

It's seem like you used 2 pointers.

N2 is due to building the remaining vector again after removing some elements I believe, eg. For case when we always take 1 element every single turn

I tried hacking it with 200 testcases and each testcase with 1000 elements such that each time only one element will be chosen by either of them. It worked fine or I wrote the generator wrong.

Your solution in worst case loops (n*(n+1))/2 times. that is (1000*500) = 5e5 for each testcase which means 1e8 for 200 testcases and I guess 2 sec is enough for that.

Yep, seems right!

Looks like,worst case for your solution is T=200,where every case is - "1000 1 3 5 7 ..... 6 4 2". This is working in 421ms.

Yep me too and i think test 3 of cf is the same too.

This round was super frustrating for me! I've been putting a ton of hrs to get better at CP (DP, Graphs, Fenwick tree, strings..). But then I face problems like B or C where I don't really know how to tackle those, and there are Math formulas that I'm simply missing. :( Any suggestions on how to improve for those kind of problems. Thank you.

Do not try hard stuff. Just try to solve A and B more and more (to decrease the time) then gradually move to C, then only you have to learn some algorithms and data structures that you can easily find in tutorials also.

I have never learned Fenwick tree. I think what you claim to know is more or less everything needed to get to Div1. Just try to solve problems from the actual rounds.

wow spookywooky becomes tester(cyan as well XDXD #worst year \ (•◡•) /)

Can somebody explain why this solution to problem E is getting TLED ?? 79579514 it runs I think within 1 sec locally.

Use vector instead of maps, and do not

`mp = mp1;`

instead do`mp.swap(mp1)`

Hey guys, I'm curious about the solution of Question E.

You can actually exhaust all intervals in the array and compute all possible special numbers and got AC. How could O(N^2) solution with N<=8000 pass 1000ms?

The O(n^2) solution is accepted. Because the server can do 10 million operations in a second

Isn't the square root of 10 million around 3150? I actually gave up the O(N^2) solution and didn't submit anything for E because I thought it would have TLE, turn out it's acceptable...

Just try it. There are only +/- operations so that the server can do more operations in a second.

Because for n=8000, n*n=6.4*10^7 and 10^8 iteration can easily pass on 1000ms

But, the overall time complexity is around T*N*N = 10^3 * 8*10^3 * 8*10^3 which is crossing even 10^10 shouldn't get TLE on that?

It is guaranteed that the sum of the values of n for all test cases in the input does not exceed 8000.So t*n will be at most 8000 and t*n*n=8000*n which will never cross 6.4*10^7

N^2 turns out to 64000000 < 10^8 which roughly takes 1000ms

div 4 was a great round

Here is a video solution to this contest: https://www.youtube.com/watch?v=w11pV4hPCxE

MikeMirzayanov, I want you to take action against them. Look at their submission for problem G. https://mirror.codeforces.com/contest/1352/submission/79508238 and https://mirror.codeforces.com/contest/1352/submission/79550067. Two submissions are almost identical. They also got hacked in problem A with almost identical code. They might share code as they are classmate!

Their rating table is almost identical.

Не могу сдать решение задачи F Восстановление 01-строки на Паскале (на пример посылка №79588069) . При проверке и запуске на сайте программа останавливается при вводе тройки данных "2 0 0". Переставлял эту тройку данных внутри теста — далее её не идёт вывод ответа. На своём компьютере получаю верный ответ 000.

здоровья Вам и Вашему дельфину!

It is really really helpful.. please increase the frequency of such contests bcz it boosts the confidence of new comers .

Finally a good contest... It will definitely boost our(newbie) confidence.

Hey, codeforces if you are listening we need more contest like this...

Have we got a conclusion that the server works ok and there will not be a long queue problem?

Reading through Mike's post and comments here I really appreciate all the efforts he is putting into trying to make codeforces more inclusive. Added to that how quickly codeforces acted on the changing of its growing community.

@MikeMirzayanov Hi Mike. Please see this when you have time. https://mirror.codeforces.com/blog/entry/59228#comment-428171

I knew it will happen like this. And I'm sure div 5 is comming.

I just want to say this.. Please include better sample cases for upto B problems if possible. (The sample test cases missed out on couple of crucial edge cases and had me running for it for an hour)

The problem D has good sample cases and I do not see why it would hurt to include a couple of testcases for the easier problems (logic wise)

Its hard to debug an easier problem with too many edge cases as intuitively it feels too correct.

(Just leaving my thoughts as implied in the blog)

is this contest not rated? Because it is written Contest finished but rating is not updated

Updated now.

Please be patient. System has to catch cheaters after the contest, which requires time.

I used ideone for my submissions. As I am new to competitive programing, I was unaware of the fact that ideone makes our code public.Apparenty someone stole my codes and used for submissions. Now I am receiving a message from codeforces that my account may be blocked. Please help.

Do not use ideone again.You must keep your code private.

Maybe I find a bug in the rating calculating..?

yet_another_ATS was -18 before this round.

But in the contest rating change page,he is 100 → 994,+894.

And in his homepage,he is -18 → 994,+1012.

What's wrong? MikeMirzayanov

It seems that for participants with rating lower than 100, during rating calculation they are considered 100.

MikeMirzayanov Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating with unsporting behavior. To qualify as a trusted participants of the fourth division, you must:

take part in at least two rated rounds(and solve at least one problem in each of them),still many new account gain +300 rating is this is bug or contest is rated for new account.

This contest is rated for new account.

then u don't think this is unfair for many expert and specialist... in this contest new account gain 100-300 rating.

future : div4 ==> fake(new) account contest

well,there may be some new pupils and newbies,so i think it's necessary for div.4 rounds to be rated for new accounts.

anyway no one can stop the high-rated ones using new accounts xd

well i think differently this contest is rating for div4 (<1400) it should be unrated for new account or new account rating should be dropped from 1500 to somewhere 1000-1300

oh,this may be a good idea.

after calculating the rating change,for unrated ones,their rating can't go up but only go down.if they go up,just ignore the change and let the account be 1500,specialist

They will be not in official standing but rating will be changed for everyone who has rating less 1400 and who is unrated no matter he is trusted or not.

5000+fake accounts this time:(

The round was rated only for people having rating 1400 below ,,,, The max rating gain is +365 ,,, Which means the person's rating went above across 2 divisions!!! Is that a fair thing ? Im not sure though ,,, maybe it is ,, maybe it isnt !

Hey, pls check the rating changes, there is a bug. The participants whose rating was 1500 got an increase in the ratings.

For those participants, this contest was their first codeforces contest. The initial rating of a new participant (unrated user) is 1500. That's why their rating has been changed.

Users who have created new account, and have got top ranks in this contest, have got a huge increment in their ratings. Their final rating is more than 1800. This is because their initial rating is already 1500. This is not fair, I guess. To handle this situation, the new participants in Div. 4 contests may have less initial rating (around 1400), rather than 1500.

So far the only people I have seen complaining about this are cyans and low experts. Coincidence? I think not.

First of all, I would like to add that even I could have created a new account and according to my ranking, I could have easily got a rating much higher than what I currently have. But it's unethical.

Instead, It is just the true and fair spirit that we are trying to promote. Hope it clears the whole point.

Hi Mike! I have a question for you: will you do another div4 contest or this was the only one? Thanks! Luci

ok, bad idea(

Thanks mike! ,for this Div.4 round...I had lost my confidence somewhere but now after giving this round it has come back...I want to see more numbers of Div.3 or Div.4 rounds so that we can move one step forward in this journey of competitive pragramming. once again thanks mike and all other helpers to prepare this rounds....it was great idea.

Could someone explain in the example for problem E why the answer is 4 if n=8 and a=[8,7,6,5,4,3,2,1]? Isn't the answer supposed to be zero?

It isn't because

What does

D3A-D3Dmean?This refers to a typical difficulty of problems in Div3 contest given as problems A to D. ie not very difficult problems.

will there be any more div 4 rounds?