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

Автор FieryPhoenix, 4 года назад, По-английски

Moo! (Hello Codeforces!)

I’m very excited to invite you to Codeforces Round 621 (Div. 1 + Div. 2), which will take place on 17.02.2020 18:35 (Московское время).

In this round, you will be helping Farmer John and his prized cow Bessie cowmplete some fun tasks.

The contest will have 7 problems and is combined and rated for both divisions. The duration is 2 hours and 15 minutes. The problems are prepared by me (FieryPhoenix) and dragonslayerintraining. We tried very hard to make them interesting and hope that you will enjoy them too!

This round would not have been possible without the wonderful coordination by adedalic and cdkrot. Thank you so much to the testers as well for all the invaluable advice: tmwilliamlin168, walnutwaldo20, nikolapesic2802, bfs.07, Rods, lynmisakura, JustasLe, and hocky. As always, thanks to MikeMirzayanov for the best systems Codeforces and Polygon.

Good luck and more importantly, have fun and learn something new!

UPD: The scoring distribution is 500 — 1000 — 1500 — 2000 — 2500 — 3000 — 3500

UPD: Editorial

UPD: Thank you for participating! Huge congratulations to the winners!

  1. jqdai0815

  2. 300iq

  3. ohweonfire

  4. yosupo

  5. ksun48

  • Проголосовать: нравится
  • +547
  • Проголосовать: не нравится

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

"Moo" as greetings is epic move

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

Farmer John? USACO Web 1.0 training site throwbacks

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

i love you

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

Farmer John comes to codeforces! Anyway, thanks for the later start time, I know we’re pretty under represented here in the Pacific coast, but it feels really nice to finally have a time that is not before 6:30 a.m.. Hoping for a great contest!

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

    The contests are still always in the morning for US people, which is a disadvantage for people who aren't morning people and people who have to work/go to class. It would be nice to change up the start times more like Project Euler does.

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

      Today US people are grateful to George Washington for taking away that disadvantage.

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

    btw, do you know any sites similar to Codeforces that host contests more accessible to Pacific coast people?

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

I always feel so grateful that there are always people dedicate their time and efforts and come up with cool problems and contests so we can all participate regularly enough. Love Codeforces, love you guys <3 <3.

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

william lin <3

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

S. Americans

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

Contest ID 1306 has gone..

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

[deleted]

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

The "MOO!" is so kind! Hope for a USACO round!

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

Thanks for codeforces and authors of this contest!Good luck everyone!

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

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

Btw why it is combined?

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

    I second this question. Combined makes hacking more extreme, adds two impossible problems for div2, while for div1 it adds two trivial problems where reading speed matters most.

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

      makes hacking more extreme

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

      I agree with most of the criticism, but a few counterpoints/clarifications:

      What is wrong with hacking being more extreme? Are you saying this gives extra incentives for div1 people to focus on hacking rather than solving new problems? If that's the argument, then I think it's valid. But hacking as a general concept isn't bad, and it isn't immediately apparent why more of it would be a negative thing.

      I agree that the problems added for div1 are annoying, but I personally know people who have studied algorithms to graduate level and beyond who don't often compete in contests that would likely not do well in a normal div2 contest because of slow speed, but may do better on a div1+div2 combined contest. Perhaps such people are not numerous enough to warrant the combined contest, though.

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

        I agree with most of the criticism, but a few counterpoints/clarifications

        He didnt said much. There is a long discussion on cf (which I failed to find) with a conclusion that combined rounds should be avoided as far as possible. Both comments were made keeping that in mind.

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

      In the end we decided to make round combined due to unique reasons relating to problem difficulties and contest duration.

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

My second contest! Hope, I will be "blue" after it

Good luck to all participants :)

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

USACO2020 February Contest extra round :)

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

Daily contest : CF Round 620 / ABC 155 / CF Round 621 :)

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

I think this is Div.3 because Div.1 plus Div.2 is equal to Div.3 :))

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

What is the difference between codeforces global round and codeforces combined round?

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

    I think the global rounds were a special edition sponsored by some company or something, the combined ones are regular rounds.

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

can anyone explain about problem hacking ?

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

    hacking is to give a testcase that makes a solution to a participant fail(i.e Wrong Answer,runtime error, time limit exceeded)

    who is the defender

    the owner of the code that you try to hack

    what does he do

    he do nothing ,if his solution is absolutely correct then no one can hack his code

    how to hack

    On the dashboard, click the padlock icon for locking a problem (Note, that you can not send your solution for a problem after locking it). Then go to room results, where you can see roommates codes for the problems you've already locked (you can see a certain solution by double clicking on it in the room results table). After you've opened someone's solution, you can consider it and then hack it. When hacking a code, you're entering some testcase on which that code is most likely going to fail (it may be wrong answer, or running out of time/memory limit). When you want to enter a large testcase, you can send test generator instead of typing it. Test generator must be your program which produces a file with a testcase in it. After hacking a code, you can see hacking results. There are two possible outcomes: "Successful hack" — it means the code failed, and you're rewarded with 100 points for that. Otherwise, it's "Unsuccessful hack" (the code did not fail) and you get minus 50 points for that.

    quoted from kingofnumbers

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

      it was obscure to me thanks

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

      God Bless Our King

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

      Is one only vulnerable to hacking if he/she locks his/her own problem? Or is everyone in the room vulnerable?

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

        if you lock your problem you can hack anyone in your room

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

        As stated above, only those who lock their problem can hack (others in their 'room'). Conversely, you are vulnerable to getting hacked by those who do, regardless of whether or not you have locked your problem.

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

hope it will not include mo's algorithm as cow bessie is here .

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

You shouldn't have Bessie and Farmer John cowmplete tasks in a Codeforces contest.

At this rate, they won't have enough time for the upcoming USACO contest!

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

Finally a contest not during school!

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

What is "div1+div2"?

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

as this contest is for both div 1&2, will different rating algorithm be used for this contest??

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

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

When the round is (Div. 1 + Div. 2) is the levels of the problems Div. 1 or Div.2 or Div. 3÷2?

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

Is it rated?

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

The time is not friendly to the Chinese

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

Score distribution??

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

Focus on the new red rating point!

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

Standard scoreboard

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

phục hận gang

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

let's help farmer and his cow xD

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

tourist isn't that good anymore lol

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

This is probably the first time I leave the contest in the middle just because of boredom. Thank you, problem E statement.

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

    E was actually pretty nice imho. Even though it seems like some tedious crap at first, it turns out to have a clean non-trivial non-magic non-standard solution.

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

      Did I miss something on E? It seems like the solution is just "choose one cow to be the cow on the left who moves furthest to the right" and do a O(M) scan to find how many assignments of cows satisfy that criteria. Implementation wasn't the nicest.

      Then again, I probably missed some implementation tricks.

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

        I did exactly that (more precisely, for each scan, look at each sweetness group, count the number of cows in that sweetness group that can go to the left, how many to the right and how many to both).

        Idk, I thought it was cool. Implementation isn't nice, but I definitely wouldn't call the problem boring.

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

        Yeah, you always have to choose the last cow from the left, but then you have the following problem: choose some points from the "left part" and "right part" such that for each given pair $$$(l_i, r_i)$$$, the situation where $$$l_i$$$ is chosen from the left part and $$$r_i$$$ from the right part simultaneously never happens, $$$S_{l_i}$$$ for all chosen $$$l_i$$$ are all distinct and similarly for $$$S_{r_i}$$$. The pairs are sleeping places of cows.

        The implementation of the rest is simple (~25 LOC for me): group cows by $$$f$$$ and for each value of $$$f$$$, find the number of pairs $$$(l_i, r_i)$$$ that 1. lie in the (left part, right part), 2. (in the left part, out of the right) and 3. (out of the left, in the right part); then, the number of ways to choose 2 cows is $$$(n_1+n_2)\cdot(n_1+n_3)-n_1$$$, and if that's 0, then $$$2n_1+n_2+n_3$$$ is the number of ways to choose 1 cow. It's $$$O(N)$$$. The value of $$$f$$$ for the chosen last cow from the left is handled separately and even more easily.

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

      I read it several times and still could not understand the setup :( Probably spent too much time at countryside to perceive cow problems abstractly...

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

        Maybe I just had luck reading it. I agree that the statement is ugggh.

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

Bessie and John, come like a wind

Magically, stop right here

Left us with, a great contest

Chaotic, yet arousing.

Bessie and John, left like a dream

Where are you, the green of grass (AC)

Left us with, yellow results (WA)

Magically, rating gone.

(Written by a contestant, who find the beauty of Literature in CP)

P/s: We need a way to make a paragraph in CF comments, it will promote poetry in CF.

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

What the ...

MiFaFaOvO (or dls) AK this contest when there are still an hour to go?

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

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

E problem

The moment a cow eats hi units, it will fall asleep there, preventing further cows from passing it from both directions.

Meanwhile Indian cows: You guys can do that?

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

hashtag TouristSoldier you're still number one in our hearts tourist

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

jqdai0815 for president!

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

One of my most bad rounds so far, predictor says aprox -120...

Was not able to solve B and not C. Feels sic. :/

Edit: And how redicolus simple the solution to B is, omg.

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

Hacks for B and D?

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

Pretest 9 for E?

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

what is pretest 9 in D??

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

Did anyone else solve problem D using binary search on the answer and segment tree? :( Overkill

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

How to solve D?

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

    Find distances from vertex 0 and vertex n — 1 to all the others using BFS. Now sort the special vertices according to the distance to source. Iterate over all the special vertices except the last one. For each of them find the best "pair" : the vertex that is not closer to the first vertex than the one currently being considered, and that is as far from the last vertex as possible (you can build an array of suffix maximums to do this step in O(1) ). Now using the distances we computed, just get the length of the shortest path with this vertex added. The rest is trivial.

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

what is pretest 15 in D?

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

    Maybe it will be like this: Shortest path from field 1 to field n has no special field, but when added one road the answer charges.

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

When real master reveals his real ability

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

There is a problem about problem E:

"Two sides" means which of the pictures below?

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

    If I understand correctly, the "two sides" means the top picture.

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

      In fact it means the first picture, and a lot of my friends including myself misunderstood the statement.

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

    And in addition, You can pass the samples whether or not you misunderstand the statement. And you will probably get WA on pretest 9 if you misunderstand it.

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

What's the expected complexity in F? My $$$O((n+q) \cdot \log(n))$$$ times out.

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

    I got AC (71329978) with $$$\mathcal{O}((n + q) \log n)$$$ in 670ms.

    I had one HLD path query and two binary searches on the path array per input query.

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

Try to hack my $$$O(k^2)$$$ for D: 71334468

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

    But why it passed as per constraints this must fail or time out. I do not tried just because I was not getting approach less than O(k^2) complexity!!

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

can someone explain why this solution gives runtime error on pretest1 .Solution using vectors... and the next submission using arrays passed please explain!!! Solution using arrays.

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

How to solve D?

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

What is the reason for 1 second TL for E? Can you please explain?

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

    Absolutely +1 to this question.

    Had to spend 5 minutes making non-asymptotical optimizations to my Kotlin solution.

    Meanwhile, a cubic solution wouldn't fit into 2 seconds either.

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

    It seemed tight to me at first too, but with $$$O(N)$$$ arrays + most passes being linear, cache efficiency is high and $$$N^2$$$ is just 25 million.

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

      With modulo operations it does not work so fine.

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

        25 million modulos = 0.37 s locally (admittedly 64-bit, but also weaker than CF machines) and that's supposed to be the heaviest thing in the $$$O(N^2)$$$ solution.

        If 25 million modulos are a serious threat of exceeding TL for a solution that doesn't use anything else slow, that's a problem. Who knows, we'll see.

        UPD: Yep, the same time for modulo and under 0.5 s worst case.

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

        Isn't your solution complexity $$$O(N^2 log MOD)$$$ ? This is almost billion modulo operations, which is really big amount.

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

          Nope, it's not. Values till n are memoized and I am counting inversed values only for these values.

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

Problem E:

Two sides, the left and the right. Hmmm...that's it!

image.png

And this can pass all 4 examples.

Have to say goodbye to legendary grandmatster :(

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

    I am very sorry that this was unclear, and we did not receive a single question about it. Best of luck on future rounds!

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

tourist solved the first problem in less than a minute :O I didnt even read the problem statement in that time (probably my page also not opened by then :P )

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

I tried something different for G, I take the edges (u,v,w) such that d[v]-d[u]=w. Then find the mincut in this graph. This gives us the edges whose weight we should increase simultaneously to increase the length of shortest path. So if the remove these edges and again run a dijisktra than the distance of nth node should give us the weight until when we need to keep increasing the weights of the edges of mincut and we can stop this process if the nth node is not reachable. But this gives me WA on pretest 14. Any ideas why this solution is wrong?

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

Explain to me what your criteria is to say B was easier than C?

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

    B is trivial implementation, once understood.

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

      Can you explain logic behind solution of B.?

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

        In one step the cow can jump at most max(a[]) distance. The last two jumps need not to be direct jumps, the cow can jump a bit left, or right with the first of the both last jumps.

        See the tutorial for formulars.

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

          That's not an explanation

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

            Think of it this way: If D is already a distance that you can jump, only then will the answer be 1

            Else, we have to create a polygon such that D is a side of it. The condition for any distance x being a side of a polygon is that it is <= the sum of all other sides

            Therefore, just take the biggest element and the answer will be max(2, ceil(D/big))

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

              Now this is an explanation (to y'all down-voter haters!).

              Thanks [user:Aggu_010000101].

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

Do you know what about may be the 17th test task E?

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

Why does the code with complexity O(len(s)*26*log(len(s)) times out in C ?

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

    look at this: LL countGreater(vector<LL> arr, LL n, LL k)

    each time you call it, the vector arr will be copyed once. So you get a TL.

    Sorry for my poor English...

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

Pretests for D seem a little weak, even some LGMs got problems. Actually, I expected this because the answer is just a shortest path length which in some (most?) cases will be not changed after the optimal edge addition. What was the reason for not asking for the optimal edge as well?

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

Awesome contest! I wish pretests were a little bit stronger for D, but you win some and lose some ¯_(ツ)_/¯

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

As time progresses, the frequency of WA in Problem D increases. Interesting...

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

In the announcement, it was written "positive difference" rather than non negative for question C. Then how are they considering single character occurence? The value of d is zero in that case. I got my solution failed in the main test because of their cheap mistake.

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

    If you look below the sample input and output it clearly shows that zero difference is possible. That being said, the problem statement should have been fixed.

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

    d can be anything in this case, but the sequence contains only the first element.

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

      Still the announcement was quite ambiguous. Just look at the status of question C with Wrong answer at test 36. All the people are having same problem for case of n = 1

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

        I think the statement was clear, it even explained the first example in detail right in the text. In particular, it says and aaabb is hidden 1 time, suggesting that progression on size 1 is valid.

        On a separate note, I think it would make sense to have a case with a single character in the pretests.

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

Very beautiful problems

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

Congratulations awoo for becoming Red!!

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

It seems for D people who sorted special fields based on distance from field '1' (let's call this sorted array with special field indices as ar[]) and checked the shortest distance after adding edges between just ar[i] and ar[i+1] had passed.
Is there an explanation for this ? or is it due to weak tests?
For example, look at this submission.

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

Congratulations amnesiac_dusk for becoming International Grandmaster and First Rank in India!!

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

.

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

hello everyone , I have submitted third question in this contest (621 div1 + 2) after submission it is showing runtime error on test 36. but in my compiler the answer is exactly coming what the answer of test 36 also on multiple online compiler like ideone.com but they are giving correct answer also i have checked my code there is no chance of runtime error on test 36. please anyone help in this matter ! https://codeforces.com/contest/1307/submission/71322234

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

    Nasty mistake is here:

    ll i=s.size()-2
    

    s.size() is an unsigned type, as a result, if s.size() == 1, i becomes 4294967295 (unsigned -1).

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

    You can't use s.size()-1 as s.size() is unsigned number.

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

    I am sad for you :( Your bug is in the line 10, s.size()-2 will give you RTE, so you should have cast it first. I ran your code after fixing this and it is AC :(

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

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

jqdai0815 is insane!

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

One of my favourite contests now.

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

It is unbelievable that following code can not AC;

include <bits/stdc++.h>

using namespace std; int n,x,ans; int a[100005]; void solve() { ans=0; cin>>n>>x; for(int i=0;i<n;i++){ cin>>a[i];ans=max(ans,a[i]); if(a[i]==x){ cout<<1<<endl;return; } } // cout<<a[0]<<endl<<endl; if(x<ans) { cout<<2<<endl;return; } else { if(x%ans!=0){ ans=x/ans;ans++;} else ans=x/ans; } cout<<ans<<endl; } int main() { int t; cin>>t; while(t) { t--; solve(); } }

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

    Don't paste solution like this. Give link for solution. Also mention the problem no.

    As far i understand it is a solution for problem B which was failed.

    The reason is you must take whole input when there is multiple test cases. Suppose you have array of length 5 and you get answer after taking 3 input you get the answer. If you stop taking input here then 4th element of array will be n for next case which is not supposed to do.

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

E tests the participants' English level.

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

    Yes, it was a little difficult to word the statement concisely, but we felt the problem was too nice to discard for that reason. I hope your overall experience was still positive!

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

Many LGM dropped. :|

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

I don't understand how complexity of F is $$$n*log(n)$$$. The number of non-overlapping rest stops for a given node can be very large, and I have a concrete counter-example for $$$O(n^2)$$$, if I understand the editorial correctly. Can anyone please explain proof of complexity.

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

    The number of non-overlapping rest stops for a given node indeed can be large, but only if we consider the distance $$$k$$$. But there is at most one group of rest stops on distance $$$\frac{k}{2}$$$ and the author solution uses this fact.

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

Poor tourist :')

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

Codeforces translators:

using weird words like haybale

at the same time can't see the difference between feeding and eating

EDIT: Uh, it seems I was wrong. I can't comprehend how "giving food" is the only meaning of "feeding" I can find, but at the same time Internet provides example "cows feeding in meadow" or "baby feeds one a night" wtf?. Who is it feeding? I would use "being fed"