### cyand1317's blog

By cyand1317, history, 7 months ago, ,

Here and there, summer's in the air! (I beg your forgiveness, residents of the Southern Hemisphere... > <)

I'm delighted to invite you to Codeforces Round #487 (Div. 2), which starts at Jun/11/2018 16:35 (Moscow time). Please note that the timing is, as usual, unusual.

This is my third time creating a contest from scratch. Along the way can be seen the efforts of: KAN the super-ultra-hyper-mega-meta coordinator, who has reviewed, refined and translated the problems; 300iq, Livace, mike_live, Noam527, RobeZH, and Tommyr7 the super-ultra-great-delicious-wonderful testers, that have populated our collection of solutions; and MikeMirzayanov along with the super-ultra-extreme-awesomazing Codeforces/Polygon team, who have made all these happen in the way it is! Kudos to all of you!

The round will be rated for contestants from the second division, and the first division are welcomed as out-of-competition participants. There will be five problems to work on for two hours. The scoring distribution will be announced later, because of... love.

Despite my illiteracy, I included the stories in the hope that they'll be inspiring to some; feel free to skip them, if you'd like to fully concentrate on problems themselves.

We wish everyone a fun experience and a fair rating. We'll be pleased to have you on the contest!

Gone are the freshness and beauty of springtide, which raises the downheartedness in Mino the poet, as in many other poets. Mino's best friend, Kanno the painter, however, is intrigued by the changing palettes brought about by the seasons. On this day, their journey in search of spring begins...

UPD 1 The scoring is standard: 500–1000–1500–2000–2500. It's however strongly recommended to read other problems if you're stuck, since you may not necessarily find later problems harder. Good luck!

UPD 2 Congratulations to top contestants! Also big kudos to all participants!

#### Overall Top 5

1. olphe
2. mjhun
3. Inner_x_Peace (First to solve E!)
4. kobae964 (_That_ close! Integer division, maybe?)
5. jorik

UPD 3 The editorial is out, see you there!

•
• +444
•

 » 7 months ago, # |   +95 Cool announcement.
•  » » 7 months ago, # ^ |   +1 i hope problems be cool like announcement :)
 » 7 months ago, # | ← Rev. 2 →   +75 We need more announcements like thisThis is the best round announcement ever
 » 7 months ago, # |   0 It says that first division will be out of competition. Even 1900-2099 ?
•  » » 7 months ago, # ^ |   0 Technically, no, since this is a Div.2-only contest.i.e. C.Master participants are also rated.
•  » » 7 months ago, # ^ |   0 All those who has rating less than 2100 will be rated, I guess.
•  » » 7 months ago, # ^ |   0 It will be rated for everybody up to 2100. Participants with the ratings 2100+ are invited to take part unofficially.
•  » » » 7 months ago, # ^ |   0 ok thanks.
•  » » » 7 months ago, # ^ |   -30 up to 2099
 » 7 months ago, # | ← Rev. 2 →   0 Can you share the two round number you are talking about?
•  » » 7 months ago, # ^ |   0 Both googling 'codeforces round cyand1317' and viewing their blog suffice; the other rounds are #418 and #431.
•  » » » 7 months ago, # ^ |   +8 Or checking his profile under Problemsetting http://codeforces.com/contests/writer/cyand1317
 » 7 months ago, # |   0 Really enjoyed reading announcement. Specially — Here and there, summer's in the air! (I beg your forgiveness, residents of the Southern Hemisphere... > <) Please note that the timing is, as usual, unusual. Gone are the freshness and beauty of springtide, which raises the downheartedness in Mino the poet, as in many other poets. Mino's best friend, Kanno the painter, however, is intrigued by the changing palettes brought about by the seasons. On this day, their journey in search of spring begins...
 » 7 months ago, # | ← Rev. 3 →   +23 Programming Contest is my drug.Codeforces is my dealer.Thanks Codeforce for two consecutive contests in two consecutive days.
•  » » 7 months ago, # ^ | ← Rev. 2 →   +7 Your words seem more of that of a poet rather than of a coder.
•  » » 7 months ago, # ^ |   0 Same to me. No other platform arranges contest more frequently than Codeforces. I am lucky to be here.
 » 7 months ago, # | ← Rev. 2 →   +25 Is it true or not that 300iq have 300iq?
•  » » 7 months ago, # ^ |   +90 It is not
•  » » » 7 months ago, # ^ |   +14 so u have more or less iq?(turn on ur sense of importance)
•  » » » » 7 months ago, # ^ |   +97 I have 35 iq.
•  » » » » » 7 months ago, # ^ |   +39 I hope it is truen't
•  » » » » » 7 months ago, # ^ | ← Rev. 2 →   0 Did you change your name on cs academy after the team selection for IOI in Russia? :D
•  » » » » » » 7 months ago, # ^ |   +16 Yes, you are right :)
•  » » » » » » » 7 months ago, # ^ |   0 :D I actually thought that this year you would pass.
 » 7 months ago, # |   +59 the super-ultra-great-delicious-wonderful testers. Delicious ???
•  » » 7 months ago, # ^ |   +54 I can confirm.
•  » » » 7 months ago, # ^ |   +21
 » 7 months ago, # |   +1 It is your way of writing that is awesomazing :D LIKE THIS ANNOUNCEMENT <3
 » 7 months ago, # |   +5 cyand1317's round again!
 » 7 months ago, # |   -8 Wow!Awesome announcement ever
•  » » 7 months ago, # ^ | ← Rev. 2 →   -8 ohhh!really
•  » » » 7 months ago, # ^ |   -8 yea
 » 7 months ago, # |   +1 it's will be nice contest for every participants
•  » » 7 months ago, # ^ |   +20 Let's hope it will! (Looks worriedly at the list of red-orange registrants and then problem E...)
•  » » » 7 months ago, # ^ |   0 ProblemE is easy?
•  » » » 7 months ago, # ^ |   +13 this comment makes sense now :D
 » 7 months ago, # | ← Rev. 2 →   +2 Hmmm.So bot[Noam] is replacing Human as Problem Setter :POnly Discord Server will get it xD
 » 7 months ago, # | ← Rev. 2 →   +1 Friends are the worst.
•  » » 7 months ago, # ^ |   +1 Still everyone talks about the same. :( YES IT IS RATED FOR YOU
•  » » » 7 months ago, # ^ |   +61 This isn't me actually, my friends got my account open and did this to get me downvotes.
•  » » » » 7 months ago, # ^ |   +10 My friends have been doing that too.
•  » » » » 7 months ago, # ^ |   0 Okay sorry then.
•  » » » » 7 months ago, # ^ |   +11 Now you got (32-11) upvotes. Friends are the best. Hence proved.
•  » » » » » 7 months ago, # ^ |   +72 I guess you are right. I misjudged them. They just wanted some upvotes for me. I couldn't think it through.
 » 7 months ago, # |   +8 Hope everyone could play the game well.Besides,how to increase my contribution？My contribution is below 0.
•  » » 7 months ago, # ^ |   +8 There are a few [not] easy ways: Writing really useful comments. Writing really funny comments. Using breaking news to make a funny comment.
•  » » » 7 months ago, # ^ |   -8 Oh,that's really useful!Thank you!
•  » » » 7 months ago, # ^ |   +5 Maybe you're new to codeforces. there's absolutely no rule. people get upvoted and downvoted for apparently no reason whatsoever.
•  » » » » 7 months ago, # ^ |   0 killer_god you are god or killer or either
•  » » » » » 7 months ago, # ^ |   0 I am both.
 » 7 months ago, # |   0 cyand1317, you could change time and date as per this comment
•  » » 7 months ago, # ^ |   0 Updated, thank you!
 » 7 months ago, # |   -6 Will this round have hacking ?
 » 7 months ago, # |   0 Looking forward to this contest, good luck and high ratings.
 » 7 months ago, # |   0 Best announcement on CF!!!
 » 7 months ago, # |   0 The scoring distribution :(
 » 7 months ago, # |   0 My rating have just become 2101 after the educational round in yesterday. This round suddenly becomes unrated to me :(
•  » » 7 months ago, # ^ |   -19 Oh,what a pity!
 » 7 months ago, # |   0 Wow, Chinese contest creater.And such a cool announcement!Hope that the problems will be as friendly as the announcement.( And without terrible DATA STRUCTURES.. XDDD
 » 7 months ago, # |   0 Will Mio and Yuko be the characters of problem statements?
•  » » 7 months ago, # ^ |   0 No, but they'll say interesting Hitokoto-word-kotoba's like Mio and Yuko do.
 » 7 months ago, # |   0 Is there a hacking round in this? If yes, what are the rules regarding the same?
•  » » 7 months ago, # ^ |   +1 I think it happens concurrently with this round as default, where you can start hacking others on a specific problem after passing pretests and locking it.
•  » » 7 months ago, # ^ | ← Rev. 3 →   +1 Yes. EDIT:Only the normal room hacking.
•  » » » 7 months ago, # ^ |   0 no hacking?
•  » » » » 7 months ago, # ^ |   0 There is hacking. The normal hacking inside of your assigned room. I thought you were asking about a hacking phase so I said no. My bad. :)
 » 7 months ago, # |   0 Huge problem statements -_-
•  » » 7 months ago, # ^ |   +6 He did mention in the blog that you can skip the additional story..
 » 7 months ago, # |   +18 1hour passed && only 1 Pretest Passed on problem D!.Really?Is it Div2 Contest?Or Typical Chinese round??
•  » » 7 months ago, # ^ |   0 I used 1 hour,too.I only passed 3 Pretest Passed on problem D.I think it's hard for me,a newbee.
 » 7 months ago, # |   +44 OMG, Prob.D&E is too hard...!
 » 7 months ago, # |   +1 problem E will give nightfall to everybody
 » 7 months ago, # |   +6 1324 hacked
 » 7 months ago, # |   +3 What's the intended solution for E? I had idea for matrix exponentiation, but was getting WA on 3 :/
•  » » 7 months ago, # ^ |   0 Maybe I got the mistake in my thinking :|I was trying to find the answer for individual lines only, disregarding the fact that multiple lines can coincide :|But then this probably makes the problem much harder than what I thought during contest
 » 7 months ago, # |   0 How to solve c?
•  » » 7 months ago, # ^ | ← Rev. 2 →   +33 Make a quarter for each letter, that will consume 1 component of each, and each group will have 25*25 letters. e.g: AAAAABBBBB AAAAABBBBB AAAAABBBBB CCCCCDDDDD CCCCCDDDDD CCCCCDDDDD Now put the rest of each letter inside the quarter of any other letter without touching each other, that way, each letter will have up to 12*12 components to create. e.g: AAAAABBBBB ABABABCBCB AAAAABBBBB CCCCCDDDDD CDCDCDADAD CCCCCDDDDD 
•  » » » 7 months ago, # ^ |   +3 thanks for the help :).
•  » » » 7 months ago, # ^ |   0 I know that in problem statement, number of connected components cannot exceed 100. But if we remove that constraint and have input as 1225 1225 1 1, then your solution will not work right ? Is there a way to extend your solution for above input ?
•  » » » 7 months ago, # ^ |   +8 Wooow !! Such an elegant construction
•  » » 7 months ago, # ^ | ← Rev. 2 →   +3 Let the answer always be a grid of size 50 * 50 Initially fill the left half with A's and the right half with B's Now to fill the remaining components make "holes" in each of the halves and place them accordingly. Suppose a = 3, b = 3, c = 2, d = 2 The matrix will be (note that the actual matrix will have size 50 * 50 ) AAAAA | BBBBB ABABA | BABAB AAAAA | BBBBB ACACA | BDBDB
•  » » 7 months ago, # ^ |   +1 make 50 50 matrix , use 1 component of B to make all components of A , 1 of C to make rest of B and similarly for the rest. like if input is 4 4 4 4 ,then matrix would look like BBBBBBBBBBB(...upto 50 chars)  ABABABBBBBB  BBBBBBBBBBB  CCCCCCCCCCC  BCBCBCCCCCC  CCCCCCCCCCC  DDDDDDDDDDD  CDCDCDDDDDD  DDDDDDDDDDD  AAAAAAAAAAA  DADADAAAAAA  AAAAAAAAAAA 
•  » » » 7 months ago, # ^ |   +3 you are bot
•  » » » » 7 months ago, # ^ |   0 Should I be laughing? :V
•  » » » » » 7 months ago, # ^ |   0 yes you are right
 » 7 months ago, # |   +1 how it is possible that in Problem-2 output for test case 2 2 .. is no?
•  » » 7 months ago, # ^ | ← Rev. 2 →   0 If p=n, then p is always a period. In other words, if x is the length of the string s, then x is a period of string s.
•  » » » 7 months ago, # ^ |   0 p is a period of the string s if "for all i, 1 <= i <= |s|-p". Now if p == n, then there does not exist any i which satisfies above constrained. Don't you think this was ambiguous?
•  » » » » 7 months ago, # ^ |   0 May be the reason is '.' character is unknown . It could be both 0 or 1. So if (i)th and (i+p)th character is '.' than it can't be said that they are same, as '.' can be anything. This fact i missed during the contest ;( May be i could be wrong.
•  » » » » 7 months ago, # ^ |   0 No, I don't think so. The problem doesn't tell "There is an 1<=i<=|s|-p so that s[i]==s[i+p]", it tells "for every 1<=i<=|s|-p s[i]!=s[i+p]".Prove that 5 is not a period of the string "01101". Show such 1<=i<=0 so that i-th and (i+5)-th characters of "01101" aren't the same. You can't because there is no 1<=i<=0 so that i-th and (i+5)-th characters of "01101" aren't the same. So it is a period of the string "01101".
•  » » » » » 7 months ago, # ^ |   0 Yes. The formal way to state the same thing is concept of Vacuous Truth. Thanks anyways.
•  » » 7 months ago, # ^ |   0 yes that's what cost me the problem nothing was mentioned to deal fro p==n and I gave output so sad wording and missing details open to interpretation
 » 7 months ago, # |   +8 D is only about pen and paper :)
•  » » 7 months ago, # ^ |   +17 Representing the time with a vertical axis will help save quite a little ink and paper. Just two different approaches :)
 » 7 months ago, # |   0 hack for B: n=2,p=1,s=".."
•  » » 7 months ago, # ^ |   0 Yes.01??
 » 7 months ago, # |   +19 Problem E? What problem E? I don't see problem E but hundreds lines of my code for C & D.
•  » » 7 months ago, # ^ |   +5 I thought C is pretty simple? Just fill the first 25 rows with A, the last 25 rows with B, and change the cells with even row and even column until there's enough connected component of each type.
•  » » » 7 months ago, # ^ |   0 yeah ... I tunneled visioned real hard and tried to code a solution with 50 rows of A, fill holes for B C D, then fix A by chaining B C D holes together.
 » 7 months ago, # |   +42 Not a good contest.
•  » » 7 months ago, # ^ |   +22 Incorrectly estimated difficulties T^T
•  » » » 7 months ago, # ^ |   +1 Sometimes I hope that X-CPC regionals have some of their problems replaced by hard Div2 rounds.
•  » » » 7 months ago, # ^ |   +5 Don't worry, the problems are pretty fun :) I was also surprised to turn on and see no passed pretests for D and E 1 hour into the contest. I still think all problems are suitable for Div.2 users (though I might be wrong on E, will submit after systest).
 » 7 months ago, # |   -9 less than 1000 people worked out more than 2 problems
•  » » 7 months ago, # ^ |   +3 The real problem is less than 100 people solved D&E.
 » 7 months ago, # |   +26 C fucked me up, was there an easy way I missed? Can anyone explain the solution?
•  » » 7 months ago, # ^ |   +6 Not sure about simplest but this is how I did it. Use the whole 50x50 array. Fill in top half with A, bottom half with B. It sort of looks like a grid jail. Put C's and D's in alternating spots. Put remaining A's in bottom half and B's in top half.
•  » » 7 months ago, # ^ |   +3 You can paint the four squares of 25x25 like this:ABCDand then in the square with the A you paint the D's you need in the tiles with both x and y even, do this for the other three squares and you are done. It works because 25x24/4>100
•  » » » 7 months ago, # ^ |   0 Very cool. Interesting problem, but really hit or miss I think.
 » 7 months ago, # |   0 Does anybody know the possible hack for problem B?
•  » » 7 months ago, # ^ |   0 May be it will help u. I hacked some people by this test: 5 31..1.
•  » » » 7 months ago, # ^ |   0 What's the correct answer?Please tell me.
•  » » » » 7 months ago, # ^ |   0 There are four variants: 10011 10111 11010 11110
•  » » » » » 7 months ago, # ^ |   0 OK,then I'm right.
•  » » » 7 months ago, # ^ |   0 Thank you !
 » 7 months ago, # |   +4 In problem B, can p<=n condition be established? if p==n, 1<=p<=0 .
 » 7 months ago, # |   +24 D is very near to this one: D. Contact ATC
•  » » 7 months ago, # ^ |   +8 You can also observe that both problems were set by the same person... :)
•  » » » 7 months ago, # ^ | ← Rev. 2 →   0 LOL. So D was literally the 'upgraded version' of the older one.
•  » » » » 7 months ago, # ^ |   +3 In my opinion, today's one was easier.
•  » » 7 months ago, # ^ |   +15 Actually they are similar in statement only: solving one problem can't help you solve the other one.When I saw problem 989D - Лунная тень initially, I misread it and couldn't solve, but solved another problem instead. That is how 956D - Связь с диспетчером was created.
•  » » » 7 months ago, # ^ |   0 LOL. Which one you think is harder?
•  » » » » 7 months ago, # ^ |   +4 The one with airplanes.
 » 7 months ago, # |   +1 In question B, I got wrong answer in pretest 2 and I got penalty of 50 points. Wasn't it the rule that if your solution fails in pretests given in problem statement as samples then you won't get any penalty.Someone please clarify
•  » » 7 months ago, # ^ |   +6 only if it fails on pretest 1
•  » » » 7 months ago, # ^ |   0 Thanks for clarification!
•  » » 7 months ago, # ^ |   +1 only if it fails on 1st pretest,then you won't get any penalty.
•  » » 7 months ago, # ^ |   +1 This rule is applied for the first pretest only to prevent the loss of points due to submitting a solution for a problem other than the intended one by accident, if any submission passes the first pretest but failed in any other sample/pretest you'll lose 50 points.
 » 7 months ago, # |   0 I got WA because print one whitespace after the answer. (http://codeforces.com/contest/989/submission/39151664 WA) (http://codeforces.com/contest/989/submission/39155233 still WA) (http://codeforces.com/contest/989/submission/39155400 pretest passed)Umm.. Although this is my fault, I have never been wrong answered at least by writing '\n' or by inserting whitespace after the answer during every CF round I have participated in. I wasted few minutes(about 10min) and get one penalty because of this.Is it possible to remove my first wrong attempt? Or is this just my mistake?
•  » » 7 months ago, # ^ |   +8 I'm working on removal of such submissions.
•  » » » 7 months ago, # ^ |   0 Thanks XD
•  » » » 7 months ago, # ^ |   0 Additionally, I get 15min penalty on problem B, which correspondence with score 60. (Submitting #39151664 12min, pretest passed #39155400 27min.) is it possible to progress the system testing by #39151664 instead of #39155400?
•  » » » 7 months ago, # ^ |   0 ㅠ_ㅠ
 » 7 months ago, # |   +6 For problem B what's the answer if n == p?
•  » » 7 months ago, # ^ |   +8 print('No')
•  » » » 7 months ago, # ^ |   +6 Maybe I'm misunderstanding something in the statement. Can you help explain why p is period if p == n?
•  » » » » 7 months ago, # ^ |   0 if p == n, the whole string is the period and each position in the period appears only once, so whatever occurs there becomes the position of the period throughout the string.
•  » » » » 7 months ago, # ^ | ← Rev. 4 →   +3 You can think of it in terms of vacuous truth. if p == n there is no i such that i+p <= n, so all i's such that i+p<=n satisfy the property of s[i] == s[i+p] even though no such i's exist. Their count is 0, and 0 i's satisfy the previous property, so all these i's satisfy this property.
•  » » » » » 7 months ago, # ^ |   +8 Thanks all, I got it now.
•  » » » » » 7 months ago, # ^ | ← Rev. 2 →   -10 This is the most lame thing that can be added in a problem testing.Don't get offended but what was the setter trying to test by this thing?
•  » » 7 months ago, # ^ |   0 always No
•  » » 7 months ago, # ^ | ← Rev. 3 →   0 "No"Because the string must match the definition for all 1 ≤ i ≤ |s| - p s[i] == s[i+p]As 1 ≤ i ≤ 0 must be false, there does not exist an instance s[i] == s[i+p]Note: for all x P(x) is true means that there does not exist a P(x) that is false
•  » » 7 months ago, # ^ |   0 The answer would be no.
 » 7 months ago, # |   0 OMG second contest in a row i need 1 more second to press on submit button :D
 » 7 months ago, # |   +15 So, as it seems to me, this round was really strange...
 » 7 months ago, # | ← Rev. 2 →   0 In Problem B, if p == n, we get a strange inequality of 1 <= p <= 0. So I think this problem has error regardless of answer.
•  » » 7 months ago, # ^ | ← Rev. 2 →   0 I'm not sure how you derived this, but thinking about it from the perspective of the problem, this condition shows that the period = n, so the answer is always NO, since we can choose the periodic function to be whatever string is given. Clearly there is no logically inconsistency, so your formulation must be incorrect.
•  » » » 7 months ago, # ^ | ← Rev. 2 →   0 If p==n, Assuming this condition is true, then n values can not exist.
•  » » » » 7 months ago, # ^ |   0 I don't understand your logic, what do you mean they can't exist? There is no issue. Like if p=n=5, maybe we have 10101. Then we see a repeating pattern of 10101 every 5 (which is the whole string), so the answer is NO. What part of that logic are you disagreeing with? What doesn't exist??
•  » » 7 months ago, # ^ |   0 Yes it kind of amazes me that the setter penalizes for such a case which is ambigous.I was on the verge of solving C and then my solution got hacked due to this thing n==p and it never came to my mind that this could be the error.Really disgusting from a contestant point of view.
 » 7 months ago, # |   0 I have seen something "interesting".When you know your rating will decrease, you asked your friends to copy — paste solution to get skipped. Then your rating will not decrease xD
•  » » 7 months ago, # ^ |   +7 Ugly Bug in the system then
•  » » 7 months ago, # ^ |   +3 That's why cheaters should get banned (at least for a few contests)
 » 7 months ago, # |   0 i was using substr function in my solution for the given question and was getting a runtime error in the case , but when i did the basic implementation it worked, not getting the runtime error as even a string of 100 letters worked fine on my compiler here is my solution link can someone help
•  » » 7 months ago, # ^ | ← Rev. 2 →   +3 Try test "A". Since size() and length() are unsigned, 1 — 2 causes overflow, and your for loop runs from 0 to "infinity"
•  » » » 7 months ago, # ^ |   0 Got it, thanks for helping
 » 7 months ago, # | ← Rev. 2 →   0 in problem B the given statement is,a positive integer p is considered a period of string s if for all 1 ≤ i ≤ |s| — p, the i and (i + p)-th characters if s are the same.so, if p == n there is no valid i which satisfies the given condition, hence there is no valid period, so shouldn't the answer be "YES" is this case. Costed me four WA.Can anyone provide any explantion!!! thanks
•  » » 7 months ago, # ^ |   +5 In this case, give me i such that i and (i + p)-th characters in s are not same. You can't do it, so "for all 1 ≤ i ≤ |s| — p, the i and (i + p)-th characters if s are the same."
•  » » » 7 months ago, # ^ |   0 this is like going other way round!!!if there is no i for which any valid period can be formed (i.e all the i && i + p characters are same) how can we say that the whole string is a period.
•  » » » » 7 months ago, # ^ |   +8 String x and y are same if for every 1 <= i <= len(x), x[i] == y[i] Are x = '' and y = '' same ?
•  » » » » 7 months ago, # ^ |   +1 Proposition: every red crocodile can fly. It's true, because there are not any red crocodile.In this case: for every i in {1... |s| - p} i ans (i + p)-th characters in s are the same. That's true too, because there are not any counterexample. So, string is period because it fits the definition.
•  » » » » » 7 months ago, # ^ | ← Rev. 3 →   0 but I still can't understand. if p==|s|, can I find n(=|s|) satisfying 1<=p<=|s|-p(=0)? Which n satisfy this condition(n==p && 1<=p<=0)?
•  » » » » » » 7 months ago, # ^ |   +5 There are not any n, which satisfy your condition. So, your condition describes an empty set. And for every element in empty set, any statement is true. For example, that i and (i + p)-th characters are the same.
 » 7 months ago, # |   +4 'C' really made me crazy lol kkkkkkk was tough to me
 » 7 months ago, # | ← Rev. 2 →   0 I've written down several equations about Problem D, but thrown it away eventually. And I realized that wind speed is always positive after the contest. :P
•  » » 7 months ago, # ^ |   +3 It's not always positive though... the restriction is that absolute value is less than Wmax
•  » » » 7 months ago, # ^ |   0 Whhhhat? So constraint was just like http://codeforces.com/contest/956/problem/D, which was the original one I thought and I was still not able to manage it ;'(
 » 7 months ago, # |   0 Interesting problems, especially C. Can someone explain its solution?
•  » » 7 months ago, # ^ | ← Rev. 3 →   +3 AAAAAAAAAAAAAA...AAAXAXAXAXAXAXAXA...AXAAAAAAAAAAAAAAA...AAAXAXAXAXAXAXAXA...AXAAAAAAAAAAAAAAA...AAAXAXAXAXAXAXAXA...ABABBBBBBBBBBBBBB...BBBXBXBXBXBXBXBXB...BXBBBBBBBBBBBBBBB...BBBXBXBXBXBXBXBXB...BXBBBBBBBBBBBBBBB...BBBXBXBXBXBXBXBXB...BXBBBBBBBBBBBBBBB...BBBXBXBXBXBXBXBXB...BXBreplace X to A/B/C/D
•  » » 7 months ago, # ^ |   0 I made a 50x50 grid, so that upper left 25x25 is filled with A's, upper right with B's and so on. After that you can put the remaining components to the grid by replacing some 1x1 areas with them.
 » 7 months ago, # |   0 That may not be the problems called 'Stupid problems'.Thanks for your work @cyand1317!
 » 7 months ago, # |   +9 C is similar to this problem
•  » » 7 months ago, # ^ |   +28 Wow, my problem finally collided with an AtCoder one... Thanks for pointing out.
 » 7 months ago, # | ← Rev. 2 →   +13
•  » » 7 months ago, # ^ |   0 That's right.It's terrible.
 » 7 months ago, # |   0 Woaah... So many WAs on Problem B. :|
•  » » 7 months ago, # ^ |   0 A silly test case does this for you.
 » 7 months ago, # |   0 Why answer is "No" when p == n in B?
•  » » 7 months ago, # ^ |   0 Because you don't know what sequence is after N.
•  » » » 7 months ago, # ^ |   0 There is no sequence after N. So how can you say that "you don't know the sequence after N".
•  » » » » 7 months ago, # ^ |   0 By reading examples on B. so I can say actually that is based on intuition instead of reading the constraints on B very carefully. (without considering whether constraint is really wrong like commented below)
•  » » 7 months ago, # ^ | ← Rev. 2 →   +8 It should NOT be no. I sent a clarification about this mid round and here is the answer: Can you please clarify? Is the person that answered me wrong, or is it the testing? [EDIT] Or am I? cyand1317
•  » » » 7 months ago, # ^ |   +17 It is true that it's periodic, but problem asks if it's not periodic.
•  » » » » 7 months ago, # ^ |   +8 Thats right, thank you!
 » 7 months ago, # | ← Rev. 2 →   +3 Regardless of whether the answer is always No, I do not think that the problem is not valid because there is no |s| that has length satisfying p==(n=|s|) and 1<=p<=|s|-p.
 » 7 months ago, # |   +13
•  » » 7 months ago, # ^ |   +4 MRW I mistyped one variable in both A and B and the pretests didn't catch it.
•  » » » 7 months ago, # ^ |   0 Omg me too. I mistyped the array size in the last educational round (missed one extra zero), got ArrayIndexOutOfBoundsException :(
•  » » » 7 months ago, # ^ |   +25 At this rate my contribution will be higher than my rating :(
•  » » 7 months ago, # ^ |   0 One closing braces did all difference to me.....Time to leave Earth (:
 » 7 months ago, # | ← Rev. 3 →   0 And Problem B, Whyhttp://codeforces.com/contest/989/submission/39152340is Accepted?9 3 1010100014th and 7th is same so answer is No. but this source print 101010001. I try to hack this source, but console does not appear.
•  » » 7 months ago, # ^ |   0 Because s[i] = s[i+p] does not hold for all 1 <= i <= length(s) — p. For example, the 1st and 4th characters are different, so the above answer is acceptable.
•  » » » 7 months ago, # ^ |   0 Oh I misunderstand thanks :)
•  » » 7 months ago, # ^ |   0 1th and 4th aren't the same so p can't be period.
 » 7 months ago, # | ← Rev. 2 →   0 I have met C before this round in atcoder.So it's unfair to those who did not meet it before.
•  » » 7 months ago, # ^ |   0 :(
 » 7 months ago, # | ← Rev. 2 →   -8 Input: 3 2 .0. Output: 001(or 100) This test data for #B was not added in the system test. It's seems that many AC codes can't pass this data.
•  » » 7 months ago, # ^ |   0 But I think the answer is 'NO'
•  » » » 7 months ago, # ^ |   0 cause you can't change '0' to '1', you can only change '.' to '0'/'1'??Am I right?
•  » » » » 7 months ago, # ^ |   0 Sorry, I was too careless when I post the comment..
•  » » 7 months ago, # ^ |   0 We can't replace any digit that has already been given.
•  » » 7 months ago, # ^ |   0 You cannot change the tide information if it has been given.
 » 7 months ago, # |   0 continuing the saga of making silly mistakes by CF contestants in rated contests, this time award goes to me :D thankyou! thankyou! Is there any runner up ?
 » 7 months ago, # |   +8 and yet another hackforces round ends
 » 7 months ago, # |   +4 Where can I found problems like C? I need to practice problems like it, I am really slow with those problems
•  » » 7 months ago, # ^ |   +4 You're probably looking for problems about constructive algorithms then. Codeforces has many problems about them here. Not all of them are very similar to C, but some of them are.
 » 7 months ago, # |   0 Auto comment: topic has been updated by cyand1317 (previous revision, new revision, compare).
 » 7 months ago, # | ← Rev. 3 →   0 Can someone please help me with my submission for problem B (test case 31) ? http://codeforces.com/contest/989/submission/39155370EDIT:- when comparing character, I wrote if(c==1) instead of if(c=='1') and it costed WA.Damn :(. How the hell did it pass the pretests?
•  » » 7 months ago, # ^ |   0 Please note that the input has been truncated on the page. You may want to check your solution on smaller tests. You can also refer to the editorial.
•  » » » 7 months ago, # ^ | ← Rev. 2 →   0 I resubmitted the code only by changing if(c==1) to if(c=='1') and it passed the tests.Somehow if(c==1) passed pretests.Its just my bad luck.
 » 7 months ago, # |   0 Ok, I am really confused here, this submission:http://codeforces.com/contest/989/submission/39169572 gets runtime error on test 3 while this one:http://codeforces.com/contest/989/submission/39170689 gets AC. All I do is switch the condition i
•  » » 7 months ago, # ^ |   +9 .size() return unsigned number, so -2 will cause underflow. And thus it is nice to use macro such as this: #define sz(x) ((int)(x).size())
•  » » » 7 months ago, # ^ |   0 Ahh, now I understand. Thank you!
•  » » » » 7 months ago, # ^ |   +3 Most compilers will give you a warning though. Something about "signed/unsigned" comparision. Always try to make it a point to look at the warnings and see what they say. There's a reason why they are there ;)
•  » » » » » 7 months ago, # ^ |   0 Nice call! I compiled it with Xcode and it gave me a warning, I'll be more careful in the future.
 » 7 months ago, # |   0 Thank you for turquoise colored handle! :)
 » 7 months ago, # |   0 Finally blue :'( Thanks @cyand1317 for this wonderful contest.
•  » » 7 months ago, # ^ |   +1 It's not blue btw, it's cyan :)
•  » » » 7 months ago, # ^ |   0 lol yeah cyan. Thanks
•  » » » » 7 months ago, # ^ |   +1 Now we aim for real blue.. :D
•  » » » » » 7 months ago, # ^ |   0 hell yeah. can't wait for next round :D
•  » » » » » » 7 months ago, # ^ |   +1 Rise of the knights.
•  » » » » » » » 7 months ago, # ^ |   0 again*
•  » » » » » » » » 7 months ago, # ^ |   +1 Hhhhhhh, my bad.
•  » » » » » » » » » 7 months ago, # ^ |   0 can we have reacts on cf as on fb?
 » 7 months ago, # |   +10 It's however strongly recommended to read other problems if you're stuck, since you may not necessarily find later problems harder. Irony at its best.
 » 7 months ago, # |   0 I certainly didn't like the contest, statements were way too poetic, and more prescicely problem B's. Besides I performed extremely bad (not because the poems, of course). On the other hand I liked problem C (didn't solve it either).
•  » » 7 months ago, # ^ |   0 Though a valid definition, it would've been clearer if we had explicitly stated that p = n is a period. We'll try to make the statements even better in the future. Meanwhile, there is always the option to request a clarification during contest :)Best wishes.
 » 7 months ago, # |   +7 No DP or graph problems at all? :(
•  » » 7 months ago, # ^ |   0 problem E is
 » 7 months ago, # |   -37 Problem B is wrong for p == n. Should have been unrated.
•  » » 7 months ago, # ^ |   0 If (p==n) you should print "No",but not mentioned in the problem.
 » 7 months ago, # |   0 Can anyone explain problem E to me ??
 » 7 months ago, # |   +4 duliu
 » 7 months ago, # |   0 Your crafting.oj.uz ratings are also updated! We are seeking for a way to somehow differentiate the performance between the first and the 100th user, since currently both are the same because of the low RATEDBOUND s. If we just raise the bound, everybody's rating seems to be increased and this problem just occurs again.
 » 7 months ago, # |   0 Here and there, summer's in the air! (I beg your forgiveness, residents of the Southern Hemisphere... > <)Summers always in the air!! Brazil <3
•  » » 7 months ago, # ^ |   +5 The host of this FIFA World Cup must be jealous of your winter.