By the way, this contest round number is 445, and this contest ID is 890 in Div.2 one. (889 in Div.1) Finally, Codeforces achieved to a host y = 2x round. (Let y be the contest ID, let x be the round number)

i got very low score because I had to wait more than 30 minutes to submit A and B. There's no way it can be fair at this point. Within that 30 minutes, there can be huge differences in ranking if order of submitting is different for everyone.

"anyone who submitted after it can have their time penalty adjusted to what it would be as if no issues occurred" How would one know what this adjustment should be? I understand you had a good contest, doesn't mean it was fair for the others, man.

The adjustment should be the amount of the the site was down for. It's not as if some people were only unable to access the site for 5 minutes, it was the same for everyone. As for some people not being able to see problem statements, I've already accepted that is a grey area in which some people were affected more than others. That is something the contest runners will have to decide upon. But if we're simply talking about time penalties, then yes, it can be adjusted fairly for everyone.

The first point can't be solved either. Say the servers went down at time t. Someone may have solved a problem at time t + 5 and had been wanting to submit his code, but only got to submit it at t + 30 (when the servers were back up). However, he would receive a score equal to someone who solved it at t + 25, and submitted at t + 30, by your logic. And there were others like me who stopped the contest assuming it would be unrated for sure (as it was only natural to assume so).

Further we can extend the issue, someone see a new problem at t=x-1 and starts solving and submits at t=x+31. No problem. But if someone wants to see the new problem after that, he will have to wait till t+31.

let's take into account that many of us left the coding arena when the site was not working only to come back later to find out that contest was extended. it's not fair at all to make this contest rated.

Codeforces Should Really Buy A New Server To Work When The Current One Is 502. Codeforces Should Really Buy A New Judger As An Alternative For The Stuck Judge System In The Contest. Codeforces Should Really Buy A New Set Of Problems In Compensate For Several Unrated Problems These Days.

You can't just extend 30 minutes and say it's rated. What about all those people who left in the middle of the contest to do something else? What about the people who solved the problem at the beginning of the downtime interval vs. at the end, are they all the same?

Sh*t. I opened movie when CF servers gone down, and then my friend told me they are back, then wrote something for B and it is hacked now by Um_nik. Now I have to do binary search on movie for finding where I was. Really sh*t.

In my opinion, greedy algorithm can be a fine approach. I used an array (I'll name it A): element with index i is used to store the index of the room which was last visited in minute i. (if this room is visited again in the future, the value of this element is changed back to 0).

Then I did a linear check over all numbers in the notebook:

Assume that the number written in minute i is x. If there was a room which was last visited in minute x, we could assume that that room is visited again in minute i (it's the easiest way to handle without adding new rooms). Assign A[x] to A[i], then assign 0 to A[x]. Otherwise, since no room was last visited (until minute i) in minute x, the man must have enter a new room. Increase the room count by 1, and assign the index of the new room to A[i].

Hope this will help. And sorry if my expressions could be complex though...

dp[i] — How many [i] permutations exists, where last element is i and will return correct maximal value.

dpsum[i] — How many [i] permutations exists, where element i is in one of the last k positions and algorithm returns correct maximal value.

Then we can calculate these functions in linear time:

To calculate dp[i] we simply append i to the end of all the [i-1] permutations, where i - 1 is located in one of the last k positions and algorithm will return correct maximum value.

dp[i] = dpsum[i - 1]

To calculate dpsum[i] we must remove all permutations, where maximum value will be located outside the last k elements of permutation from dpsum[i - 1]. Then append new element to the end of permutation, it must be less than previous maximum value. So multiplying by (i - 1) we add this new element and increase all larger, equal permutation element values by one, so we get [i] permutations, where i is located in range [i - k + 1, i - 1]. Lastly, we must append all permutations which have maximal value i in the last position of [i] permutation, we calculated it in dp[i].

Then we can calculate the number of all good permutations, where correct maximum value is returned by algorithm.

Lets fix position i, where maximum value n will be located. Then first i element prefix of permutation must return correct maximal value and maximal element is in the last position of permutation formed by prefix, so we use dp[i]. We choose order of last n - i elements in (n - i)! ways. Suffix of last (n - i) elements forms a permutation.

Then we must merge these two permutations together by merging all elements except maximal n together. This can be done in ways.

Then the number of bad permutation is count of all [n] permutations minus good permutation count;

Hi, I submitted A (incorrectly) just before the website crashed, and I had to waste about half an hour waiting for it to come back on. As a result, my A was submitted 30 minutes later than it should have been, and my rating will likely fall is a result. Can this contest be unrated for me?

it was not bad really . problem were pretty clear and pretests were not too weak . i was busy coding div1 B for almost the whole contest so i didnt get that gateway error at all ! however hacking was almost impossible

I was unable to hack in the last 6-7 minutes, but still, let's not make the round unrated. Even the last rated round was unrated. Looks like, system issues are becoming rather common, so this way, who know when we'll have an actual rated round. Please don't make it unrated.

I thought of the same thing (you're using the fact that X halves or stays the same at each step)? You can also do something like: "if (a[i] <= a[i + 1]) delete a[i + 1] and increase the coefficient of a[i] by 1" and you get a decreasing array, with some extra coefficients. Still not very useful though:(

We will construct a permutation that has the following structure: Starting with a values, then place the value, namely false_max, that will be the answer of fast_max() procedure, then k values after that, then the rest of the number. Note that the first a + k + 1 elements in this array will be <= false_max. The number of choices can be decomposed into:

its actually not (a+k)!, since in the first a numbers there must be no k consecutive decreasing values, otherwise you will stop at them and not reach the a+1th value.

to calculate this number, let dp[i] be the number of ways to permute first i numbers such that no k are increasing. dp[i]=(dp[i-1]/(i-1)!+dp[i-2]/(i-2)!+...+dp[i-k]/(i-k)!)*(i-1)! (i is from n-k to n-1)

Let's find dp[n]. Obviously, you can place the number n only in the last k spots, otherwise you would have more then k numbers smaller then n after n. Lets say you place number n at position i (so you have i numbers, then n, then n-i-1 numbers) (n-k<=i<=n-1). The first i numbers also have to respect the condition (of no k decreasing consecutive numbers), so there are dp[i] ways of arranging them. Also, there are C(n-1,i) number of ways of choosing the first i numbers out of the n-1 other numbers. We can arrange the last n-i-1 numbers in any way, since n will be bigger then all of them, so there are (n-i-1)! ways. Final formula:

dp[n]=sum(dp[i]*C(n-1,i)*(n-i-1)!)=sum(dp[i]*(n-1)!/i!)=(n-1)!*sum(dp[i]/i!), where i is from n-k to n-1

Well i couldn't solve Div 2 D but here are some of the things that i had thought of during the contest. If someone has solved with similar assumptions then please help in how to construct a solution from here.

final answer will contain each character once so length <=26

if any of the input string and all its sub strings are disjoint from the other strings or their substrings then we don't have to worry about it and can simply append it to the answer.

(The hard part and from here im blank) I need to find a way such that an input string joins at the either of the ends of another string or merges in the middle. final answer will be this string along with the disjoint strings appended.

Can anyone help me create a solution from here or if my assumptions are wrong then point em out please? Thanks :)

Here's how I did it (With the same assumptions as you did): - Put in all the strings in a set S. - If any string has a repeating character, print NO(since this character will have more counts than the entire string). - For every character c in the alphabet, do the following: Make a set of all strings that contain this letter, say T, and while the size of this set is larger than 1, pick two strings from this set, merge them, and insert result in the set S. (Remove the original strings from S and T) If it is not possible to merge any two strings, then print NO (because the final answer has any character appearing atmost once.) To merge any two strings, check the prefix and suffix from c's position in the two strings. - Finally, you have only disjoint strings remaining in the set S. Concatenate them lexicographically and do a final check for repeating characters.

suppose if the set is ab, ba then i can construct the string abba, in which all the substrings in the set occurs once and all occus exactly same amount of time. Also if it is kas and kad then kaskad is a good string right ?

Some of us have problem with the round being rated. Because if the server wasn't down, we could have submitted our code early. But as CF was down for approximately half an hour, we got huge penalties :( which will brutally decrease our rating. If we could submit codes just in time, our rating would not be this massacre. So please make the round unrated. :(

Construct a directed forest as follows. Nodes are letters. If one letter right after another in one of the words, then there is an edge from the first letter to the second one. There must be as most one outgoing edge and one ingoing edge on every node, otherwise answer is NO.

Tricky thing: some words have only one letter in it, one should care about that.

Once you have a valid forest, just print the letters in the order given by the forest.

Or you can just not visit the site, instead of unregistering the account altogether. As for receiving mails regarding contest announcements, you can just unsubscribe them. Is this idea that difficult to come up with?

In Div1C I needed to calculate number of permutations p1, p2, ..., pn satisfying . On Oeis it said that this is equal to the number of permutations where all cycles have size less than or equal to K. I tried proving both these conditions are equivalent but found a

Think about it this way. For your condition tu hold, the value n must within the last K positions. And you can choose the following values in ways, where is length of the suffix starting in value n. Then you have to multiply by the number of good permutations of size . That is, . This is exactly the same as choosing a cycle for element n of size at most K, and then multiplying by the number of good permutations for the remaining elements.

I'm not sure if I understood what you mean by counter test. It's true that the permutation you show should be counted as good for the problem statement, but it does not comply with the condition you mentioned.

although there where a lot of technical issues and despite that i spend more time reloading pages than the time i spend on reading problems, it was one of the greatest contests i ever participated in,thank you for your efforts it was totally worth it to participate even though it wasn't rated in the end.