### vntshh's blog

By vntshh, 3 months ago, ,

Hi Codeforces!

Programming Club, IIT Indore and Euristica 2018 are proud to present our flagship event, Divide By Zero! The contest will take place on Saturday, 7th April at 9:35PM IST.

Prizes : Codeforces T-shirts for top 15 participants overall and top 15 participants in India.

Thanks to the following people for making the round possible :

There are 8 problems, and 2.5 hours to solve them. The points distribution will be updated later.

Euristica, sponsored by Arcesium is the inaugral Programming festival of IIT Indore. It comprised of 10 events this year, spanning across various domains like Competitive Programming, Application Development, Cyber Security and Machine Learning. For more information, visit www.euristica.in .

Hope you guys enjoy the contest! See you on the leaderboard!

UPD: The scoring distribution is 500-1000-1500-2000-2250-2500-3000-3500.

UPD 2: Do give your feedback here : https://goo.gl/forms/xbsdMxnkA3XsG4092. Would love to hear your feedback, since that would help us get better!

We hope you guys enjoyed the contest and found the problems interesting.

UPD 3: You can find the editorial here.

Here are the list of winners who won Tshirts. We will contact you guys soon. Congrats!

Overall Top 15:

Top 15 in India:

•
• +316
•

 » 3 months ago, # |   0 I think it will be funny, thank you.
 » 3 months ago, # | ← Rev. 2 →   +41 First palindrome lucky round of 2018! Sounds good
 » 3 months ago, # |   +64
 » 3 months ago, # |   +32 All Divide By Zero rounds: -------------------------------------- 2013 2014 2015 2016 2017 2018
 » 3 months ago, # | ← Rev. 2 →   -54 All number is not able to divide by zero except these number 2013,2014,2015,2016,2017 and 2018.So the divisors of zero are increasing year by year. :D :D :D
 » 3 months ago, # |   +24 I hope one day i will get a T-shirt from Codeforces, I think it will be the best gift ever
•  » » 3 months ago, # ^ |   0 suppose the best gift ever will be the invitation from a good company)))
•  » » » 3 months ago, # ^ | ← Rev. 2 →   0 Yeah , it's also a good gift
 » 3 months ago, # |   -10 Hope all the problem statements will be short and Contest will be enjoyable. :) :)
 » 3 months ago, # |   -56 We have solved A & C & D of last Div.2 Round[#473] in videosWait us for more videos after contesthttps://www.youtube.com/channel/UCmWvb73kIq_oRThWd05Mtfg
•  » » 3 months ago, # ^ |   +65 You better create a blog post to invite to your channel instead of irrelevant comment here.
•  » » » 3 months ago, # ^ |   -34 It's okay , it's very good idea
•  » » 3 months ago, # ^ |   +74 I just visited your channel. You should have mentioned that your videos are in Arabic language.
•  » » » 3 months ago, # ^ |   -27 Okay, you are right.
 » 3 months ago, # |   -25 Rated？
•  » » 3 months ago, # ^ |   +15 It always is, unless stated otherwise.
 » 3 months ago, # |   +116
 » 3 months ago, # |   0 See you in the leadboard ! So let's paying for a miracle
 » 3 months ago, # |   -30 Thanks to organizers of IIT Indore , i hope i will make a great jump in my ratings.
 » 3 months ago, # |   +35 I must choose "Divide by Zero or Manchester's derby!".
 » 3 months ago, # |   -49 Should I watch IPL or participate in the contest? Help me!
•  » » 3 months ago, # ^ |   0 If you will get any help. Please share with me!
•  » » 3 months ago, # ^ |   +8 Participating in a programming contest is better than watching a 'fixed match'. I think.
•  » » 3 months ago, # ^ |   -6 I watched IPL and I regret.
 » 3 months ago, # |   +17 The problems distribution?
 » 3 months ago, # | ← Rev. 2 →   +22 What's wrong about the problem statement?
 » 3 months ago, # |   +1 Hack page is not loading for me
•  » » 3 months ago, # ^ |   +4 And me.I have just installed a plug-in that has to be an alternative of adobe flash player, but no response.Why it's not as the Educational rounds? I'm talking about the way of displaying the source code for hacking.Please MikeMirzayanov, do something for this.
•  » » » 3 months ago, # ^ |   +2 In the usual codeforces round, you cannot copy others' codes to try. It is so easy and less unseccessful hacking attempt. However, in the edu round, there is no award if you have a successful hacking attempt, therefore, you can copy it and try
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   0 OK, not bad. But isn't there another way to display the source code with that property and without depending on adobe flash player?Anyway, Thank you for the explanation.
•  » » 3 months ago, # ^ |   0 I used to face this problem on Google Chrome. Now I use Firefox for hacking, works all the time!
 » 3 months ago, # |   0 why is it so difficult to check the problem statement for the first task? can I get my hacked attempt points back?
 » 3 months ago, # | ← Rev. 2 →   -17 Initially the text in the problem did not appear properly and some confusion in problem description (A) also.
 » 3 months ago, # |   -16 could someone hack my code
 » 3 months ago, # |   +8 Will the round be rated?
 » 3 months ago, # |   +19 In my opinion, E and F are too standart, maybe they would be better for educational rounds.
 » 3 months ago, # |   -6 Thank you for the round with hacks. It was very interesting!
 » 3 months ago, # |   0 In problem C, I realized c[0] = c[1] is possible after locked..
 » 3 months ago, # |   0 How to solve D?
•  » » 3 months ago, # ^ |   0 I stored an array of shifts for each level. When type 1 query comes, increase the shift for that level by K. When type 2 query comes, increase the shift for that level by K, and also the shift for the level after by 2k, and after that 4k... to the end of the array (which will be size 63 or something to get max number of elements). When type 3 query comes, find where that node is and go up by dividing by 2. Then you just need to subtract the shifts on each level as you go up. Sample: http://codeforces.com/contest/960/submission/37077181
•  » » » 3 months ago, # ^ |   0 Okay. Thanks
 » 3 months ago, # |   0 how to solve B?
•  » » 3 months ago, # ^ |   +1 If instead of keeping ai and bi, we keep ci= | ai — bi|, then our task is to use k1+k2 operations to reduce the cost. So you'll go through the array, find the maximum and decrease the value by 1. If all the elements are 0 it means that you are in an optimal point and the way to go from here is to add 1 and then decrease 1 to the same position up until you don't have any operations left.
•  » » » 3 months ago, # ^ |   0 isn't that tle.... finding max value for n and for(k1+k2) operations
•  » » » » 3 months ago, # ^ |   0 O(1000*1000) certainly isn't TLE
•  » » » » » 3 months ago, # ^ |   0 thanks man.. i thought i had to be more analytical... i thought about calculating summation(difference) — (k1+k2).....and get a mean from it...then distribute the difference somehow equal to the mean while maintaining k1+k2 operation... it was a bad idea
•  » » » » » » 3 months ago, # ^ |   +1 Correct thinking for a long contest, but for contests that last so short, write anything that works(even though it's not optimal). Cheers
•  » » 3 months ago, # ^ |   +5 Make a priority queue of the biggest differences between a and b. You can use the greedy approach then : just reduce 1 from the biggest difference that exist (i.e. remove biggest element from pq, reduce it by 1, and add the reduced number to the priority queue)If the priority queue becomes empty while you still have attempts, the minimum result will just be number of remaining attempts modulo 2.
•  » » » 3 months ago, # ^ |   0 Why are we always reducing 1 from the biggest difference ? Why can't we reduce 1 from smaller difference ?
•  » » » » 3 months ago, # ^ |   +3 since what counts is the square from the difference, it's always the biggest one that will give the biggest reduction : the reduction of a difference d gives a reduction in total points of :d²-(d-1)²=2d-1 which is an increasing function in d (except for d=0 which is a special case), so it's always better to reduct the biggest difference first.
 » 3 months ago, # |   0 C?
•  » » 3 months ago, # ^ |   0 If you keep a sequence that is all 1's (ie 1 1 1 1 .. 1) the cost is 2^(no of 1's)-1. So you're going to find the largest k so that x>= 2^k -1 and then decrease x by 2^k -1 and add k equal values to your solution. You just have to be careful because the last k values should be larger than the others by at least D.
 » 3 months ago, # |   +5 What is the hack for C?
•  » » 3 months ago, # ^ |   0 1000000000 1 is possible
•  » » » 3 months ago, # ^ |   +1 Is there any test that it is impossible to create a desired array so the result is "-1"?I saw that there isn't any "-1" in this problem!
•  » » 3 months ago, # ^ |   0 268435356 1
•  » » 3 months ago, # ^ |   0 1000000000 1
 » 3 months ago, # |   0 Is there an easier solution for E other than 3 dp's?
•  » » 3 months ago, # ^ |   0 Centroid Decomposition
•  » » » 3 months ago, # ^ |   +75 You call Centroid Decomp easier than DP? o.O
•  » » 3 months ago, # ^ |   -6 Yep. Just one improvised DFS will do the trick, and I would have done it, if not for the electricity going off...
•  » » » 3 months ago, # ^ |   0 Care to expand please?
•  » » » 3 months ago, # ^ |   0 pls , explain, I am intrigue.
 » 3 months ago, # |   0 how to solve C ?
•  » » 3 months ago, # ^ |   0 the sequence of length n contains 2^n-1 sequences. Hence, the number X can be decomposed into powers of two minus 1. The degrees of the twos in this decomposition are the lengths of the sequences to be used. The degrees of the twos in this decomposition are the lengths of the sequences to be used. Collect on parts. The final sequence will look like:1,1,1,....,1+(d+1),1+(d+1),....,1+(2*d+1),1+(2*d+1),...where the number of identical terms is equal to the powers of the twos to which we decomposed X.If the number X cannot be completely decomposed into (2^i-1), then at the end of the answer it is necessary to add Another f distinct numbers, each of which will increase from the previous one by d+1. Do not forget to take into account that the length of the answer should not exceed 10000
•  » » » 3 months ago, # ^ |   +6 Answer length never excceeds ~465 by this way. I guess we can forget about the last condition.
 » 3 months ago, # |   0 Why is this simple dfs going TLE?Source
•  » » 3 months ago, # ^ | ← Rev. 3 →   0 Consider case 2 1000001 2 12 1 21 2 3and so on. The simple dfs checks 50000 edges 50000 times, making it .
 » 3 months ago, # |   +84 Putting only case where sum of Vi is 0 in E's pretests...Anyway, how to solve G? And is there any technique to deal with counting permutation?
•  » » 3 months ago, # ^ |   -9 Surely it is better to put hard cases in the pretests than real tests... would you rather fail and not be able to fix it??
•  » » 3 months ago, # ^ |   +22 Holy shit, I added 2 * sum of the values to the answer. RIP good place
•  » » 3 months ago, # ^ |   0 I found some pattern. Which included Pascal triangle and Stirling number of the first kind. I generated the required Stirling number with FFT but got WA :/ I think I should have used NTT or maybe there's a lot simpler solution or something.
•  » » 3 months ago, # ^ |   +5 I am very thankful that this did not change my rank! :P
 » 3 months ago, # |   0 Anyone knows Pretest 4 of question D
•  » » 3 months ago, # ^ |   +3 I think it is large numbers or something, I got a run time error that I fixed by increasing the size of my array :P
•  » » » 3 months ago, # ^ |   +6 3 3 1000000000000000000 1 12345 13 3 1000000000000000000
 » 3 months ago, # |   0 it really feels good to see my mistake in c after 1 min from the end of the contest
 » 3 months ago, # |   +3 Initially the text in the problem did not appear properly, but surprisingly few were able to solve before it appeared properly.
 » 3 months ago, # |   0 Is NTT a must in problem G or it can be done with FFT? Or does it have some simpler solution?
•  » » 3 months ago, # ^ |   +1 There is a work around to do FFT under large Modulo. But in this problem it might be risky, as it is time consuming. The idea is -Lets take C = 30000. Now partition each number A(x) as Ca1i + a2i, and B(x) as Cb1i + b2i. Then convolute P = a1 × b1, Q = a1 × b2, R = a2 × b1, S = a2 × b2.You can get the final result as (A × B)i ≡ C2pi + C(qi + ri) + si (mod M). It works because no number while doing fft corsses NC2 and fits into precision. But you can't do fft directly into the main polynomial, then a number can be atmost NM2, and that will overflow.
 » 3 months ago, # |   +4 How to solve F?
•  » » 3 months ago, # ^ |   0 If you make a new graph so that the edges are the nodes and the nodes are the edges, you'll have exactly the same problem but you'll have to find the longest path of increasing nodes. This is done by going through the nodes in the order of their values and updating a dp[node]=longest increasing sequence ending in node.
•  » » » 3 months ago, # ^ |   0 ok, but how to "make" the new graph in time?
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   +5 You don't really have to make it, you can just imagine it(so that the solution is easier). So for the solution you make dp[node]=the longest sequence of increasing edges so that the last edge goes into node. You then take the edges, sort them by their cost, and then if you have edge (u,v), if dp[u]
•  » » » » » 3 months ago, # ^ |   0 The edges are directed and it seems your solution assumes the edges are undirected.Also, how do you make sure the edges are in the same order as the input?
•  » » » » 3 months ago, # ^ |   0 I don't think there is a way to make it without TL. The edge of a graph having every other vertex connected to vertex 1 has N*N edges in it.
•  » » » 3 months ago, # ^ |   0 can't there be (10^10)/4 edges in the new graph?
•  » » » » 3 months ago, # ^ |   0 You don't really have to make it, you can just imagine it(so that the solution is easier). So for the solution you make dp[node]=the longest sequence of increasing edges so that the last edge goes into node. You then take the edges, sort them by their cost, and then if you have edge (u,v), if dp[u]
•  » » 3 months ago, # ^ |   0 It seems like dp and maintaining array of sets(couldn't implement it in time though).
•  » » 3 months ago, # ^ | ← Rev. 3 →   +5 Let's loop over the edges in reversed order and assume that the current edge will be the beginning of the path. This way we kinda eliminate the condition about indices being increasing and only have to worry about weights.Define f(node)(w) as the maximum length of a path if we start at node with an edge of weight w. Let's say the current edge goes from A to B and has weight C. Now we have to update the value of f(A)(B) with the maximum value of f(B)(i) + 1 for i > C. Obviously keeping f(node) in the form of a segment tree, in which the indices are the weights of outgoing edges from node, does the job.
•  » » » 3 months ago, # ^ |   0 I did all of this but stopped at the f(node) part because the segment tree of each node can be as large as 100000 (number of weights), is it something like dynamic segment tree or a segment tree with coordinate compression?
•  » » » » 3 months ago, # ^ |   +5 Thing is, you have to keep f(node)(w) only if there is an outgoing edge from node with weight w, that means O(M) cells in total. So for each node we can simply sort those weights of outgoing edges and then binary search over them to find the proper indices for querying. https://pastebin.com/ZDqFAcNi
•  » » » » » 3 months ago, # ^ |   0 Thank you
 » 3 months ago, # |   +76 The point distribution is really unfair. I mean 2500 for F and 3000 for G, when there is a huge difference in difficulty :/
 » 3 months ago, # |   -23 Is it rated?
 » 3 months ago, # |   0 What is the problem with this code?:(37063101
•  » » 3 months ago, # ^ |   +13 That's not how you read the arrays :P
•  » » » 3 months ago, # ^ |   +26 Why am I still alive?:((
•  » » 3 months ago, # ^ |   0 ans should be long long imo
•  » » » 3 months ago, # ^ | ← Rev. 3 →   0 define int num
 » 3 months ago, # |   +10 How Tricky!!
•  » » 3 months ago, # ^ |   0 I don't understand that. "At least one 'a' and one 'b' exist" mean that there must at least one 'A' or one 'B' in the string. Then why not handling the case when there's no 'a' or 'b' will fail?
•  » » » 3 months ago, # ^ |   0 most people read it fast, so they didn't care.
•  » » » » 3 months ago, # ^ |   +1 I mean, the statement should be "At least one 'a' or one 'b' exist", right?
•  » » » » » 3 months ago, # ^ |   0 Yes, it must be. see the difference!! https://www.englishforums.com/English/LeastLeast/qrvll/post.htm
•  » » » » » » 3 months ago, # ^ | ← Rev. 2 →   0 Who translated this problem??? This is a huge error in the statement!And how could one detect this out?
•  » » » » » » » 3 months ago, # ^ | ← Rev. 2 →   0 I think there is another Opinion in the same link. see, "At least one "A and B" would mean one or more "A and B" as he writes. But at least one OF A and B means A alone, or B alone, or both."
•  » » » » » » » » 3 months ago, # ^ |   0 Sorry, but in the previous reply,"A and B" would mean one or more ("A and B") mean that must be one of A and B in the string. I am very confusionّ! many people have many opinions! But Finally, it should be in the statement in a clear way.
•  » » » » » » » 3 months ago, # ^ |   +10 It was me who made a huge error. The "At least one 'a' and one 'b' exist" thing is for the string A and B made, not the string in the input.
 » 3 months ago, # |   +46 G : https://www.youtube.com/watch?v=E-i5nrl4SaI + https://www.quora.com/How-can-I-calculate-the-Stirling-numbers-of-the-first-kind. First was one of our icpc practice (and actually a famous DP practice problem, for a lower constraint), and second was pure googling.To be honest, I still don't know what's the "First kind of Stirling number". It's always so fun to get a rating that I don't deserve!
•  » » 3 months ago, # ^ |   0 Did you use FFT or NTT? If FFT, then how did you handle the mod?
•  » » » 3 months ago, # ^ |   0 I used NTT.For handling mods in FFT, look here : http://codeforces.com/blog/entry/48465
•  » » » » 3 months ago, # ^ |   0 I got WA because I couldn't handle mod in FFT :(
•  » » 3 months ago, # ^ |   0 Can you explaine please, what is the complexity of your F and how it fit in time?37057703Because, I can see you use Divide&Concuer, but at each step use have sort()And you should have: T(n) = 2*T(n/2) + O(nlogn)
•  » » » 3 months ago, # ^ |   0 Yeah T(n) = nlg^2n, why not
•  » » 3 months ago, # ^ |   +8 Haha, I worked out the formula with one (1) Stirling number using the generating function of Stirling numbers (u generates A or B, z generates N).We want to compute the convolution of sequences \sum_n \left[n, K\right] / n!Unable to parse markup [type=CF_TEX] and K = B - 1 with sum of n equal to N - 1, then multiply it by (N - 1)!; in other words, we want the N - 1-th coefficient of fA - 1(x)fB - 1(x), where .Since , fK is the K-th coefficient of the Taylor series of g with respect to u. We can get it as Hey, the product $f_{A-1}(x) f_{B-1}(x)$ is proportional to fA + B - 2(x)... and we can extract the N - 1-th coefficient by differentiating again: Alternatively, we can use the definition of fA + B - 2 to write it as
 » 3 months ago, # |   0 Can someone point out what's wrong with my code for B? I still can't figure what did I do wrong.
•  » » 3 months ago, # ^ |   0 There is nothing wrong with the code. The idea is just wrong. The right solution is to minimize the max difference, but you just use all your moves to completely remove a difference or two.Instead, find the max difference, remove or add 1 to it, repeat... Sometimes you'll need to add because you must use all the moves.
•  » » » 3 months ago, # ^ |   0 Oh. I guess I never saw it like that. I thought removing maxDiff square would have more impact than minimizing it each time. Thanks for your input.
•  » » » » 3 months ago, # ^ |   0 Array of diffs [1,1] has error = 1^2 + 1^2 = 2. While [0,2] has error = 0^2 + 2^2 = 4
 » 3 months ago, # |   0 37063254 Can anybody tell me what is wrong with this one?:)
•  » » 3 months ago, # ^ | ← Rev. 3 →   +1 since x is int, x*x can overflow. It should 1ll*x*x. Testcase1 0 0 1000000 0 
 » 3 months ago, # |   0 what's the test 18 for E?
•  » » 3 months ago, # ^ |   0 Maybe when sum of all vi's is not zero. So that you will have to consider zero length paths.. not sure though
•  » » 3 months ago, # ^ |   0 they intentionally put the sum of vi = 0 in the first 17 cases so that if you are counting A(u,u) 2 times your code passes pretests but fails system testing...
 » 3 months ago, # |   0 Laughed over people who get WA because of long long in B and made myself the same mistake in C. Stupid karma.
•  » » 3 months ago, # ^ |   0 I submitted that wrong twice. Fuck.
 » 3 months ago, # |   +95 You really did intentionally generated pretests in E having zero sum over all vertices to break solution that don't consider zero-length pathes. Welcome to the faggots club :\
•  » » 3 months ago, # ^ |   0 Nice I had written ans=0 and then added numbers in vertexes earlier in the code, very good descent CF one love
 » 3 months ago, # |   -21 @CF :((
 » 3 months ago, # |   +26 My solution of F fails(returns 2) on this test: 3 2 1 2 1 2 3 1 But got accepted! :-?
•  » » 3 months ago, # ^ |   0 What's wrong with it?
•  » » » 3 months ago, # ^ |   +5 It says weights of the edges should be in strictly increasing order.
•  » » 3 months ago, # ^ |   +10 The same here. Realized it during the contest and resubmitted. Facepalm
 » 3 months ago, # |   -13 Problem D was really a very interesting problem.
•  » » 3 months ago, # ^ |   +3 Get your code Accepted then, sir.
•  » » » 3 months ago, # ^ |   0 What is the relation between seeing that the problem is interesting and getting it accepted ?
•  » » » » 3 months ago, # ^ |   0 It will make you feel good!
 » 3 months ago, # |   +46 Not that I'm complaining, but this solution 37079339 for G passed all tests (3493 ms), while on test "100000 32768 32768" it works 4461ms in "Run On Server" tab. It is strange not to add such a test, given that 2n - 1 is the worst case for logarithmic exponentiation.(if anything, I'd complain about such an ambiguous TL, which allows to pass only some of the solutions)
•  » » 3 months ago, # ^ |   +5 I think the major issue is in CF server, which runs in 32bit environment (Thus being very slow on 64bit integer operations)
•  » » 3 months ago, # ^ |   0 Your NTT code is slow. Example, when multipling two small polynomials, you still need a inversion function. O(NlogN) may be found at here: https://discuss.codechef.com/problems/CHEFKNN.
•  » » 3 months ago, # ^ | ← Rev. 2 →   0 And this submit in last 5 sec of contest threw me out of top 15 =(
•  » » » 3 months ago, # ^ |   +6 Sorry about that :) I wasn't submitting this till the end of the contest, just because I knew the test for which it is too slow on CF servers. In such case the best tactics is to submit at the very end (=> no hacks), and hope that tests are weak. This is exactly what happened.
 » 3 months ago, # |   0 For the 3rd question I assumed that the elements of the array should be distinct and then for next 1 and half hour I was busy solving the question,also with 3 failed pretest.Later Did I recognised that no-where it was mentioned that the element should be different. Feeling so stupid.
 » 3 months ago, # |   +38 Ok contest, the problems were kinda standard-ish, but at least the pretests and tests weren't dumpster fire quality and everything that needed to work (server) worked. Google could learn from this.F was way, way too easy. It's LIS, just with a graph, and it's solved exactly like LIS, just with a graph. I spent about 10 seconds thinking about how to solve it. It would've been better to use something with difficulty between E and G rather than below (this) D.My rating increased! by 2 points
 » 3 months ago, # | ← Rev. 4 →   +40 Top 15 Indians:gvaibhav21evil666manBabayashChandnaniteja349jtnydv25ajinkya1p3polingyhitman623GT_18Equinoxsinus_070ShivRamabishekanishant_coder
 » 3 months ago, # |   +5 i think problem D E and F have same diffilcultiesnice problem and rapid rating update anyway
 » 3 months ago, # |   0 IN PROBLEM "A" it is written that-> " they have made sure that at this point, at least one 'a' and one 'b' exist in the string." how have they given test case with only bbbbbbbbbb!!! this seems unfair
•  » » 3 months ago, # ^ |   +1 You misinterpreted the question. It means that the string has to have at least one a and b to be valid.
•  » » » 3 months ago, # ^ |   0 YES..Thank you..
•  » » 3 months ago, # ^ |   +6 In such a test case, you're suppossed to output NO.
 » 3 months ago, # | ← Rev. 3 →   0 Can anyone tell me what's wrong in my solution 37078196 for D. And why commenting this line gives AC. m=m-(pow(2,t1));
 » 3 months ago, # | ← Rev. 2 →   0 Got wrong answer in Problem C pretest 1.vector < int > v = {1, 2, 3}; printf("%lld\n",v.size());Output in codeforces ( GNU++11 5.1.0 ) : 55834574851output in my pc ( g++ follows c++11 ) : 3
•  » » 3 months ago, # ^ |   +1 You can't print a variable of data type size using printf and %lld, you should cast it to long long first or use cout
•  » » 3 months ago, # ^ |   +9 With printf you need to be very careful about types. If you give the function a parameter of the wrong type, it will print garbage.And here is the problem. The size of the type of v.size() is not standardized. It doesn't have to be a 64 bit integer (although g++ will usually use 64 bit). However Codeforces uses a g++ compiler where v.size() is only 32 bit.Solutions: cast the variable to a long long, or simply use cout << v.size() << '\n'; :-P
•  » » » 3 months ago, # ^ | ← Rev. 2 →   +5 Or use %zu to printf a variable of type size_t (which is the return type of vector::size).
•  » » » 3 months ago, # ^ |   0 The size of int, long and long long isn't standardised either. The C standard only requires that they're enough to hold specific ranges. In the same way, size_t only has to be able to represent the return value of sizeof().Different types are differently represented in memory, and you should be very glad implicit type conversions exist in the simplest cases at all (casting a 4-byte int to an 8-byte long long could give you 4 bytes of garbage, but it doesn't).
 » 3 months ago, # |   +2 When will we get the Editorial of this contest?TIA. :)
 » 3 months ago, # |   0 During the contest my code for D kept getting TLE. Now it's AC in 2 seconds. The servers are really unreliable; I had to spend a bunch of time optimizing AC code with good complexity. :/
 » 3 months ago, # |   +1 This was an amazing contest! When will the editorials be published?
 » 3 months ago, # |   0 How Solve E?
 » 3 months ago, # |   +3 I saw many of my friends AC 4 problems but fst 3 of them! I have too say E and F are too standard ,Why don't put int the Education contest!?
 » 3 months ago, # |   +12 where is the editorial??
 » 3 months ago, # |   0 Hey guys!Before the official editorial comes, here are some of my thoughts on problem A, B, C, D, F: RobeZH Blogspot ArticleI am glad to hear any suggestions or questions! Thanks!
 » 3 months ago, # | ← Rev. 3 →   +6 problem F http://codeforces.com/contest/960/submission/37093065 KAN this solution got accepted but fails on this test case 4 5 1 2 3 2 3 4 3 3 5 1 3 5 3 3 6
•  » » 3 months ago, # ^ |   +2 true, the tests were weak, i dont get why they didnt reevaluate the solutions
 » 3 months ago, # |   -6 I gotta a native question that hou can I get purple? Desire to improve my ability of coding...
•  » » 3 months ago, # ^ |   +4 It is not the right place to ask such question. If you search on google, you will find plenty of posts regarding such question and replies on Codeforces and Quora. If you still think that you need to ask something regarding this, you may create a blog post on codeforces or ask on quora.
•  » » » 3 months ago, # ^ |   0 Okay,I got it.Thanks
 » 3 months ago, # | ← Rev. 2 →   -22 The people on codeforces community are racist.They downvote you, just because you are grey.
•  » » 3 months ago, # ^ |   0 I am white. But they didn't leave me either -_-
•  » » 3 months ago, # ^ |   0 colorists