By MikeMirzayanov, history, 20 months ago, translation, ,

Hello, my dear Codeforcers!

Technocup is the olympiad for Russian-speaking highschool children. The winners will get significant benefits to enroll at Russian universities.

But it become open for everyone! Even if you are not a Russian-speaking highschool children, you can register for unofficial (out-of-olympiad) participation. The problems will be translated to English.

The contest starts on October 15, 09:05 (UTC). It will contain 6 problem to solve.

It will be rated round for:

• official Technocup participants
• unofficial participants from Div. 2

The contest will be hosted according Codeforcers rules.

UPD 1: The scoring is 1000-1000-1500-1500-2500-3000.

•
• +92
•

 » 20 months ago, # |   +14 Would the problems be in English ?
•  » » 20 months ago, # ^ |   +13 They will be in Russian and in English.
•  » » » 20 months ago, # ^ |   0 Ok,Thanks
 » 20 months ago, # |   +93 3 Div.2 only Contests in 3 Days O_O
 » 20 months ago, # |   0 Bad luck for Bangladeshi contestants ! We will miss it, because we have ACM-ICPC Preliminary Contest starting at the same time (3:00 PM UTC+6) today! Missing a CF round is very painful to me. But wish to participate in this round virtually, as there is no alternative.
•  » » 20 months ago, # ^ |   +16 I'm sure you will survive! ;)
 » 20 months ago, # |   +13 What will be the difficulty of the problems like?
 » 20 months ago, # |   +8 Almost missed this round since there was no notification yesterday. hope I won't do so bad at this very unusual time.
 » 20 months ago, # |   -21 unusual round with unusual time
 » 20 months ago, # |   -16 Rated ?
•  » » 20 months ago, # ^ |   0 only for div2
 » 20 months ago, # |   0 I am new here.How much rating is div1/div2?
•  » » 20 months ago, # ^ |   0 div2 ]-INF,1900[ div1 [1900,+INF[
•  » » » 20 months ago, # ^ |   0 Thanks.
 » 20 months ago, # |   0 Thanks
 » 20 months ago, # |   -17 Looks like there'll be no trivial problems : 1000-1000-1500-1500-2500-3000
 » 20 months ago, # |   -22 I am really happy because we have so many rounds in few days. Thanks !But when I saw in description of the task that is interactive + looked at inputs in the second and fourth problem, my wish for doing round dissapeared :(
 » 20 months ago, # |   +3 I've got my D running on pretest 3 for about ten minutesCan anybody tell me what's wrong with this?
•  » » 20 months ago, # ^ |   0 Can you tell me where to see the solutions of each round?
 » 20 months ago, # |   +3 What was pretest 4 on problem B?
•  » » 20 months ago, # ^ |   0 I think something like:a0.50a0.50answer is just 1, you shouldn't print 1.00
•  » » » 20 months ago, # ^ |   +4 I am sure this is not the pretest since my code accounts for this
•  » » » » 20 months ago, # ^ |   0 Maybe a999.999b0.01c0.99?
•  » » » » » 20 months ago, # ^ |   0 This is not it either
•  » » » » » » 20 months ago, # ^ |   0 for me , a case when answer is 1 not 1.00 worked for getting past test case 4 .
•  » » » » 20 months ago, # ^ |   +13 well, in this kind of problems you never know where the WA comes from :(
•  » » 20 months ago, # ^ |   0 how about a13.523.532.01b0.98c0.01
•  » » 20 months ago, # ^ | ← Rev. 2 →   0 I got this pretest working after I changed int to long long. This stupid mistake took so much time and score from me...
•  » » » 20 months ago, # ^ |   0 I did the same mistake and I didn't get blue because of that :C Well better luck next time :D
 » 20 months ago, # | ← Rev. 3 →   +25 Problem B was unusually horrible ;[Even #passed C is greater than #passed B...
•  » » 20 months ago, # ^ |   +12 I Agree, but for some reason I thought it was easier than A and thus tried to solve it first.
 » 20 months ago, # |   +3 Is D completely greedy?
•  » » 20 months ago, # ^ |   +6 Yep!
•  » » 20 months ago, # ^ | ← Rev. 2 →   0 matching problem but can be solved greedyN=1e5 so greedy is safer to code
•  » » » 20 months ago, # ^ | ← Rev. 2 →   +6 <_< I stupidly forgot about the bound that preference will be adjacent sizes so I actually did max flow. You only need ~50 nodes for your max flow though, because you can group together people with the same preference specification.
•  » » » » 20 months ago, # ^ |   0 I struggled for quite a time but still couldn't understand the greedy algorithm. I am more stupid as I didn't notice the "neighboring" constraint until reading you comment T_T
•  » » » » » 17 months ago, # ^ |   0 How do we construct a network small enough for a flow algorithm to pass the time limit?
 » 20 months ago, # |   0 Problem E Pretest 5:Anti Hash?
•  » » 20 months ago, # ^ | ← Rev. 2 →   0 Do you pass this test: 3 1 aba 4 a b c d 
•  » » » 20 months ago, # ^ |   +1 Seems like i have tendency to miss the statement given in bolds.
 » 20 months ago, # |   0 I dont know the answer to problem D. please tell me the approach. I thought it like putting shirts which are sure over and over again.And after the contest I read prob F, and is it greedy???
•  » » 20 months ago, # ^ | ← Rev. 2 →   0 i used dp but did not code it
•  » » 20 months ago, # ^ |   -21 Sort the people by their tshirt choices sizes . Say you want to assign x "S" tshirts , you greedily assign them to people with only one choice . If you cant the answer is NO . Next assign tshirts to people with one of the choices as "S" . After that remove "S" from the choices of people who havent been assigned any tshirt yet . Similarly for other tshirt sizes .
•  » » 20 months ago, # ^ |   0 Problem D: assign T-shirts for participants with only one size first. Then sort the remaining participants by size, always try to give them a smaller T-shirt if possible, bigger one otherwise. If any of the counts for remaining T-shirts in negative, print "NO".
•  » » » 20 months ago, # ^ |   0 a sample code please?&& and also is F greedy?
•  » » » » 20 months ago, # ^ |   0 Sorry, I couldn't solve F.My C# Code for D (as submitted, added some comments): Codeusing System; using System.Linq; using System.Collections.Generic; class Solution { static void Main(string[] args) { int[] nums = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray (); int n = int.Parse (Console.ReadLine ()); List shirts = new List(new string[] { "S", "M", "L", "XL", "XXL", "XXXL" }); string[] take = new string[n]; Dictionary allow = new Dictionary (); //participant number, index of smaller allowed t-shirt for (int i = 0; i < n; i++) { string str = Console.ReadLine (); if (!str.Contains (",")) { //only one t-shirt fits take [i] = str; nums [shirts.IndexOf (str)]--; } else { //two fitting t-shirts str = str.Substring (0, str.IndexOf (",")); allow [i] = shirts.IndexOf (str); } } List> myList = allow.ToList(); //sort participants by t-shirt size myList.Sort( delegate(KeyValuePair pair1, KeyValuePair pair2) { return pair1.Value.CompareTo(pair2.Value); } ); foreach (KeyValuePair pair in myList) { //for each participant with two sizes if (nums [pair.Value] > 0) { //try to assign smaller one nums [pair.Value]--; take [pair.Key] = shirts [pair.Value]; } else { //assign bigger one if (pair.Value == 5) { //well, that should actually never happen Console.WriteLine ("NO"); return; } nums [pair.Value + 1]--;//assign bigger one take [pair.Key] = shirts [pair.Value + 1]; } } if (nums.Any (num => num < 0)) { //did I assign a t-shirt size more often than allowed? Console.WriteLine ("NO"); return; } Console.WriteLine ("YES"); foreach (string s in take) Console.WriteLine (s); } } 
•  » » » 17 months ago, # ^ |   0 Why is this correct?
•  » » » » 17 months ago, # ^ |   0 assign T-shirts for participants with only one size first You can't do anything wrong in this step, so it should be obvious, that this is correct. Then sort the remaining participants by size, always try to give them a smaller T-shirt if possible, bigger one otherwise. I should clarify, that I start with the contestants having the smallest size. So, if I have T-shirt S and M (one each), participants S/M and M/L, then I assign the S T-shirt to the S/M participant. If I would not do that, noone else would have use for the T-shirt. So, if I assign it in this step, I can't break anything. There might be some more participants with the same size, but not enough T-shirts of the lower size, so these get a larger one (if they wouldn't, there would be no way to give them any T-shirt). Now we have handled all participants with the smallest size. We can go one with the next bigger size, that works in the same way as the previous one. If any of the counts for remaining T-shirts is negative, print "NO". That means, that I assigned more T-shirts of a size than possible. That obvoisly doesn't work.One could solve that problem with a max-flow algorithm too, but it would be quite overkill.
•  » » » » » 17 months ago, # ^ |   0 Well, that's good enough to me... Thanks!One more question: how do we construct a flow network small enough to Edmonds-Karp fit the time limit?
•  » » » » » » 17 months ago, # ^ | ← Rev. 3 →   0 The graph is actually quite small: you have vertices for each T-shirt size as well as each participant type (2*sizes-1 types here). Two more vertices (source and sink), that's all. The edges are the capacities (from source to participant: count of participants of that type, from t-shirt to sink: count of t-shirts). Numbers are random, change them depending on the testcase:
 » 20 months ago, # |   +21 I hate tasks like B . C and D were way easier . I wish I'd read D before B :(
•  » » 20 months ago, # ^ |   -8 B took lot of time. F was not that hard either. I needed some more time for F.
 » 20 months ago, # |   0 How to solve E ?? without hashing
•  » » 20 months ago, # ^ |   +21 Aho–Corasick algorithm
•  » » » 20 months ago, # ^ |   0 can you please explain your approach ?
•  » » » » 20 months ago, # ^ | ← Rev. 3 →   0 I haven't coded it yet, but it should be something like this. Build the aho-corasick tree. Build an array, mark the possible "jumps" for each position. This can be done by searching the CD through the aho-corasick tree. (You can handle the name that goes cyclic by extending the string) Also check if it is possible to reach that position. For position i
•  » » 20 months ago, # ^ | ← Rev. 2 →   0 Maybe Suffix-Array. Use Binary-Search to match all the names of the game to the string on the CD. Then find some positions which can make the string on the CD filled by these names.
•  » » 20 months ago, # ^ |   0 I thought so: take the text, copied it, and just tested an array of names in the copy text. I copied to remove him from the proven results, and in the original took position. Separately tested variant with the transfer.
 » 20 months ago, # |   -6 I did that stupid mistake str.size() — 3 and leading to integer underflow issue.But can anyone explain why this happens? is integer underflow also compiler dependent? o.O This code http://ideone.com/QU5GRm doesn't work as on ideone on my system?
•  » » 20 months ago, # ^ |   +8 This is unsigned integer (not unsigned int though) overflow, meaning that it is defined. The thing is that string::size() is of type size_t which depends on the platform. On your computer it is stored in 64 bits, on ideone it is stored in 32 bits — http://stackoverflow.com/questions/1119370/where-do-i-find-the-definition-of-size-t.
•  » » » 20 months ago, # ^ |   0 Thanks i get it now. The value 184467440.. also overflows when assigned to (signed) long leading to negative value -1 in my system.
•  » » 20 months ago, # ^ |   +4 str.size() returns an unsigned integer. Always use (int)str.size().
•  » » 20 months ago, # ^ | ← Rev. 2 →   +9 This might helpFunny Bug
 » 20 months ago, # |   +3 Approach for problem D?
•  » » 20 months ago, # ^ |   -8
 » 20 months ago, # | ← Rev. 2 →   +6 F hack test: 3 1 -6 -3 -3 6 Answer: 1
 » 20 months ago, # |   +8 Any ideas why one could get WA50 on E?
•  » » 19 months ago, # ^ |   0 Assuming you're using a hash-based solution, I think that test case makes a bunch of games' hashes collide, so that if you try to keep a map "hash -> game", it won't work: this would have to be a multimap, since several games can hash to the same value. To solve this problem, I used two different hash functions.
 » 20 months ago, # |   0 What's the intended complexity for F?
•  » » 20 months ago, # ^ |   0 We have proven complexity and unproven O(m + n2).
•  » » » 20 months ago, # ^ | ← Rev. 2 →   +24 Isn't my O(n2 + m) DP trivial (and trivial to prove correctness)?Maybe I'm missing something?Edit: I have missed factor so the correct complexity of my implementation is . (integer sorting can be used to get O(n2 + m) (under reasonable bounds of values and on a reasonable model), though).
•  » » » » 20 months ago, # ^ |   +11 It is great. Please write it!
•  » » » » » 20 months ago, # ^ | ← Rev. 2 →   +16 dp(i, r) is the minimum possible non-negative value you can start with at position i and go till position n, removing at most r elements, such that the value never drops below 0. Complexity of this step is O(n^2). For a given query b, you can use binary search on the number of elements r you need to remove, using dp(1, r). I have used 1-indexing. Complexity of this step is O(m*logn). Total complexity is O(n^2 + m*logn).Code
•  » » 20 months ago, # ^ |   +5 Using a greedy algorithm, the complexity will be O(n^2 * log n * log m), which also gets accepted. 21472657
 » 20 months ago, # |   +96 Rating changes for unofficial Div2 participants ?
 » 20 months ago, # |   +1 Problem D: http://codeforces.com/contest/727/submission/21454057 when i run same code on my system i am getting correct output :(
•  » » 20 months ago, # ^ |   +1 check ur ans on online ide. here
 » 20 months ago, # |   +12 Anyone else cannot find their name in the standings although they participated?
•  » » 20 months ago, # ^ |   0 Are you sure you are checking the unofficial standings?
•  » » 20 months ago, # ^ |   0 Mark the checkbox "Show unofficial".
 » 20 months ago, # |   0 WTF !!! This is bullshit , where's the rating change for div2 !!!!!
 » 20 months ago, # |   +7 That feel when you fail the round but still improve your rating and become blue. https://www.youtube.com/watch?v=BinWA0EenDY
 » 20 months ago, # | ← Rev. 2 →   +17 .
 » 20 months ago, # |   +4 Waiting for div. 2 rating changes!
 » 20 months ago, # |   +2 Is the rating updated? I'm from div.2 and was not rated.
•  » » 20 months ago, # ^ |   +2 Me too...
•  » » » 20 months ago, # ^ |   0 is the round gonna be rated for Unofficial Div.2
 » 20 months ago, # |   +3 I am an unofficial div 2 participant and my rating stays the same after rating change. Can someone explain?
•  » » 20 months ago, # ^ | ← Rev. 2 →   +1 for all unofficial div.2 participants still doesn't change.I think rating change in this round will be in two part for us and for officially participants separately.
•  » » 20 months ago, # ^ |   0 That's a common problem for DIV2 unofficial participants
•  » » 20 months ago, # ^ |   0 Ratings haven't been updated yet.
•  » » 20 months ago, # ^ |   +40 It will be updated soon.
 » 20 months ago, # | ← Rev. 2 →   +4 thanks for clearing!
 » 20 months ago, # |   +4 Hi. Could someone please clarify who will have ratings changes for this round? It appears that all those who were official participants have had ratings changes, unlike what was said — that it will be rated for div 2 and official participants are Russian school students. If it is clarified, it will be great!
 » 20 months ago, # |   -17 This is the best comment I read :D
 » 20 months ago, # |   0 What about the editorials ? there will be editorials like regular CF rounds ?
•  » » 20 months ago, # ^ |   0 Of course, there were editorials for the previous Technocup.
 » 20 months ago, # |   0 Rating changes are weird for unofficial participants . In usual rounds any rank < 300 fetched me a positive rating change , today even a rank of 177 fetched me negative change o.O
•  » » 20 months ago, # ^ |   0 It depends on different things like number of participants and your own rating ! (AFAIK)If an expert is ranked X and a newbie ranked X too .. the newbie's rank will increase more than the expert's .(if am wrong please correct me :) tnx )
•  » » 20 months ago, # ^ |   0 That's because number of users were much lesser today.
 » 20 months ago, # |   +6 In problem D, flow worked. Constraints were not tight.
•  » » 20 months ago, # ^ | ← Rev. 2 →   0 Do you mean to say that the test cases are weak. Or your algorithm worked in linear time? As far as I know max flow works in O(E*V^2).
 » 20 months ago, # |   +1 Why didn't I get any rating changes? (I registered during the contest)
•  » » 20 months ago, # ^ |   0 the same here
•  » » » 20 months ago, # ^ |   0 Do you registered during the contest as well?
•  » » » » 20 months ago, # ^ |   -6 My rating hasn't changed 1 hour ago, but now it has changed . Sorry for my sorry English.
•  » » » » » 20 months ago, # ^ |   0 Still didn't get any rating update.
•  » » » » 20 months ago, # ^ |   0 yes
 » 20 months ago, # |   +48 Achievement unlocked! Gotta change my handle now!
•  » » 20 months ago, # ^ |   0 I was so close to rain on your parade :D
•  » » » 20 months ago, # ^ |   +8 The same way you were so close not to be so close "to rain on my parade" :D
 » 20 months ago, # |   0 I see that some div2 participants have their rating changed after the contest. But still no change for me :( ?
•  » » 20 months ago, # ^ |   0 same here.
•  » » 20 months ago, # ^ |   0 Thats weird.
•  » » » 20 months ago, # ^ |   0 I thought that with other div2 participants my rating will also be updated but it didn't happen.
 » 20 months ago, # |   +1 where is the editorial ?
 » 20 months ago, # |   0 problem E. I have written hash as described here but failed on 14 test. What is wrong? It is not good approach here or should I search bag in my code?
 » 20 months ago, # |   0 Is there any python solution passed for D ? my Python code got TLE, it's frustrating when you have to rewrite the same code with another language to get accepted.
 » 20 months ago, # |   0 Would someone mind help take a look at this code for Div2F? It seems to over-estimates the answer but I don't know why.http://codeforces.com/contest/727/submission/21475250Logic: Solve the queries offline, answer them in non-increasing oreder as the solutions are monotonic. Always keep the minimum prefix sum, whenever the guessed mood is not sufficient to compensate the prefix sum, keep removing the worst quality question from the array and increase the counter by one.
•  » » 19 months ago, # ^ |   0 Removing the worst isn't optimal. We should remove the one that maximizes the minimum of new prefix sum. 3 1 -2 2 -3 1 
 » 20 months ago, # |   0 When will the editorial be posted?
•  » » 20 months ago, # ^ |   +6 It is already posted (and translated, as the Russian version was available before the English one)http://codeforces.com/blog/entry/47773
•  » » » 20 months ago, # ^ |   0 How did u know that it was posted ? I log in daily and didn't notice it in "Recent actions" section !
•  » » » » 20 months ago, # ^ |   0 I guess it was posted in recent actions, though I am learning Russian and sometimes I go to Russian version of the website (maybe it was only posted there and then I changed the language to English — as I know less Russian than a 5 year old kid. I don't know how blogposts work, but I saw it in recent actions).
 » 20 months ago, # | ← Rev. 6 →   0 :(
•  » » 20 months ago, # ^ |   0 tfw you misread the problem statement and overthought it.
•  » » » 20 months ago, # ^ |   0 YES, i realized it :(
 » 19 months ago, # |   0 If someone have missed editorial, it is there.
 » 19 months ago, # |   0 Would it be a rated contest?
•  » » 19 months ago, # ^ |   0 We are planning to run TechnoCup Elimination 2 as rated contest for at least D2.