Блог пользователя cyand1317

Автор cyand1317, история, 6 лет назад, По-английски

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!

Div. 2 Top 5

  1. olphe
  2. jorik
  3. amnesiac_dusk
  4. UtahaS3npai
  5. espr1t

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
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится +95 Проголосовать: не нравится

Cool announcement.

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +75 Проголосовать: не нравится

We need more announcements like this

This is the best round announcement ever

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It says that first division will be out of competition. Even 1900-2099 ?

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Can you share the two round number you are talking about?

»
6 лет назад, # |
  Проголосовать: нравится 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...

»
6 лет назад, # |
Rev. 3   Проголосовать: нравится +23 Проголосовать: не нравится

Programming Contest is my drug.

Codeforces is my dealer.

Thanks Codeforce for two consecutive contests in two consecutive days.

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +25 Проголосовать: не нравится

Is it true or not that 300iq have 300iq?

»
6 лет назад, # |
  Проголосовать: нравится +59 Проголосовать: не нравится

the super-ultra-great-delicious-wonderful testers. Delicious ???

»
6 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

It is your way of writing that is awesomazing :D LIKE THIS ANNOUNCEMENT <3

»
6 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

cyand1317's round again!

»
6 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

it's will be nice contest for every participants

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +2 Проголосовать: не нравится

Hmmm.So bot[Noam] is replacing Human as Problem Setter :P

Only Discord Server will get it xD

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

Friends are the worst.

»
6 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Hope everyone could play the game well.Besides,how to increase my contribution?My contribution is below 0.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

cyand1317, you could change time and date as per this comment

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Looking forward to this contest, good luck and high ratings.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Best announcement on CF!!!

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

My rating have just become 2101 after the educational round in yesterday. This round suddenly becomes unrated to me :(

»
6 лет назад, # |
  Проголосовать: нравится 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

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Will Mio and Yuko be the characters of problem statements?

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Is there a hacking round in this? If yes, what are the rules regarding the same?

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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.

  • »
    »
    6 лет назад, # ^ |
    Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

    Yes. EDIT:

    Only the normal room hacking.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Huge problem statements -_-

»
6 лет назад, # |
  Проголосовать: нравится +18 Проголосовать: не нравится

1hour passed && only 1 Pretest Passed on problem D!.Really?Is it Div2 Contest?Or Typical Chinese round??

»
6 лет назад, # |
  Проголосовать: нравится +44 Проголосовать: не нравится

OMG, Prob.D&E is too hard...!

»
6 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

problem E will give nightfall to everybody

»
6 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

1324 hacked

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

What's the intended solution for E? I had idea for matrix exponentiation, but was getting WA on 3 :/

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 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

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve c?

  • »
    »
    6 лет назад, # ^ |
    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
    
    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      thanks for the help :).

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 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 ?

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +8 Проголосовать: не нравится

      Wooow !! Such an elegant construction

  • »
    »
    6 лет назад, # ^ |
    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

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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
    
»
6 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

how it is possible that in Problem-2 output for test case 2 2 .. is no?

  • »
    »
    6 лет назад, # ^ |
    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.

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 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?

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится 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".

»
6 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

D is only about pen and paper :)

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +17 Проголосовать: не нравится

    Representing the time with a vertical axis will help save quite a little ink and paper. Just two different approaches :)

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

hack for B: n=2,p=1,s=".."

»
6 лет назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

Problem E? What problem E? I don't see problem E but hundreds lines of my code for C & D.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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.

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 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.

»
6 лет назад, # |
  Проголосовать: нравится +42 Проголосовать: не нравится

Not a good contest.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +22 Проголосовать: не нравится

    Incorrectly estimated difficulties T^T

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      Sometimes I hope that X-CPC regionals have some of their problems replaced by hard Div2 rounds.

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +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).

»
6 лет назад, # |
  Проголосовать: нравится -9 Проголосовать: не нравится

less than 1000 people worked out more than 2 problems

»
6 лет назад, # |
  Проголосовать: нравится +26 Проголосовать: не нравится

C fucked me up, was there an easy way I missed? Can anyone explain the solution?

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    You can paint the four squares of 25x25 like this:

    AB

    CD

    and 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

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Does anybody know the possible hack for problem B?

»
6 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

In problem B, can p<=n condition be established? if p==n, 1<=p<=0 .

»
6 лет назад, # |
  Проголосовать: нравится +24 Проголосовать: не нравится

D is very near to this one: D. Contact ATC

»
6 лет назад, # |
  Проголосовать: нравится +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

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +6 Проголосовать: не нравится

    only if it fails on pretest 1

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    only if it fails on 1st pretest,then you won't get any penalty.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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.

»
6 лет назад, # |
  Проголосовать: нравится 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?

»
6 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

For problem B what's the answer if n == p?

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    print('No')

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +6 Проголосовать: не нравится

      Maybe I'm misunderstanding something in the statement. Can you help explain why p is period if p == n?

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится 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.

      • »
        »
        »
        »
        6 лет назад, # ^ |
        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.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    always No

  • »
    »
    6 лет назад, # ^ |
    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

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    The answer would be no.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

OMG second contest in a row i need 1 more second to press on submit button :D

»
6 лет назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

So, as it seems to me, this round was really strange...

»
6 лет назад, # |
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.

  • »
    »
    6 лет назад, # ^ |
    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.

    • »
      »
      »
      6 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      If p==n, Assuming this condition is true, then n values can not exist.

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится 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??

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 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.

»
6 лет назад, # |
  Проголосовать: нравится 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

»
6 лет назад, # |
  Проголосовать: нравится 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

»
6 лет назад, # |
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

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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."

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 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.

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится +8 Проголосовать: не нравится

        String x and y are same if for every 1 <= i <= len(x), x[i] == y[i] Are x = '' and y = '' same ?

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится +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.

        • »
          »
          »
          »
          »
          6 лет назад, # ^ |
          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)?

          • »
            »
            »
            »
            »
            »
            6 лет назад, # ^ |
              Проголосовать: нравится +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.

»
6 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

'C' really made me crazy lol kkkkkkk was tough to me

»
6 лет назад, # |
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

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Interesting problems, especially C. Can someone explain its solution?

  • »
    »
    6 лет назад, # ^ |
    Rev. 3   Проголосовать: нравится +3 Проголосовать: не нравится

    AAAAAAAAAAAAAA...AAA

    XAXAXAXAXAXAXA...AXA

    AAAAAAAAAAAAAA...AAA

    XAXAXAXAXAXAXA...AXA

    AAAAAAAAAAAAAA...AAA

    XAXAXAXAXAXAXA...ABA

    BBBBBBBBBBBBBB...BBB

    XBXBXBXBXBXBXB...BXB

    BBBBBBBBBBBBBB...BBB

    XBXBXBXBXBXBXB...BXB

    BBBBBBBBBBBBBB...BBB

    XBXBXBXBXBXBXB...BXB

    BBBBBBBBBBBBBB...BBB

    XBXBXBXBXBXBXB...BXB

    replace X to A/B/C/D

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 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.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

That may not be the problems called 'Stupid problems'.Thanks for your work @cyand1317!

»
6 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

C is similar to this problem

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +13 Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Woaah... So many WAs on Problem B. :|

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why answer is "No" when p == n in B?

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Because you don't know what sequence is after N.

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      There is no sequence after N. So how can you say that "you don't know the sequence after N".

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится 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)

  • »
    »
    6 лет назад, # ^ |
    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

»
6 лет назад, # |
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.

»
6 лет назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +4 Проголосовать: не нравится

    MRW I mistyped one variable in both A and B and the pretests didn't catch it.

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Omg me too. I mistyped the array size in the last educational round (missed one extra zero), got ArrayIndexOutOfBoundsException :(

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +25 Проголосовать: не нравится

      At this rate my contribution will be higher than my rating :(

»
6 лет назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

And Problem B, Why

http://codeforces.com/contest/989/submission/39152340

is Accepted?

9 3 101010001

4th and 7th is same so answer is No. but this source print 101010001. I try to hack this source, but console does not appear.

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится -8 Проголосовать: не нравится

Отличный контест. Спасибо авторам

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

I have met C before this round in atcoder.So it's unfair to those who did not meet it before.

»
6 лет назад, # |
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.

»
6 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

and yet another hackforces round ends

»
6 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Where can I found problems like C? I need to practice problems like it, I am really slow with those problems

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by cyand1317 (previous revision, new revision, compare).

»
6 лет назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

Can someone please help me with my submission for problem B (test case 31) ? http://codeforces.com/contest/989/submission/39155370

EDIT:- 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?

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 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.

    • »
      »
      »
      6 лет назад, # ^ |
      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.

»
6 лет назад, # |
  Проголосовать: нравится 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<s.size()-2 to i+2<s.size(), why are they not equivalent? I spent nearly an hour of the contest trying to figure out my mistake, can anybody tell me why this happens so I don´t do it again?

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +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())

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Ahh, now I understand. Thank you!

      • »
        »
        »
        »
        6 лет назад, # ^ |
          Проголосовать: нравится +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 ;)

        • »
          »
          »
          »
          »
          6 лет назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          Nice call! I compiled it with Xcode and it gave me a warning, I'll be more careful in the future.

»
6 лет назад, # |
  Проголосовать: нравится -23 Проголосовать: не нравится

В том дело что участник den_tar списал у меня код, поскольку ми находились в одной комнате. А про совпадения в решений с участником vera2005, я ничего не знаю, скорее всего это просто случайность.

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

deleted

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Finally blue :'( Thanks @cyand1317 for this wonderful contest.

»
6 лет назад, # |
  Проголосовать: нравится +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.

»
6 лет назад, # |
  Проголосовать: нравится 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).

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 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.

»
6 лет назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

No DP or graph problems at all? :(

»
6 лет назад, # |
  Проголосовать: нравится -37 Проголосовать: не нравится

Problem B is wrong for p == n. Should have been unrated.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone explain problem E to me ??

»
6 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

duliu

»
6 лет назад, # |
  Проголосовать: нравится 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