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

Автор Imakf, история, 7 месяцев назад, По-английски

Hello, Codeforces!

waaitg, Cocoly1990 and I are glad to invite you to Codeforces Round 906 (Div. 1) and Codeforces Round 906 (Div. 2), which will take place on Oct/28/2023 17:35 (Moscow time). In both divisions, you will be given 6 problems and 2 hours and 30 minutes to solve them all. Note that one of the tasks is split into two subtasks.

We would like to thank:

Score distribution:

Div. 2: $$$500$$$ — $$$750$$$ — $$$1250$$$ — $$$2000$$$ — $$$(1250 + 2500)$$$ — $$$3250$$$
Div. 1: $$$750$$$ — $$$1250$$$ — $$$(750 + 1500)$$$ — $$$2000$$$ — $$$3500$$$ — $$$3500$$$

As always, wish you all get a non-negative delta in this round!

UPD1: Editorial

UPD2: congratulations to the winners!

Winners and first solves
  • Проголосовать: нравится
  • +544
  • Проголосовать: не нравится

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

fuka round!

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

As a writer, I think this Round is very interesting.(btw, Please give me contribution.)

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

As a tester, problems are very cool! ><

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

Hoping that it would be a great contest

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

I hope it will be great contest and get more points.

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

First Div1 contest for me! Hope that i can solve at least one problem!

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

I am a newbie, could I take part in Div 2 and solve the easiest problem?

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

Contest timing clashes with El Clásico.

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

As a player, I wanna be red.

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

i was forced to test

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

Thanks for the early Score distribution lol:)

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

Chinese round at usual time. It's unusual, isn't it?

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

hope get positive rating delta

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

can't wait to become blue

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

.

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

    The contest was proposed more than 2 years ago, and one of the problems was accepted in another round from 2 years ago but ended up not being used.

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

      .

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

        Contests are not easy to make and require a lot of work, but there are many people who propose them. In fact, currently there is a long queue and you have to wait 1 year (for div2) and 3 months (for div1) to get a coordinator. Then, the preparation and testing phase is usually a few months long.

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

Imakf round!

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

This round time clashes with IEEEXtreme (which happens once a year) and many contestants can't do both!

Is it possible to delay this round by one day?

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

    just do that round since its once a year, this is just another regular cf round

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

I am new to this. Please advice a math book and algorithms book. I barely can solve even 1200 problems

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

    You don't need books, just pick a random problem and try to solve it. When you're stuck change problem or look editorial(read one statement and try to do left part yourself, if you couldn't, read one more, in the end code solution yourself). If you found anything you don't know in editorial just google it. cp-algorithmms and geeksforgeeks are good to learn topics.

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

    solved div2 AB feeling good

»
7 месяцев назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

Is it rated?

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +21 Проголосовать: не нравится
    How will everyone get non negative delta if it was rated
    • »
      »
      »
      7 месяцев назад, # ^ |
      Rev. 6   Проголосовать: нравится +13 Проголосовать: не нравится

      I think you wanted to write: "How will everyone get non-negative delta if it was unrated" but it's possible to everyone get non-negative delta if it was unrated.

      If it was unrated everyone would get 0(which is non-negative) delta.

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

Woah, i can see a lot of reds

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

i want rating!

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

Hoping for a lovely round!

»
7 месяцев назад, # |
  Проголосовать: нравится -78 Проголосовать: не нравится

Clashing with LeetCode Biweekly. Would skip this one.

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

Why do you schedule contests on the same day as IEEExtreme? T~T

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

Impossible wish: "you all get a non-negative delta in this round!"

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

i'm about to become pupil, good luck

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

Write this contest or watch football match Barcelona vs Real Madrid? let's vote

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

Grandmaster when?

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

Hope to be candidate master tonight! (last round I dropped to expert lol)

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

I've been consistently losing rating, wish for a positive rating change for me!!!

»
7 месяцев назад, # |
  Проголосовать: нравится -11 Проголосовать: не нравится

As a newbie, i am hoping to see more div4 rounds. They will help more newbies like me. Thank you

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

Hope IM.

Upd: Success!

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

All top 4( 3700 rating) registered for this contest.

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

Yes/No contest

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

6 WA for C Div. 2 C problem. i will get -100 delta :(((((

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

Back to Specialist :(

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

Hopefully expert

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

I chose not to participate in this contest because Imakf had published the editorials accidentally with just codes beforehand and it was there for around a minute or two. Looking at them gave me an unfair advantage in understanding the used data structures and algorithms. Entering the contest with those ideas would have been an act of cheating, so I decided not to participate. Instead, I did leetcode biweekly.

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

    LMAO fr?

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

    Could the authors/CF admins confirm whether the round will remain rated in light of this issue? I could understand unrating the round given that this is obviously a pretty significant issue (even though empirically, it's unclear whether this actually meaningfully affected the Div 1 standings; there weren't e.g. far more solutions to D-F than I would expect), but I'm hoping a decision is confirmed sooner rather than later since I'd rather not spend too much time wondering if I made 3300 today...

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

      The round is rated!

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

      And you did it, Congratulations Jay for this amazing performance!!!

      Excited to witness you in the Top 10 Rated Scoreboard in the future.

      I love your video solutions, so please keep them coming!!!

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

Why such a tight time limit in D and E1...

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится -9 Проголосовать: не нравится

    I guess that because they are linear complexity...

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

      I thought both of them are O(n log n), what are the linear solutions?

      Edit : I saw the editorial, and I can understand it now. Both problems and solutions are cool!

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

      Yeah, but on cf 1 second is really rare constraint, don't you think? Even linear problems have at least 2 second... I am not blaming, just curious, as i really would love to be a problem-setter one day

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

can E2 be done with bitmask dp?

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

how do you do C?

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

    Hint: Deque

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    Hint 1
    Hint 2
    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      How do you proof that this will work though, i thought about brute forcing it like this but couldn't proof it

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

        If 2 index are same then doing operation between them does nothing and doing an operation that don't cancel either one of them affects the rest elements outside them also. Rest was proofbyAC.

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

          I was mostly looking to bound the fact that less than 300 operations will work

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

    I simulated it with a string, we have i = 0 and j = n — 1 if i and j are both 0 then we add an 01 at j, if i and j are both 1 then we add 01 before i, and we stop once i >= j. Also, if n is odd then it is obviously no.

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

      And we need to make sure that no.of ones equal to no.of zeros. Than only we can make s good else we can't.

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

    If $$$n$$$ is odd or there isn't the same number of zeros as ones, the answer is $$$-1$$$.

    It seems that fixing the first and last element first with just doing operation at the beginning or end always works (I don't know proof).

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

How do you prove Div1A? I spent 30+ mins trying to prove the obvious approach and got no where before just deciding to try to proof by AC (which worked).

It feels way tougher than Div1B and C1. Div1B actually feels more like a typical Div1A to me in that sense — It requires one fairly simple observation which has a straightforward proof. I suspect the solve counts on it would be equal (if not higher) if their places had been swapped.

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

    prove it by ac lol

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

    for real

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

    Obviously, the string has the same number of $$$1$$$'s and $$$0$$$'s, so if you have the string $$$0xxx0$$$, you can add $$$01$$$ to the end, to get $$$0xxx001$$$, and "remove" the $$$0$$$ and $$$1$$$ from the edges, so you basically go from solving $$$0xxx0$$$ to solving $$$xxx00$$$ in one move (a rotation), and since the string is balanced, eventually you will find a $$$1$$$ to match out with the $$$0$$$ at the end. So at the end, it should take less than $$$n$$$ insertions

    The case with $$$1xxx1$$$ is similar, $$$1xxx1\rightarrow 011xxx1 \rightarrow 11xxx$$$

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

Finally I got negative delta -_-

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

No idea for C, brainstorming

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

How to solve C?

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

For C problem(Div 2)

answer exists when number of ones=number of zeroes in input string

but how do we construct answer ?

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

    Just simulate with a deque

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

    I used a deque to construct the final answer ..

    Explanation : whenever you have 0....0 then you can insert 01 at the end to balance the zeroes... --> 0....0 01 now the imbalanced part will be : 0 ....00 1
    as the 0 and 1 got balanced ..

    observation : 0....0 after balancing the conflicting zeroes the resulting string becomes 0 ....00 1 ie the next substring taken into consideration will be ....00

    dont' you think that it becomes the same as the first 0 has reached the last end...

    similarly for 1....1 the string will become 0 11.... 1 after inserting 01 at the beginning ..

    0....0 --> 0....0 01 --> 0 ...00 1

    1....1 --> 01 1....1 --> 0 11.... 0

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    • 3 observations we have for problem c.
      1. If no.of zeros not equal to no.of ones, we can't make s good.
      1. By using two pointer approach keeping start at 0 and end at s.size()-1, every time we check if start and end positoins are not equal continue 3.else if start and end are 1 insert 01 at start else insert 01 at end+1. keep running this until ur count reaches at max 300 times.
»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится +65 Проголосовать: не нравится

How to solve E faster than $$$\mathcal{O}(n\log(n))$$$?

Also, what's wrong with my solution to D? 230219737 It looks linear to me.

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 4   Проголосовать: нравится +62 Проголосовать: не нравится

    Ok, authors' solution (from editorial) to D works 998ms (time limit is 1s): 230265951. With other compiler 842ms: 230266166. After changing it to use vector like a human being instead of array operated like a stack both times go up.

    Authors' solution to E maybe takes 1247ms (230266784) out of 2s (yeah, that's already way too much) but it doesn't even use any vectors while there two damned trees on the input and we are supposed to create another graph and find SCC in it.

    I don't want to complain, but I actually do. These time limits are a joke (and they would be bad even for these squeezed model solutions, which shouldn't be optimized at all) and I strongly suffered because of them. I expect some action from authors or coordinators (or if I'm retarded and wrong somewhere tell me that).

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

      It's my fault. All the submissions from testing got AC comfortably, so I assumed the time limits were fine and I didn't check the running time of the official solutions.

      Next time I will double check.

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

        Thanks for sharing--incidentally, does anyone know why the authors' solution to D is so slow? My code (not optimized at all, makes full use of vectors) runs in 340ms, and a priori I'd be very surprised to see a linear solution with the given bounds take a full second.

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

          The solution runs in 514 ms on Polygon (with C++17). Right now I don't know why it becomes so slow on C++20, maybe it's because of the input.

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

      I'm sorry. But it is strange that on polygon the intended solutions do run faster or inconsistently, compared to on main site.

      For D, intended solution runs 498ms (with stacks and without any optimization), and one of the testers runs <= 220ms. Considering the implementation for this problem are barely the same for most people, we set the TL to 1s.

      For E, intended solution runs 888ms, and errorgorn's HLD solution runs 795ms. Anyway, for this problem, the TL is tight. It's better to set 4s. I apologize for that.

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

        I'd rather win a round than get an apology, but shit happens. Problems were nice anyway, so don't give up.

      • »
        »
        »
        »
        7 месяцев назад, # ^ |
        Rev. 2   Проголосовать: нравится +69 Проголосовать: не нравится

        Maybe it’s good to say something constructive. Every time when I hear that someone is choosing the time limits to (constant)*(model solution) I lose my mind — it doesn’t work like that at all, it strongly depends on the problem. To choose the time limits you should have possibly many approaches implemented and consider why some of them are slower than the others and what do you want to expect or/and at least consider “what actually could people do in this problem”, like “is it tempting to do something more complicated?” or “is it tempting to repeat something three times?”. For example in yesterday’s E it would be “what if someone wants to create graph with vertices not only for each power of 2 jump, but also extra ones for each edge and vertex of the trees?”. I wouldn’t solve that this way, but I wouldn’t say that it’s impossible.

        Errichto once told me something that works in theory and is kind of automatic. He said that a good way is to set the time limit to be equal to the geometric mean between the slowest solution that we want to allow to pass and the fastest that we don’t want to pass. In practice it doesn’t work like that. An example is a problem with $$$\mathcal{O}(n\log(n))$$$ model solution and slower $$$\mathcal{O}(n\sqrt{n})$$$ solution — it might be a case that we’d have to accept the fact that the squeezed slower one might pass to make the model one pass comfortably (or try to change the problem/limits to fix the issue if it’s possible). For example in yesterday’s D such solution is probably link-cut based — I guess you wanted to don’t let it pass, that’s ok, but I don’t think that 1 second is really necessary to do it with one million numbers on the input.

        About time limits in the round there is also a general stuff. I think if someone asks about most classic most popular cf time limit, the answer is “2 seconds”. So I’m surprised that time limits set to 1 second in many problems where the solution isn’t something that would obviously take zero time (like $$$\mathcal{O}(1)$$$ or $$$\mathcal{O}(factorization)$$$ for $$$n$$$ up to $$$1e9$$$) didn’t bring any attention. Also these 2 seconds are meant for the problems which don’t do anything crazy and problem with $$$\mathcal{O}(n\log(n))$$$ size tree-structure sounds way more complicated. So I don’t think that either 2s for D or 4s for E are automatically good choices.

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

      I think your solution's slow runtime on D (as well as the authors') is caused by an I/O bottleneck. I resubmitted your first skipped solution using cin/cout with standard optimizations (ios_base::sync_with_stdio(0); cin.tie(0);) and then with the original code (in case the slow runtime was caused by poor server performance during the contest). See below (first two results are your solution, next two are with cin/cout):  Switching to cin/cout cuts your runtime by about 500ms, easily fitting your solution into the time limit.

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

        What's if my solution would do something more complicated but still linear?

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

          I'm not taking a position on whether the time limit was appropriate--I was just curious about why linear solutions were running so close to the 1s time limit, and once I figured it out I wanted to post in case anyone else had the same question.

    • »
      »
      »
      7 месяцев назад, # ^ |
      Rev. 2   Проголосовать: нравится +49 Проголосовать: не нравится

      The author's solution is hacked (tl). Hack And Benq's solution during the contest also didn't survive.

      And the hack test case is not even carefully constructed. It's just two random chains. I didn't see the TL of this problem make any sense. And it's totally unfair that heavy-light decomposition can pass this problem and binary lifting can't.

      Although I didn't solve this problem during the contest, I feel it's better to rejudge this problem with a larger TL.

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

        Did something happen about it? Model solution not working sounds serious

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

      I went here to check if you complained (and if not to complain myself).

      There is a tendency for Chinese authors to write insane constant optimized solutions and then set TL 2x (or worse) from them. I remember one ptz contest where the bottleneck was calculating nimber multiplication, and TL was set as 1.5x from a solution that uses the fastest nimber multiplication code from yusupo judge.

      I don't want any rejudges or anything, but I want coordinators to check those kinds of things.

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

D's idea ?

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

    Always use 1 and try greedy

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

    If you can merge index x and y then you can merge 1 with x or 1 with y. By contradiction assume that you cannot. So ax < cx and ay < cy. Adding : ax+ay < c(x+y) < c.x.y. A contradiction. x+y < x.y for all positive x,y. Except for x = y = 1

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

For Problem C Div-2 : Who else overthinked and overkilled just by ignoring n<=100 constraint..??

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

    haha me) The problem is quite easy with simple insert.

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

    Ohh was it 100?? I literally assumed n of the order of 105 Now it makes sense why the construction is possible within 300 operations

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

bad task div1 C

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

timelimit on E1 so tight (for python atleast) ;(

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

any E ideas? I try scnaline, but, not working for me :)

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

Why always use 1 works for div2D?

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

Why do I suck at greedy problems like D?

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

Can someone explain the idea behind the problem A in div2

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

    ans=Yes if all elements are same ans=No if no of unique elements>=3 in case of two distinct elements ans=Yes if min(frequency(elem 1),frequency(elem 2))=n/2 answer will be of form a b a b a b...

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

20 points away from CM...

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

Casting an ancient curse on Div. 2 problem C authors.

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

    Hey, that's my line!

    Honestly I think that C is not that bad, D however seems a bit troll: 2000 points for a problem where you can just connect the first node with any of the nodes that come after it (not even a real graph problem, just a tiny bit of math).

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

      Sorry for stealing your line =)

      My take on it is that figuring out why connecting everything to the first node in D is correct is much better than calculating all the correct indices on every iteration of C.

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

E2 was easy just read the constraints k<=10 bruh

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

What is this message? I was so scared thinking my fraud solutions were exposed and hacked manually by authors

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

Test cases are very weak for Div.1 B, my solution for B passed even on using int, should not this test case be available in pretests

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

screwed up so bad lol

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

1D is one of my favorite problems I've solved in a long time. I was working towards a totally different solution path when I realized that we could drop cycles to solve the problem in one move, at which point I spent several minutes thinking to myself about how cool that observation is before going to implement. Thanks to the authors!

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

https://codeforces.com/submissions/jiangbowen/contest/1889

Imagine solving C2 and getting FST on C1 lol

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

Thanks for this awesome Div2 round <3 ....

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

It was a very interesting round! Thanks to the Authors!

»
7 месяцев назад, # |
Rev. 4   Проголосовать: нравится -19 Проголосовать: не нравится

Guys, here is my submission for Div2 — E1 problem. It says TLE however, I can see there is output printed for the TLE testcase

MikeMirzayanov Cocoly1990 Imakf waaitg , this looks like a linear time-complexity difference. Can you guys help here. I think increasing time-limit in such problems will help ??

Also the below 2 submissions for the problem have same codes. But you can see that the problem have different TLE failing test-cases. Submission 1: https://codeforces.com/contest/1890/submission/230270545 Submission 2: https://codeforces.com/contest/1890/submission/230272906

Please help here guys /\

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
Easisest solution for C :   (claim : total_operation <= 50)
    Pre-requiite : observation

    When you see the operation, insert '01' what it means?
             :-> Assume it is like a bracket () , 0 -> +1 , 1 -> -1
                 you can create a Perfect bracket sequence with the operation? (sounds cool)
                 Some property :  pref_sum >=0 , at last pref_sum =0
    Now, lets solve the Problem:
             one pointer at the left end , one at right end
             if(s[i]!=s[j]) -> we can continue,and move the pointer respectively
             otherwise, both is '1' or '0'
                 let '1' : we make pref =0, 
                           when we have an subarray whose pref=0 -> we can compensate it
                           otherwise not possible
                           Now you are confused that from which side we check for pref=0 condition
                           it turns out that  for '1' check from right pointer
                                              for '0' check from the left pointer
                 vice-versa for '0'

            Yaa We are done :

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

It Indeed Was A Great Contest :) :)

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

It was soo cool

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

Thanks for the nice Div2 round. I'm finally CMMMMMMMM.

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

is it too much to ask for another 6 points to become cyan :(

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

I hate Doremy

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

Thanks for such an amazing round! The tasks were truly enjoyable!

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

Very interesting round, thank you!

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

Finally, I became a master. Thank you for this interesting round!!!

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

Div 2, in Problem C only 1 operation insert 01 but in Editorial can insert 10 ?

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    q.push_front('1');
    q.push_front('0');
    

    If you mean this lines, you have to read it carefully, he is pushing 1 to front first then 0 So it's inserting '01' at front but step by step.

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

problems are good, but i think it could be better to include the statement ("not necessarily adjacent") in div2 E . i thought that the days should be consecutive and fell into wrong idea.

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

In problem B, how is 1010101 a bad string ?? (test case 4)

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

    t=1010101 is a good string. However s=101100 is not a good string, and you cannot make it a good string by inserting t (as often as you want). This is because s contains the substring 11 and even inserting t between those two 1s doesn't help as t both starts and ends with 1, i.e. you just end up again with the substring 11 after inserting t.

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

The div2 C's implement is not easy...

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

Wow my first time First Solve . Div2B

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

why did the space come in qingshan loves strings 2 -1st output?

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

Dear Imakf in this contest . I just do a copy paste from a user in [problem:1890B]question .I am very regreatfull for that inccident.I am making you sure that i will be never happend again. Please do not ban my account.