### gepardo's blog

By gepardo, history, 4 years ago, translation,

Hello, Codeforces!

Tomorrow, in November 15, 2016 at 19:35 MSK a regular Codeforces round for participants in the second division will be held. As usual, participants from the first division can take part out of competition.

I (alex256) am the author of the contest. It's my first round and I hope it won't be the last. Great thanks to Gleb Evstropov (GlebsHP) for help in preparing the contest, Andrey Kalendarov (Andreikkaa) for testing the round and Mike Mirzayanov (MikeMirzayanov) for the great platforms Codeforces and Polygon.

As usual, the participants will be given 6 problems and two hours to solve them. I recommend to read ALL the problems. I wish everyone many Accepted and, of course, enjoy solving the problems.

The problems will be about my younger brother Anton. I hope you'll like them :)

The round is rated.

UPD: Though, the round won't be completely usual and there will be 6 problems.

UPD2: The scoring is 500-750-1250-1500-2000-2750.

UPD3: Tutorial is available now.

UPD4: Contest is over, congrats to winners :)

Div. 2

Div. 1

• +348

 » 4 years ago, # |   +37 Finally a regular round!
•  » » 4 years ago, # ^ |   +5 Let's hope for a great round with diverse problems!
 » 4 years ago, # |   +49 Finally a usual 2 hour contest. All the best for your first contest as a problem setter alex256
•  » » 4 years ago, # ^ |   +11 Thank you :)
 » 4 years ago, # |   +131 Usual time? How unusual!
 » 4 years ago, # |   +6 Here we go again :D
 » 4 years ago, # |   +10 It is becoming so usual to see comments about usuality
•  » » 4 years ago, # ^ |   +1 not at all
 » 4 years ago, # | ← Rev. 4 →   -10 It is such a long time that has no contest!
•  » » 4 years ago, # ^ |   +9 Wish it to be an exciting contest! :)
•  » » » 4 years ago, # ^ |   +7 And we thought it's going to be an usual round
 » 4 years ago, # |   +1 is it rated?
•  » » 4 years ago, # ^ |   -8 Have you even read the statement?
•  » » » 4 years ago, # ^ |   -22 maybe he means that : are you going to make it unrated after the contest or not?
•  » » 4 years ago, # ^ |   +14 not at all
 » 4 years ago, # |   +7 "I wish everyone many accepted" — yes! we love this green word.
 » 4 years ago, # |   +82 I wonder why so little div 1 contest lately. So sad :(
•  » » 4 years ago, # ^ |   -8 Maybe because, they require harder problems which are harder to create.
•  » » » 4 years ago, # ^ |   -15 wow, didn't know that Logic
 » 4 years ago, # |   0 Hope next contests will be a bit earlier.
•  » » 4 years ago, # ^ |   0 Next contest is just after 5 days :)
 » 4 years ago, # |   +8 I have recently joined.Shall I be able to participate in #379(Div.2) ?
•  » » 4 years ago, # ^ |   +17 Of course yes, just register to the contest. Wish you good luck :)
 » 4 years ago, # |   +17 I wanna thank your younger brother who faces problems and made us get into competition , All the greetings and appreciation to him
•  » » 4 years ago, # ^ |   +23 Thank you, it is me.
•  » » » 4 years ago, # ^ |   +2 I hope you are not competing in this round, that would be a huge advantage against all other participants, as you already know all your problems
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +22 No, of course, I'm fair. I know all the problems and I will not compete in this round. Good luck everyone! I hope you will enjoy this round!
 » 4 years ago, # |   +11 It's happening after a long time, also after a long time next one will happen! we'll miss it for long time!
 » 4 years ago, # |   +13 I'm attending a CF round after a long time hope there are a lot of interesting problems :)
•  » » 4 years ago, # ^ |   +28 I also hope that my problems will be interesting for you :)
•  » » » 4 years ago, # ^ |   +12 Thanks :D they were really good.
 » 4 years ago, # |   -8 "the round won't be completely usual", will there be a clown dancing in the middle of the contest or something :D
•  » » 4 years ago, # ^ |   +3 and the clown's name is minasamehlabib :3
 » 4 years ago, # |   +24 6 problems in 2 hours, will they be enough??? or shouldn't it be at least 2:15 :\
•  » » 4 years ago, # ^ |   +9 May be problems are easier to solve :P
•  » » » 4 years ago, # ^ |   0 easier to solve = less fun :(
 » 4 years ago, # |   0 come on !!!! 12 more days until the upcoming div1 round
 » 4 years ago, # | ← Rev. 2 →   -8 It seems that not having 5 problems is the new default
 » 4 years ago, # |   0 I guess problem C hacks use this: ci are not decreasing and di are not decreasing?
•  » » 4 years ago, # ^ |   +14 I hacked someone because he didn't handle only using second spell.
 » 4 years ago, # |   +1 E test 3 — what was this?
•  » » 4 years ago, # ^ | ← Rev. 2 →   +5 Consider a white node connected to three black nodes and each of these black nodes is connected to another white node. The answer is 2.
•  » » 4 years ago, # ^ |   0 in first sample , add a white child to 11 , that should fail most wrong logics.
•  » » 4 years ago, # ^ | ← Rev. 3 →   -6 Maybe something like this? 16 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 2 1 3 2 4 2 5 3 6 3 7 4 8 4 9 5 10 5 11 6 12 6 13 7 14 7 15 8 16 Answer is 4.
•  » » » 4 years ago, # ^ |   0 your input is not valid.
•  » » » 4 years ago, # ^ |   0 The second line doesnt have 16 integers.
•  » » 4 years ago, # ^ |   0 It was just a random test.
 » 4 years ago, # |   -22 Is this rated?
 » 4 years ago, # |   +3 How to solve C?
•  » » 4 years ago, # ^ |   +11 using binary search!!
•  » » 4 years ago, # ^ |   +9 Use binary search.Since potions of type 2 are already sorted and also greater the cost of potion 2 greater is the number of potions that are immediately completed. for each potion of type 1 find the maximum type 2 potion that can be bought using upper_bound(In C++ ofcourse) and find the amount of time it takes and find minimum among those.Time Complexity — mlogkm-number of potions of type 1 k-number of potions of type 2
•  » » » 4 years ago, # ^ |   0 I used similar approach but failed on pretest 3... 22247888 any idea why its failing ?
•  » » » » 4 years ago, # ^ |   0 pretest 3 was about not considering using only first spell I think.
•  » » » » » 4 years ago, # ^ |   0 in the commented portion i was tackling that as well but still It was failing on pretest 3. btw can we see pre tests once the contest is over ?
•  » » » » » » 4 years ago, # ^ |   0 yep, just scroll down to see tests.
•  » » » » 4 years ago, # ^ |   0 What if we just need to cast spell type 2?
•  » » 4 years ago, # ^ |   0 1.First solve for only using second type spell — O(k) 2.Iterate over m and during each iteration use binary search on k and find minimum value during each iteration. 3.Then take minimum of all value which find in step 2.Time complexity — O(mlogk)
•  » » » 4 years ago, # ^ |   0 I add one artificial spell to both types. (x, 0) for the first type, and (0, 0) for the second one. Picking one of this spells is equivalent to taking none of respective types as they have no effect. Thus I was always picking exactly one first type and exactly one second type spell, sparing myself consideration of corner cases. It got accepted so I suppose it's valid.
•  » » 4 years ago, # ^ |   0 Two pointers. Sort first spells by mana and go from left to right, at each step decrease the pointer for the second spell while you don't have enough mana.
•  » » 4 years ago, # ^ |   +1 I solved it with two pointer technique
•  » » 4 years ago, # ^ |   0 sort first type spell's by cost of each. then you can use Two Pointer algorithm for each a[i] (the i-th first type spell)
 » 4 years ago, # | ← Rev. 102 →   0 когда это редакционная?
•  » » 4 years ago, # ^ |   +18 nice try google translate
 » 4 years ago, # |   +5 Should have defined axis in D . The picture for sample 1 got me all confused :/
•  » » 4 years ago, # ^ |   0 same as me
•  » » 4 years ago, # ^ |   +67
 » 4 years ago, # |   0 Any approach for problem E? i used dp on trees but it failed on pretest 3. My solution
•  » » 4 years ago, # ^ |   +35 compress adjacent node with same color , answer is radius of this tree.
•  » » » 4 years ago, # ^ |   0 ohh nice one! but can you look into my dp solution? (its short and easy to understand). I cant figure out why its wrong.
•  » » » » 4 years ago, # ^ |   +1 in the first sample add a white child to node 11 , answer is 2 , your code gives 3
•  » » » » » 4 years ago, # ^ |   0 how is the answer equal to 2?
•  » » » » » » 4 years ago, # ^ |   +3 click 1 twice
•  » » » 4 years ago, # ^ |   +8 Why is the answer radius of the tree?
•  » » » » 4 years ago, # ^ |   +24 pick the centre of the compressed tree , and keep painting it till the color reaches the leaves , it takes radius number of steps.
•  » » » » » 4 years ago, # ^ |   -13 How did you not think it was dp on a tree question?
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +11 After painting one node (and compressing the tree again), the number of layers of the tree decreases at most by one, so we have to find a tree with the minimum number of layers (minimum depth). That means that the root must be the center of the tree
•  » » 4 years ago, # ^ |   0 The colors make a ring like structure visually. ans=no. of rings-1
 » 4 years ago, # |   +3 Nice contest! Easy problems — so I can feel me smart xD
 » 4 years ago, # |   0 What was the hacking testcase for F? Probably something for which answer looks nice, but b[i] and c[i] are computed incorrectly.
 » 4 years ago, # |   0 I tried hacking this code on test case: 5000000 5000000 5000000 5000000 but got unsuccessful hacking attempt :( . I was expecting int overflow as the ans for this test case is1280000000
•  » » 4 years ago, # ^ |   +3 MAX_INT = 2^31 — 1 = 2147483647
•  » » » 4 years ago, # ^ |   0 Thanx sir :)
•  » » 4 years ago, # ^ |   0 I thought that too.
•  » » 4 years ago, # ^ |   0 128000000 fits in a regular int.
•  » » 4 years ago, # ^ |   0 In addition to what other said, if you want to quickly find the max value without googling, just type this- cout<
 » 4 years ago, # |   0 Whats the fastest way to check for the optimal solution in C? I checked for Spell 1 only and Spell 2 only by normal for-loop and used two-pointer method for Spell 1 + Spell 2 checking.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +3 Use binary search.Since potions of type 2 are already sorted and also greater the cost of potion 2 greater is the number of potions that are immediately completed. for each potion of type 1 find the maximum type 2 potion that can be bought using upper_bound(In C++ ofcourse) and find the amount of time it takes and find minimum among those. Time Complexity — mlogk m-number of potions of type 1 k-number of potions of type 2
•  » » » 4 years ago, # ^ |   0 Oh damn, I'm an idiot. I thought that the upper_bound function was O(N).
 » 4 years ago, # |   +12 At the last minute, I submitted D and got WA, and I found there was an obvious bug and fixed it immediately, there was 15 seconds left and I resubmitted as soon as I could, but I couldn't click the submit button T T
•  » » 4 years ago, # ^ |   +6 I can feel your pain :D
 » 4 years ago, # |   0 Can someone give me testcase for C for which my solution[submission:22243090] fail
 » 4 years ago, # | ← Rev. 3 →   +23 I wrote a correct solution(I think it's a correct solution) for the problem E but when I was submitting it I choose the GNU C++ compiler instead of GNU C++11. Is it possible for the site administration to rejudge my submission with the right compiler?link to my submission: http://codeforces.com/contest/734/submission/22248724
•  » » 4 years ago, # ^ |   +7 I resubmitted it after contest and it got accepted!http://codeforces.com/contest/734/submission/22249620
 » 4 years ago, # |   +5 Suggestion:Either 6 problems in 2.5 hours or 5 problems in 2 Hours. Thank you!
 » 4 years ago, # |   +4 For the beginning of the contest, I could not submit codes to problem A and C. The site kept me waiting without echoing anything, which really really annoys me (I have lost 100-200 points and spent some ten or twenty minutes trying to fix it). After each time I submitted a solution, I had to wait 1 or 2 minutes to see the result, and in most cases, it told me the connection was lost(maybe timeout?) and I must resubmit. Finally, I used a VPN proxy and it somehow worked. I think at the submit page there should be some js code to handle timeout, because (at least for me) a successful submission usually won't take a long time.
 » 4 years ago, # |   +3 In problem E: Does the paint function simply work like the paint bucket in mspaint.exe (floodfill all adjacent nodes of the same color)? If yes, then the description is needlessly complicated. Interpreting it like this I used a disjoint set union, and tried to count the number of white and black sets and printed the minimum of them. Seems like I'm wrong...22248877
•  » » 4 years ago, # ^ |   +3 Yes, and the idea was taken from paint bucket in Paint.
•  » » » 4 years ago, # ^ |   +1 The paint bucket in Paint has lead to one another interesting problem. PAINT — ONTAK 2015 (Polish Training Camp)https://sio2.mimuw.edu.pl/c/wiekuisty_ontak2015/p/pai/
 » 4 years ago, # | ← Rev. 2 →   +8 I'm really scared from C's tests everyone is failing in it.:(UPD: got it AC:)
•  » » 4 years ago, # ^ |   0 Congrats man :D me too
 » 4 years ago, # | ← Rev. 3 →   0 My B failed! :(Can anyone tell me what is wrong in this? ll k2,k3,k5,k6; cin>>k2>>k3>>k5>>k6; ll mini=(k2,min(k5,k6)); ll sum=0; sum+=256LL*mini; k2-=mini; k5-=mini; k6-=mini; mini=min(k3,k2); sum+=32LL*mini; cout<
•  » » 4 years ago, # ^ |   0 it's interpratated as std::pair(k2, min(k5, k6)), so after assignment mini is k2.
•  » » » 4 years ago, # ^ |   +5 well, maybe it's the same as ll mini = k2, min(k5, k6)
•  » » » » 4 years ago, # ^ |   +4 Ohh.. this looks more likely
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 In a comma expression E1, E2, the expression E1 is evaluated, its result is discarded, and its side effects are completed before evaluation of the expression E2 begins
•  » » 4 years ago, # ^ |   0 There should be some warning like: warning: left-hand operand of comma expression has no effect
 » 4 years ago, # | ← Rev. 2 →   +1 Solutions for C of many people failed any idea where it failed.Upd: Mine too failed any idea on the mistake in my codehttp://codeforces.com/contest/734/submission/22243843
•  » » 4 years ago, # ^ |   0 My solution failed i believe because i set maximum value for answer to be 10**16 (I thought n = 10**5)
•  » » 4 years ago, # ^ |   +5 I got WA on test 13 because I forgot to take minimum of possible potion values and the original value of x, :/ Feels bad man. :/
•  » » 4 years ago, # ^ |   +1 i think you forgot if pos <= 0 or something like that
•  » » » 4 years ago, # ^ |   0 Thanks i got the mistake if upper bound return 0 pos becomes -1 . Facepalm :)
•  » » » » 4 years ago, # ^ |   0 I too did the same mistake !
 » 4 years ago, # | ← Rev. 2 →   +24 What's up with A? I understand it's Div. 2 A and you can give there pretty much anything solvable by anybody in less than 5 minutes (I have been an author myself), but I think it's too much: I feel like I have seen this problem ten times before, it's pretty much one loop and one if (no brain involved), and looks more like a programming language exercise. Still thanks for a contest! :) I enjoyed E (and have no clue for F).
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 True!!! :D Upd: i solved A in 1 min :D
•  » » 4 years ago, # ^ |   0 I remember Edvard saying problems A&B are harder to create than the rest, but yeah this is some next level ease.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +7 As you've seen C was a little bit hard, so I needed something very easy for A.
•  » » » 4 years ago, # ^ |   +7 Nice jobs on your first contest :D
•  » » » » 4 years ago, # ^ |   0 Thank you :) Wait for the next contest :)
•  » » 4 years ago, # ^ |   0 I believe they meant to test the platform for a lot of quick submissions ;)I must say, well done, everything worked very smooth this round, good job!(I submitted A in second minute of the contest thinking how quick I am... and there were already 500 accepted submissions)
 » 4 years ago, # |   0 Auto comment: topic has been updated by alex256 (previous revision, new revision, compare).
 » 4 years ago, # |   0 Auto comment: topic has been updated by alex256 (previous revision, new revision, compare).
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 where is tutorial? good job for the contest
 » 4 years ago, # |   +12 It was good
 » 4 years ago, # |   0 May be pretests will be more stronger!7! At least in realisations such as D
 » 4 years ago, # | ← Rev. 2 →   +9 Where? ! :O And also how Tutorial was available before the contest is over ! :P
•  » » 4 years ago, # ^ |   0 It's available now.
•  » » » 4 years ago, # ^ |   +8 Still not showing any link -
•  » » » » 4 years ago, # ^ |   0 Thank you, the link is added.
•  » » 4 years ago, # ^ |   +6
 » 4 years ago, # | ← Rev. 2 →   -9 In Problem D, It was stated that it's a x-y plane. However, it didn't seem like a Cartesian Coordinates System at all. :\
•  » » 4 years ago, # ^ |   +1 It is a cartesian plane.
•  » » » 4 years ago, # ^ |   0 X represented the row instead of the column, -ve rows(i.e -ve X) were on the top !
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 That doesn't change the result. A rotated plane is still a plane.
 » 4 years ago, # |   0 anybody knows what is the bug on problem D ???
 » 4 years ago, # |   0 I am a new participant. After the contest my rating was not updated and my contest list doesn't show my participation in this round. Is there any problem with my profile or anything else?
•  » » 4 years ago, # ^ |   0 Ratings will be updated soon... :) Then you'll find.
•  » » 4 years ago, # ^ |   0 I think it might take some time for it to be updated.
•  » » 4 years ago, # ^ |   0 Just wait some time, it will be updated.
•  » » 4 years ago, # ^ |   0 It takes a while for updating the ratings.
 » 4 years ago, # |   0 Has anyone solved problem E,using dp on compressed tree ?
 » 4 years ago, # |   0 I had submitted a solution to the C problem during the contest and it was giving wrong answer on 5th pretest and I submitted the exact same solution after the contest and it is giving TLE on 6th pretest. I don't know why this is happening.Submission during contest: http://codeforces.com/contest/734/submission/22240240Submission after contest: http://codeforces.com/contest/734/submission/22250847
•  » » 4 years ago, # ^ |   0 Only  #define xxx xx is added !!! Authority should take a look at this ! The both solution is same ! But for some reason during contest time there occurred a overflow ! for that output was -7166261092318506304 !! -_-
 » 4 years ago, # |   0 For problem C, can anybody please explain me why for input 10 3 3 10 33 1 7 6 17 25 68 2 9 10 78 89 125 output is 17 ?Shouldn't the output be 10? Since Anton can use the 1st spell of the first type that costs 17 manapoints. Thus, the preparation time of each potion changes to 1 seconds. So the preparation time is 10*1 = 10.
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 deleted
•  » » 4 years ago, # ^ |   0 My AC code gives answer as 10.
 » 4 years ago, # |   0 Auto comment: topic has been updated by alex256 (previous revision, new revision, compare).
 » 4 years ago, # |   0 In problem C, I have used range minimum query segment tree + binary search to find the minimum possible time. I am getting WA on test 13. Testcase is pretty much large, cant figure it out manually, Somebody help please :) http://codeforces.com/contest/734/submission/22241998
•  » » 4 years ago, # ^ |   +3 I had WA on the same test, make sure you're considering the case when you don't use any spells of the first type.
•  » » » 4 years ago, # ^ |   +1 Thanks Ahmed :)
•  » » » » 4 years ago, # ^ |   +1 You're welcome ^ _ ^
 » 4 years ago, # |   +2 when will the ratings be updated!!!!!
 » 4 years ago, # | ← Rev. 2 →   0 I got a RUNTIME_ERROR on my submission 22244664 for problem D. If I run my solution locally, it runs fine. Does anyone have a clue?--EDIT: Also on submission 22251648, which is the same code but cleaned up.
 » 4 years ago, # |   +1 How long do they update the rating ?
 » 4 years ago, # |   +1 We need more regular Rounds like this and in general more rounds..
 » 4 years ago, # |   +37 A funny thing about the contest:
•  » » 4 years ago, # ^ |   +3 Illuminati confirmed :)
•  » » 4 years ago, # ^ |   +12 Confirmed
 » 4 years ago, # |   +26 Waiting for the rating change..
 » 4 years ago, # |   0 i wonder if i will increase or decrease in rate ?
 » 4 years ago, # |   0 Can anyone say how many times needs to update with new rating? (I am new contestant).
 » 4 years ago, # |   0 Waiting.. waiting.. waiting... :(
 » 4 years ago, # |   +1 i have an Exam tomorrow send me a message when you update the rate ,i am sleeping XD
•  » » 4 years ago, # ^ |   0 it's updated.
•  » » » 4 years ago, # ^ |   0 YA thanks i got +40 . not bad i wish i get more next time , good luck for you too .
 » 4 years ago, # |   0 this was a great "prime in number" round :D
•  » » 4 years ago, # ^ |   +6 :V :P B)
 » 4 years ago, # | ← Rev. 2 →   0 Deleted
•  » » 4 years ago, # ^ |   0 What did you delete? ! :O -_-
 » 4 years ago, # |   -43 Sooooo bad contest!
 » 4 years ago, # |   +5 First time 'BLUE'! It's great to see my name in blue color! :D
 » 4 years ago, # | ← Rev. 3 →   0 alex256 Problem C: Can you check why test case 21 has only 3 lines, its hard to take input as in questions it specifies input in different lines.
•  » » 4 years ago, # ^ |   0 Codeforces doesn't show the tests fully, so you can see only 3 lines. But in fact there're 6 lines in the test.
•  » » » 4 years ago, # ^ |   0 My bad, thanks
 » 4 years ago, # |   +3 This was my first competition and I really enjoyed solving the problems. Good job Alex! :)
•  » » 4 years ago, # ^ |   0 Thank you :)
 » 4 years ago, # |   0 That is a pity!I have read problem.E for more than one hour,but fail to understand the description until now,please illustrate your meaning clearly in the future.
 » 4 years ago, # |   0 Stuck on finding bug in submission 22242517 for 734C - Anton and Making Potions. Got error on 13 test case. Any suggestions, please?
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Consider the case where you meed to take only potion of the second type.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 May I ask you to provide some more details, please?I am iterating over all items of second type and searching for appropriate items of the first type using binary search in the for loop.For me it still looks like in 13 test case there is an item of second type with c == n and d <= s. for (long long i = 0; i < k; ++i) { if (snd[i].first > s) { break; } long long max_b = s - snd[i].first; long long r = n - snd[i].second; if (r <= 0) { min_time = 0; break; } long long a = min_fst(max_b, fst); if (a < 0) { a = x; } min_time = std::min(min_time, r * a); } 
•  » » » » 4 years ago, # ^ |   0 I'm a Java coder so I don't get what you've written, but I was in a similar situation as you are in now, after spending an entire day, I finally got AC, so I might be able to give you some insights : Consider all 3 cases: Let's say we have 'm' mana 1. when all potions of type 1 have mana requirement > m then binary search the highest value in second potion array 2. when all potions of type 2 have mana requirement > m then loop for every element in the first array and search for best value 3. When the answer is a combination of bothOne note in the binary search algorithm : consider the case when 2nd potion array is : 5 7 10 10 here cost of both is same but if we chose later one then the time is minimized, so in the binary search, remember to return the highest index of the key Take a look at my solution which is much readable
•  » » 4 years ago, # ^ |   0 Just figured out that min_fst function was incorrect. Should check if iterator points to the end after lower_bound if (it == fst.end()) { --it; }`
 » 4 years ago, # |   0 I'm not sure whether I am right. I'm getting WA on test 1 in E. I checked the answer on my computer and it's 2. However, the result of the onlinejudge is 5, which makes me confused. I made the judge print the edges of the data1, it's 3 8 3 8 3 8 3 8 3 8 ???, and that made the wrong result. Also, I get RE on data1 if I chose C++11. I assume that the data of test1 is wrong? if not, why is the problem coursed? Thx
•  » » 4 years ago, # ^ | ← Rev. 2 →   +3 Hi, I had a similar problem before. I see that you are using both scanf and ios::sync_with_stdio(0). Use either scanf or cin when u use ios::sync_with_stdio(0), but not both. That's the reason for the problem you are experiencing :) EDIT: Also, your code has wrong logic so correct that too :).
•  » » » 4 years ago, # ^ |   +8 Thank you! I solved this problem= = With regard to the wrong logic, I will think it over later = =
 » 4 years ago, # |   0 In problem C — -Anton and Making Potions, why do i have to insert certain values to each of a,b,c,d 's 0th index? I have read the problem statement again and again, just cannot understand why to put x at 'a's 0th index and et cetera. Could anyone pls explain why?
 » 4 years ago, # | ← Rev. 4 →   -8 In problem EWho can help me explain this example, why the answer is 3?100 1 0 1 0 1 0 0 1 01 22 33 44 55 66 74 88 99 10
•  » » 4 years ago, # ^ |   +8 I got it..
 » 4 years ago, # |   +8 Solved all problems with Haskell. I really like your problems! :D :D :D