liouzhou_101's blog

By liouzhou_101, 8 months ago, In English

Hello, Codeforces!

I'm very glad to invite you to my contest Codeforces Round #700 (Div. 1) and Codeforces Round #700 (Div. 2), which will be held on Feb/07/2021 17:35 (Moscow time). In both divisions, you will be given 6 problems and 2 hours 15 minutes to solve them. One of these problems is interactive, please see the guide of interactive problems if you are not familiar with it.

I would like to thank:

I have tried my best to write clear problem statements and make strong pretests. I hope you like the problems and enjoy the round.

Click here for those who are interested in the joke of rejecting problems:

The anti-traditional score distribution (yes, very early, that's why we call it anti-traditional; I love early score distributions!) is given as follows:

  • Div. 1: $$$500 - (750 + 750) - 1500 - 2250 - 4000$$$

  • Div. 2: $$$500 - 1000 - 1500 - (1500 + 1500) - 3000$$$

UPD: Editorial is out.

UPD1: We are sorry for the issue with the problem D2B and for D2C=D1A turning out to be well-known. Constraints for D2B were changed from $$$10^9$$$ to $$$10^6$$$ and all submissions which didn't get AC during the contest were rejudged.

We apologize once again and thank you for your participation.

UPD2 Congratulations to the winners:

Div 1:

1. Petr

2. A.K.E.E.

3. ko_osaga

4. Isonan

5. Benq

Also congratulations to hos.lyric (the only contestant who solved E during contest time!)

Div 2:

1. 5002ryx

2. AlanChen

3. whx1003

4. zkou

5. Ritos__

 
 
 
 
  • Vote: I like it
  • +230
  • Vote: I do not like it

»
8 months ago, # |
  Vote: I like it +212 Vote: I do not like it

As the author of rejected problems the date of this round, I hope you will enjoy it.

  • »
    »
    8 months ago, # ^ |
    Rev. 2   Vote: I like it -63 Vote: I do not like it

    Can I ask a question? Why are you not on the list of authors? I think you should be on the list of authors regardless of whether your question is selected.(To be honest, as far as I know, the passing rate of questions under the antontrygub review is very low. If only the question is selected can be included in the list of authors, then many people may be unwilling to set the title. Because it takes a lot of time to set up questions, and in the end, your questions may not be selected at all, so you get nothing. This is unreasonable at all, and it will also cause authors to lose enthusiasm for setting problems.)

  • »
    »
    8 months ago, # ^ |
    Rev. 2   Vote: I like it -156 Vote: I do not like it

    As a one having negative contribution, I can bet this round will be hard

»
8 months ago, # |
Rev. 3   Vote: I like it +27 Vote: I do not like it

As a tester I must say problems are really interesting and well written and please notice unusual solving time. Good luck to all...

»
8 months ago, # |
Rev. 3   Vote: I like it -29 Vote: I do not like it

(1500 + 1500) means that there are subtasks?? Since every time when subtasks are there, then author mentions it...but this time they haven't mentioned

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +59 Vote: I do not like it

    Yes, they are subtasks. But they are different problems, too. Surprise?

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yaa really surprised since haven't seen that before...amazing work by you :)

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it +6 Vote: I do not like it

        Am I the only one who doesn't understand what this means? Correct me if I am wrong, but is it that the two subtasks will be about the same problem, but perhaps, they would ask us to compute different things?

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +111 Vote: I do not like it

»
8 months ago, # |
  Vote: I like it +300 Vote: I do not like it

At first, I got excited about subtasks because of the $$$+$$$ sign, but then I realized that they won't change my score, it will still be $$$500-(750+750)-1500-2250-4000=-8750$$$

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it -60 Vote: I do not like it

    Jokes aside but what does 750+750 mean? Could you please tell?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it -53 Vote: I do not like it

    What the Fish!! I was only asking something because I am seeing this thing for the first time and the post doesn't tell what that is. Hate this community! I won't comment or take part in any discussion. Fuck you all :( Fucking rude asses here.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -30 Vote: I do not like it

      What the Fish!!

      Fuck you all

      lol

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Fish* you all

      • »
        »
        »
        »
        8 months ago, # ^ |
        Rev. 2   Vote: I like it -56 Vote: I do not like it

        Whatever y'all say. Idc if you agree with me that people here are more into memes rather than sharing knowledge. I simply asked what 750+750 means and people thought I was trying a taunt on the guy, I guess. What a silly childish community it grew into LMAO. Have fun stroking downvote button here too as if that would change anything in my life except for making my point strong :) I just downvoted all comments here lol. Suck it up. Its cool lol

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it -8 Vote: I do not like it

          Have fun stroking downvote button here too as if that would change anything in my life except for making my point strong :)

          Look who's acting decent all of a sudden lol. Why'd you assume I downvoted you in the first place?

          I simply asked what 750+750 means and people thought I was trying a taunt on the guy

          just admit you didn't read the previous comments.

          • »
            »
            »
            »
            »
            »
            8 months ago, # ^ |
            Rev. 2   Vote: I like it -44 Vote: I do not like it

            I don't care anymore. my contributions were positive and I was thinking of writing articles on CF to give back to the community. But now fuck it! People are stupid. Better to just make your way out and climb up in life. And no, why would I read previous comments? I expect that info in the article itself. Downvoted that too.

            • »
              »
              »
              »
              »
              »
              »
              8 months ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              my contributions were positive and I was thinking of writing articles on CF to give back to the community.

              Oh No! This shouldn't be happening. I upvoted you. Please write the blog soon.

              • »
                »
                »
                »
                »
                »
                »
                »
                8 months ago, # ^ |
                  Vote: I like it -42 Vote: I do not like it

                Lol you see the trend here? People upvote positive voted comments and downvote negative-voted comments. I downvoted yours and you got 7 downvotes. Enjoy :D It's fun playing with children here lol. Such childish people.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  8 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  I don't know who's the salty kid here lol. Did you even look at my contribution before?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  8 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  Bro u have to use long long int to store his number of accounts :')

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  8 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  his?

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          i feel u dude power grid is down i had to write on my phone and the the comments are useless like me today

          • »
            »
            »
            »
            »
            »
            8 months ago, # ^ |
              Vote: I like it +4 Vote: I do not like it

            People are making alt profiles to troll. Never expected this shit on one of the biggest coding platforms in the world. Codeforces really needs to put some effort in improving the community morally or I will just give up on discussion or blog posts. Seriously shitty people have become the larger part of the community.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Seriously, you are mad because people downvoted you for asking a question which was already asked before. What's so hard with admitting it? Stop being so childish.

      • »
        »
        »
        »
        8 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        but don't you see that first comment related to doubt is also downvoted?

        Edit: I was referring to comment of samay var(cause someone said same comment has been asked earlier)

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          Yes, it was downvoted because it was already asked before (see?). Instead of commenting asking for what it means he could have just looked at previous rounds with that same parentheses and he would find out. Same thing with the first guy. I also think it is in the help section.

          • »
            »
            »
            »
            »
            »
            8 months ago, # ^ |
              Vote: I like it +3 Vote: I do not like it

            There is a lot of stuff written in this post which can be found in previous rounds posts, why to put it there? Dude, you seriously believe someone new should dig into previous posts to make sense of this post? You must be smoking something.

            • »
              »
              »
              »
              »
              »
              »
              8 months ago, # ^ |
                Vote: I like it +3 Vote: I do not like it

              Ok, so, you don't need to look in the previous rounds, I just found a very useful tool that can answer almost all your questions, specially the most common ones like the one you made! Link: google

              • »
                »
                »
                »
                »
                »
                »
                »
                8 months ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                You must be trolling around. Are you even reading yourself what you are writing? Do you know what is an article/post? Well! I wasn't in your school, but my English teacher never taught me to write an article which implicitly needs reader to look for external references to make sense.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  8 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  Your teacher is wrong then. Also, apparently, you've never read an article before. When writting an article you assume the reader knows the basics. You won't start a math article by defining sum.

                  Besides that, it is an announcment, not an article. If you want to know how a round works, you need to research a bit. What is the ICPC format? What does penalty mean? How do problem scores decay? etc.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  7 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  aLT AcCOuNt

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Agree. I can't understand what's wrong with your comment.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

»
8 months ago, # |
Rev. 2   Vote: I like it +42 Vote: I do not like it

What a special weekend! Codeforces Round 700 and Topcoder SRM 800! :D Kudos to both Codeforces & Topcoder.

EDIT — It's SRM 799.

»
8 months ago, # |
  Vote: I like it +46 Vote: I do not like it

As a tester, I hope you will participate in and enjoy the interesting round!

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

For testing every color is there except grey:)

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Codeforces Round 700 and Topcoder SRM 799!

That's really great.

»
8 months ago, # |
  Vote: I like it +29 Vote: I do not like it

Codeforces Round # 700, this is a special milestone.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes round #700 a benchmark set by codeforces. kudos to the team and competitive enthusiasts.

»
8 months ago, # |
  Vote: I like it -45 Vote: I do not like it

Anyone here who read anti-traditional as anti-national?

»
8 months ago, # |
  Vote: I like it -59 Vote: I do not like it

Chinese round! Indians should boycott it lol.

»
8 months ago, # |
Rev. 2   Vote: I like it -143 Vote: I do not like it

What a Sweet AdHoc/MathForces round!

Spoiler
  • »
    »
    8 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    This round is anti-traditional not only in its score distribution, but also in its style. I think it will not be a Chinese-style or a antontrygubO_o-style round hopefully, but an interesting and surprising round. As you can see in this comment, we have subtasks but they are considered to be different problems.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -8 Vote: I do not like it

      but I like antontrygubO_o-style rounds :/

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        Yes, I like them too. I mean to eliminate our prejudices and stereotypes.

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
          Rev. 2   Vote: I like it +4 Vote: I do not like it

          Some problemsetters don't take easy problems seriously. One very popular opinion is that the D2A-B problems are just stupid implementation exercises intended for beginners to learn how to code.

          Hope this round disproves it?

          Yes, It does.

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          You're really man of your word orz!!

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -36 Vote: I do not like it

      I feel seg tree vibes.

»
8 months ago, # |
  Vote: I like it -14 Vote: I do not like it

GoraGoraGOra

»
8 months ago, # |
  Vote: I like it -46 Vote: I do not like it

I am 1990 now, and I hope that tomorrow I can take a master. Can you give me some advice on how I should solve problems: solve B2 or solve B1 first and then think about B2?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it -46 Vote: I do not like it

    Bro till then give me some advice on how I should solve problems to become expert :)

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -28 Vote: I do not like it

      Bro till then give me some advice on how I should solve problems to become specialist:)

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it -32 Vote: I do not like it

        Same advice but you should try to solve B tasks :) Look my previous comment

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -26 Vote: I do not like it

      Idk dude, may be I can say that you should try to solve C tasks, they are not so hard as you think. It is always one or two simple thoughts that give you solve. May be you can scroll all rounds from now and try to solve C tasks?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it -37 Vote: I do not like it

    Why this comment is downvoted? :(

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -23 Vote: I do not like it

      DW! It'll be at least 30 votes after You've reached master.

      why?
»
8 months ago, # |
  Vote: I like it +206 Vote: I do not like it

»
8 months ago, # |
  Vote: I like it +61 Vote: I do not like it

woow, score distribution is announced so early! I appreciate it!

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +84 Vote: I do not like it

    Thank you! It's glad to see you also like early score distributions.

»
8 months ago, # |
  Vote: I like it -10 Vote: I do not like it

notice the duration

»
8 months ago, # |
  Vote: I like it +7 Vote: I do not like it

Wow colourful testers!!!

»
8 months ago, # |
  Vote: I like it +9 Vote: I do not like it

I see there is a pupil tester as well. Can anyone tell how to contribute to Codeforces as a tester?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Will there be interactive ques in div2 also??

»
8 months ago, # |
  Vote: I like it -36 Vote: I do not like it

No one

Literally No one

First few comments downvoted as usual

»
8 months ago, # |
  Vote: I like it -65 Vote: I do not like it

If you saw your comment downvoted recently, that was me :)

  • »
    »
    8 months ago, # ^ |
    Rev. 2   Vote: I like it +56 Vote: I do not like it

    my-turn-o-1831823

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Lol, apparently you think you are a supreme being because someone downvoted your comment. Useless comments like the one you just made and the other making a repeated question get downvoted. Think twice before commenting. Stop spamming.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      At least he doesn't make an alt for trolling someone

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      My comment to understand the post is useless. Yeah right, your comments are so useful, I am getting nirvana after reading them.

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        At least my comment is explaining that, if you you don't want to get downvoted, you should be more careful when commenting. Your comment is just crying about being downvoted.

»
8 months ago, # |
  Vote: I like it -53 Vote: I do not like it

Can anyone tell me how to get upvotes without telling me how to get upvotes?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I just learned how to tell somebody to fish himself without actually doing so, see some comments above ;)

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's simple. just write only useful comments ;)

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    Do what 1-gon does.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you liouzhou_101 for preparing Div.2 contest

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Extra 15 minutes. Looks like an interesting round to me. Good luck and high rating to all.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

there are three expected rating in this round for me.....ratng<1535 or (rating>=1535 and rating<1600) or rating>=1600....Pray for me

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Waiting for One-Liner 'A'.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

anyone know a good video or any blog to solve interective problemss? please share after contest..this is my first time solving interective problems..

»
8 months ago, # |
  Vote: I like it +2 Vote: I do not like it

Wrong answer on pretest 6. :(

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

You suck Great Hero

»
8 months ago, # |
  Vote: I like it +4 Vote: I do not like it

long queue again? :(

»
8 months ago, # |
  Vote: I like it +4 Vote: I do not like it

i literally fucked up in the today's contest who else also fucked up his contest today !! stucked on B ; C --> Interactive don't know how to solve Interactive problems D--> Wrong answer on pretest 6 !!

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Div2B WA on pretest 2 gang wya ;-;

»
8 months ago, # |
  Vote: I like it +1 Vote: I do not like it

I have a one question..if i get wrong submission in one question ..then will it decrease 50 point from total point or from particular question.?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    from that question ig

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If in future you submit and it accepted then from total score-time taken-(total wrong submission)*50

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

those who are getting wa on Btc2 make some noissseeeeeeeee!!!!!!!!

»
8 months ago, # |
  Vote: I like it +20 Vote: I do not like it

I'm sorry, but we're heading for no pretests at all? Why is C (div 1) only 5 pretests, taking into account that there are 2 samples? The round is still going on, and I don't know if my solve will fall, but it's still unpleasant...

»
8 months ago, # |
  Vote: I like it +6 Vote: I do not like it

what are the chances that div2 b has weak pretests.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I am worried about pretests of C :/

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      me too :D, passed pretests on the first try, but I have a feeling that it will fail system testing

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      The same dude, I did some stupidity there and don't know why the hell it passed.

»
8 months ago, # |
  Vote: I like it +18 Vote: I do not like it

meme1.

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    one of the given tc is

    1000 1000 4

    200 300 400 500

    1000 1000 1000 1000

    but you may try this one also (descending order)

    1000 1000 4

    500 400 300 200

    1000 1000 1000 1000

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    Div 2 D -> WA on pretest 6 :(

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Try this tc

      6

      1 1 3 2 1 1

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it +1 Vote: I do not like it

        Yeah I have thought of this case. But I messed up the code. Thanks for the testcase

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Still better than failed sys tests. T_T

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Let's abolish the pretests and make everything like Topcoder's.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

this is the 100th time I WA for writing the wrong variable XD why do I keep doing this mistake?

»
8 months ago, # |
  Vote: I like it +29 Vote: I do not like it

Contest is anti-traditional because WA on pretest 6 not 2

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I'm curious about the testcase

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    consider 1 1 2 3 4 5 1 1 2 3 4 1 1 ans will be 1 2 3 4 1 2 3 1 ==8 1 5 1 4 1 ==5

    total ans = 8+5 =13

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No,this is not the correct testcase. My code gives 13 as the ans yet WA on testcase 6.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    WA on 2 was not required , it was in samples .

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

For those who want test cases of Div 2 B -

(order of monsters matters)

here is(just like TC3 but in descending order) —

1
1000 1000 4
500 400 300 200
1000 1000 1000 1000

answer should be "YES"

basically we have to sort the monsters in ascending order (first attacking power and if attacking power same them by their health )....so that hero kill small monsters first and then kill the large monster and himself dies(if possible).

»
8 months ago, # |
  Vote: I like it +7 Vote: I do not like it

Video solution to problem C: https://youtu.be/AgJrby-pShU

»
8 months ago, # |
  Vote: I like it +6 Vote: I do not like it

How to solve C?

»
8 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Beacause of the long queue I didn't get to finish E in time :(.

Here is my solution to E:

Put an edge 1->2 with cost 1

For every node put edges such that the lengths of the paths ending with him are in the interval [1, 2 ^ (n — 2)]. By that I mean:

1->n cost 1

2->n cost 1

3->n cost 2

i->n cost 2 ^ (i — 2)

Now simply use as many of these power of 2 intervals to build the interval [L, R]. I wa'd because of the long queue and a dumb error :(

»
8 months ago, # |
  Vote: I like it +9 Vote: I do not like it

Those who are getting WA on pretest-6 for DIV2D. Try this

8
2 2 0 2 0 1 2 2

Ans = 8

Two possible segments are

2 0 2 0 2
2 1 2
  • »
    »
    8 months ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    Works for me, but still failed on pretest-6

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Same. this is the one that got mine

      11
      1 1 2 1 7 1 1 9 1 4 7 
      

      Answer is apparently 10

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Nah, this works for me, too. 106837601

        Can somebody explain the greedy, what is the logic that works?

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Code

          Didn't test it yet.

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        This is it!

      • »
        »
        »
        »
        7 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thanks mate, this worked for me.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    The idea is there, but there is a > 0 in the constraint.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I wonder if anyone got more WA than me:)

»
8 months ago, # |
  Vote: I like it +28 Vote: I do not like it
  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Oh so should it be done in log_2(n) asks??I implemented a ternary search instead hope it also passes system test :(

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

What is pretest 4 in Div1 C?

»
8 months ago, # |
  Vote: I like it +8 Vote: I do not like it

"Wrong ans on pretest #6" I guess I saw/read this line max number of times :|

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

One of the best contests I have seen in a while and I am saying this because this is one of the few contests where I was stuck to my laptop for solving D1, D2 until the very end. And, they didn't seem unsolvable which they usually do.

Thanks for these brilliant problems, authors

Much kudos to you liouzhou_101

»
8 months ago, # |
  Vote: I like it +139 Vote: I do not like it

How about setting E to be $$$4 \cdot 10^8$$$ points?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

The problem with B pretest 2 is that you have to sort the monsters based on their attack power increasingly so that you fight monsters with low attack power first.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You need only the monster with max attack power last, sorting of the others is not necessary.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I followed this idea but I got pretest 2 wrong? 106807055

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The health points of hero are good enough if it is positive before the last fight, ie can be sub zero after last fight. I think you do not consider this correctly in the code.

»
8 months ago, # |
  Vote: I like it +11 Vote: I do not like it

Was $$$N log^2 N$$$ with persistent trees supposed to fail on D (I know it can also be done with parallel binary, but I'm curious for the persistent tree solution)?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It's so sad when you find a $$$\mathcal{O}(n\ \text{polylog}\ n)$$$ solution to a problem and it's too slow QAQ

Is there a $$$\mathcal{O}(n \log^2 n)$$$ algorithm to D or are you supposed to make $$$\mathcal{O}(n \log^3 n)$$$ fit TL?

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

proublm D1 try this 13 2 2 2 2 2 2 4 5 3 2 2 2 2 answer is 7

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    worked for me, but still wrong answer on pretest:6

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    I think correct ans is 8

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

LOL ,, I thought that i cant solve that problem c so i jumped to problem D1...you know getting WA in pretest 6 in question d1...i get back to problem c and guess what my all pretest passed(2 min remaining clutch)..hope it will pass system test!!.. I took help from here :https://codeforces.com/blog/entry/45307

»
8 months ago, # |
  Vote: I like it +9 Vote: I do not like it

My code for div1D: almost 300 lines! Short explanation:

  • First off, let's denote $$$B_{v,a}$$$ — number of values $$$a$$$ on the path from $$$0$$$ to $$$v$$$ inclusive.
  • Look at the value $$$a_l$$$ in LCM(u, v); if it's inside $$$[l, r]$$$, we want to check if $$$B_{v,a_l} = B_{u,a_l}$$$, and otherwise, we want to check if $$$B_{v,i} = B_{u,i}$$$ for some $$$i \in [l, r]$$$ different from $$$a_l$$$.
  • We can turn that into uniform queries: check if the claim "$$$B_{v,i} \neq B_{u,i}$$$ for some $$$i \in [l, r]$$$" is true/false. They can be used to solve the problem through binary search. How do we answer a set of such queries?
  • We can't remember $$$B$$$, but we can traverse the tree using DFS and update a common array to get rows of $$$B$$$.
  • Let's hash subarrays of $$$B$$$. We need to support 2 operations: update a value to get the current row of $$$B$$$ and get the hash of some subarray of this row. It can be done with a Fenwick tree.
  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I skipped C for D.got this solution quite fast.but couldn't debug in time :(

»
8 months ago, # |
  Vote: I like it +12 Vote: I do not like it

If you are still figuring test cases that break your solution for div2D1

Spoiler
»
8 months ago, # |
  Vote: I like it +1 Vote: I do not like it

How do you solve D2D? Asking both for first and second version. Thanks.

»
8 months ago, # |
  Vote: I like it -75 Vote: I do not like it

fuck you son of the bitches!!!!!

»
8 months ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it

In the last 3 minutes I got AC on div2 D1.

I edited it to convert for D2. Submitted when 2 seconds were left but cf didn't accept it saying the contest is over. If my D2 passes now Imma gonna cry !

my d2 lol

EDIT: The div2 D2 I couldn't submit was correct. Also my C failed system tests coz I binary searched on both halves and therefore exceeded the number of queries. Life can make you happy and sad at the same time.

»
8 months ago, # |
  Vote: I like it +37 Vote: I do not like it

Could someone from the testing team please tell me why the verdict for this dataset in Div2 problem B is "YES". 1 1 1000000000 10 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 I used it for hacking. But apparently the accepted verdict is "YES.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    Thanks for pointing this problem out! Your comment deserved much more upvotes. And thanks for testing team for their response.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Very nice problems !!!

»
8 months ago, # |
  Vote: I like it -18 Vote: I do not like it

I wonder why was pure bruteforce solution containing 10^9 operations was not getting challenged in Div2 B. Unnecessarily I got two unsuccessful hacking attempts. liouzhou_101 & MikeMirzayanov please check this as many such solutions will wrongly get accepted.

Here is the java based input generator I used for hacking that solution:

public class InputGenerator {
    public static void main(String[] args) throws Exception {
        System.out.println(1);
        System.out.println("1 1000000000 100000");
        int n=100000;
        for(int i=1;i<n;i++)System.out.print("1 ");
        System.out.println(1);
        for(int i=1;i<n;i++)System.out.print("1000000000 ");
        System.out.println(1000000000);
    }
}

The target solutions I unsuccessfully tried to hack:

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    You should have created $$$10^5$$$ tests each containing $$$n = 1$$$ with $$$A = 1$$$ and $$$B = 10^9$$$ and $$$a = 1$$$ and $$$b = 10^9$$$

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -26 Vote: I do not like it

      But if I am not wrong, 10^9 shouldn't also have passed.

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        $$$10^9$$$ could possibly be done with $$$2$$$ seconds since the loop does not contain complex operations.

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it -18 Vote: I do not like it

          Or maybe its because of compiler optimizations.

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        It somehow passes. I also tried to hack in same way, but with n=1 (note that n>1 is obsolete in your test!), and t = 1. Two unsuccessful attempts. But one took 0.5s, another 1.5s, so I slightly increased a number of test cases accordingly to make hacks successful.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I got something unexpected for this hack: I believe it generates a valid test, but I got

Validator 'validator.exe' returns exit code 3 [FAIL Expected integer, but "/**" found (stdin, line 1)]
close

Could you check what's going on?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    Oh, sorry never mind. I guess I submitted the source code as the test instead of as the generator.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I made the same mistake and got invalid input and later realized that I submitted in the manual input instead of the generator. I lost my chance to make the first successful hack in my life.

»
8 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Whats the hack case you guys using for div1A/div2C?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I registered for the contest but I couldn't attend because of a sudden meeting :(

Does my ranking go down?

»
8 months ago, # |
Rev. 3   Vote: I like it -19 Vote: I do not like it

liouzhou_101 I request you to reduce the full score of Div2C. There are almost 4 times more submissions on this Problem compared to Div2D1 which also has the same score. This is unfair for the people who solved Div2D1 and not Div2C (and i believe they deserve more credit). Moreover Div2C was easily found with a simple google search as well here

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    That would be unfair to people like me who solved it by myself . Also such instances have occurred in contests before. The folks who are searching the solution on google at are loss themselves. They can not do the same in future contests.

»
8 months ago, # |
Rev. 8   Vote: I like it -8 Vote: I do not like it

g

»
8 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Div2 D2 pretest 6?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is this solution in problem Div2.D1 incorrect? https://codeforces.com/contest/1480/submission/106825810

»
8 months ago, # |
Rev. 2   Vote: I like it +2 Vote: I do not like it

Why brute force is passing the pretests for DIV 2 C?

»
8 months ago, # |
  Vote: I like it +9 Vote: I do not like it

I think problem Div1A/Div2C has appeared in leetcode or in some FAANG interview, because I saw and solved the absolutely same problem before

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

D1 pretest 6 ? Div 1.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    try 11 1 2 5 1 1 5 1 1 5 1 1 answer should be 9

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    try

    8

    2 2 2 3 4 2 2 2

    answer:6

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      ok this one doesnt worked for me. I figured out that its a dp problem and solved it too, but the limits were too large to memoize. NVM, lets see in the editorial.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You mean Div.2? (I assume from your submission history)

    The test case that saved me was this:

    6 3 3 4 8 3 3

    Notice that you have to put 8 in a different array than 4 so that you can take both next 3s.

    Solution spoiler

    Well we will see if this is the solution if I get the problem.

  • »
    »
    8 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    try 8 1 2 3 3 4 5 3 3 ans: 8

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    both tests work for me but WA on pretest 6 anyway

»
8 months ago, # |
  Vote: I like it +2 Vote: I do not like it

What was your approach in C?? I was thinking of this approach "use Binary Search to find 1"

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Binary search doesnt work in an unsorted array.

  • »
    »
    8 months ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    i did binary search on range. If your current mid is not the answer then either either $$$a[mid-1] < a[mid]$$$, in that case reduce $$$r (r = mid-1)$$$, else if $$$a[mid+1] < a[mid]$$$, then increase $$$l (l = mid+1)$$$.

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Observation: for subarray $$${a[l...r]}$$$, if $$${a[l] > a[l+1]}$$$ and $$${a[r-1] < a[r]}$$$, then there must exist at least one local min between $$$l$$$ and $$$r$$$. The implementation is as how I_love_Kim_Dahyun described it before.

»
8 months ago, # |
  Vote: I like it +6 Vote: I do not like it

I think n=1 is not present in pretest of d2c.

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Div2C might have the worst pretests ever lol Brute force passes pretests and querying "? 0" also passes

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No, brute force solutions will fail system tests. Pretests were just weak.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Now is the time to see if the pretests were actually strong.

Examples where things can go wrong (solution spoilers you have been warned):
»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone with randomised solution for div2 C?

»
8 months ago, # |
Rev. 2   Vote: I like it -9 Vote: I do not like it

Problems were amazing! Thank You

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    In my opinion, Div 1 A was pretty much hackable and solution was found online. Div 1 B/B2 each is different so that is like 3 problems in Div 1 as a starter which are all ad-hoc/greedy. Though, I didn't see rest of round. I was already stressed from Div 1 A after seeing that my initial solution a simple test got it WA. So I submitted a second solution which also will FST(Fail System Testing). I left B2 just for A as I couldn't risk losing both(and sadly, I lost both). Though, I don't know about the rest of the problems but they might be good.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      My solution for B2 needs only three lines changed from my B1 solution, just going from a range-max to a range-min segment tree (2 lines) and fixing a silly bug in that segment tree (1 line, issue can't be triggered in B1). I'm guessing from the other comments that this was overkill, but I wasn't confident in any of the greedy strategy ideas I came up with for either version.

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Woah, that is nice and neat. I solved B1 greedy maybe that is why.

»
8 months ago, # |
  Vote: I like it +70 Vote: I do not like it

I submitted D at the very last minute, and i waited until as it kept in queue until the contest was over, then waited long and at last I found:

TLE on pretest 51.

Disappointing:(

»
8 months ago, # |
  Vote: I like it +34 Vote: I do not like it

What's the intended solution to F? I misread $$$n \leq 4 \times 10^8$$$ as $$$n \leq 4 \times 10^9$$$, so this is my fault, but I strongly believe giving such high constraints on $$$n$$$ is unnecessary.

BTW, if we can get a large factorial in $$$O(x)$$$, we can get the potential function in $$$O(x)$$$. I tried to squeeze it by embedding pre-calculated factorials but failed because of the code length limit. So Sad.

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Looking through the editorial, I feel that the author had any linear-time solution and didn't expected it to pass. The limits are not glorious anyway. (Reminds me the GP 2hr before the contest)

»
8 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Codeforces = constructive and speed forces Change my mind:/

»
8 months ago, # |
Rev. 4   Vote: I like it -47 Vote: I do not like it

I'm not quite sure I understand the error in my solution to Div2 B.

My approach:

  • Calculate the "total damage" that each monster does (i.e. take into account the number of hits that each monster needs to be killed by the hero, and in turn calculate the damage that the monster does in those many hits).
  • Sort by the total damage (smaller to bigger)
  • Next, see if all but the last monster can be killed in such a way that the hero survives
  • For the last monster, consider a special case. If it needs x hits by the hero to be killed then see if the hero survives at least x-1 attacks from the monster.

Any suggestions on what could be wrong with this?

Code

  • »
    »
    8 months ago, # ^ |
      Vote: I like it -10 Vote: I do not like it

    Why the downvotes?

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      That's a useless question — no one is going to tell, nor should you care.:)

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Well, it helps to know the sentiment of the forum and work on ones netiquette :) Also, if it doesn't matter, then why have the concept of contribution at all? I imagine it exists to build a community, but the way it's structured here is quite flawed (shouldn't likes and dislikes be treated separately?)

        Anyhow, my best guess is that my first version had a language-fueled meme about me having a tough time with problem B, and I later replaced that with a question about the same problem that I was genuinely curious about. Not sure why that would offend people, but I assume that I will never find out.. :)

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          More importantly, the original revision of your comment was conveying annoyance with the verdict rather than desire to learn what was wrong with your approach.

          • »
            »
            »
            »
            »
            »
            8 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Duh. I didn't realize that's how it came across — a bad sense of humor from my end. I appreciate the feedback!

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Should not be sorted by total demage. But by demage in one fight. The health points of hero must be enough to stand all but the last fight.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Perhaps, and thanks for your inputs. I'm just having a hard time seeing the intuition behind this.

      The problem statement claims that "the hero will fight with monsters until either the hero is dead or all the monsters are dead". A single attack by the hero doesn't guarantee that the monster gets killed. So it would seem that we need to take into account the cumulative damage that a monster would impose before determining which monster to fight.

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it +1 Vote: I do not like it

        There is also the sentence:

        "For the safety of the people in the country, please tell them whether the great hero can kill all the monsters (even if the great hero himself is dead after killing the last monster)."

        So, the intuition is: It is ok to die in the last fight as long as you kill all monsters. That is bit to much romantic for my taste, but it is written that way.

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it +3 Vote: I do not like it

          Ah, I see where I went wrong. We only care about the last blow to the hero (and not cumulative by a monster — that order doesn't matter). Thanks again — after getting tons of downvotes (for asking a question?), this was refreshingly helpful.

    • »
      »
      »
      7 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Hi! I will really appreciate it if you can give a counterexample for this approach. Thanks a lot.

»
8 months ago, # |
  Vote: I like it +24 Vote: I do not like it

Is it rated?

»
8 months ago, # |
  Vote: I like it -54 Vote: I do not like it

Hope to never see you as a setter again. Problems were clearly "made in China".

»
8 months ago, # |
  Vote: I like it +7 Vote: I do not like it

I got a minimum bound for number of nodes in Div. 1 C as 2* log2(R-L). Is there any better bound in which case answer could be better?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    same :(

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    You don't need the factor of 2, log2(R-L) + 1 or so should work. For example this works for 1 13: (All numbers 1-8, then a edge of weight 4 to the 4 to get [9-12] and an edge of weight 11 to the 1 to get [13])

    YES
    6 13
    1 2 1
    1 3 1
    1 4 1
    1 5 1
    1 6 1
    5 6 1
    4 5 2
    4 6 2
    3 4 4
    3 5 4
    3 6 4
    2 3 4
    2 5 11
    
»
8 months ago, # |
  Vote: I like it +1 Vote: I do not like it

can anyone tell me about the hacking process ..how to do it ,when to do it and where to do it? is hacking done only during contest time?

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it +15 Vote: I do not like it
    1. Lock a problem (click the lock icon on solved problems).
    2. Switch to room tab and it should be your room. If not, switch to your room.
    3. Suppose you locked problem A, then you may double click on others solution on A.
    4. You will see his/her solution. If you find any mistake(s), click the hack botton.
    5. Input the case into the box or upload the testcase generator (remember to strictly follow the format) , then click the button.
    6. You will see the result.

    In normal rounds (like div.2) hacks can only be done during contest time.

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can anyone tell me why am I getting tle on Div2-C.I am using ternary search.

code
»
8 months ago, # |
  Vote: I like it +19 Vote: I do not like it

Problem B2 is this problem but with $$$n = 10^5$$$ and $$$k = 2$$$.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone suggest to me any youtube video/playlist or any other articles where I can learn the concepts required to solve mathematical problems like combinatorics, modulus... similar questions. I found most questions asked in Div.2 A, B ,care either implementation or math-based. I was able to solve the implementation one but only a few math questions.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

My randomised solution for C/A - Ask randomly for value at indices until we get a value <= 50. I used 40 iterations. Find two neighbours if both are greater we got the result else one neighbour must be less than this value if we follow this decreasing chain which is atmost of length 50 we can get our result at the end of such chain

  • »
    »
    8 months ago, # ^ |
    Rev. 3   Vote: I like it +8 Vote: I do not like it

    I thought of this idea at first, but isn't the probability of this working really bad? Like for $$$n \leq 10^{5}$$$ the probability of getting a number $$$\leq 50$$$ in 40 attempts is like $$$1 - \left(\frac{10^{5} - 50}{10^{5}}\right)^{40}$$$ which is like $$$2$$$%, even if use the TLE retry trick that should only give you a $$$10$$$% success rate even for large random arrays.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah it should fail systest. I didn't even bothered to calculate the probability of success during the contest :(. What is TLE retry trick?

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it +6 Vote: I do not like it

        Basically, if a solution TLEs, Codeforces runs its a few more times, to see if its on the edge of TLEing, if it passes once it gets AC. Ofc its perfectly possible to abuse this and make your code infinite loop if you realize you're going to get WA for random solutions.

»
8 months ago, # |
  Vote: I like it +15 Vote: I do not like it

Are div2C pretest a joke or sth

»
8 months ago, # |
  Vote: I like it +28 Vote: I do not like it

Why are there 0.5 solutions running on average?

»
8 months ago, # |
  Vote: I like it +5 Vote: I do not like it

I realized how important to name different variables as differently as possible because I made a foolish mistake, which be described in the following.

For Div.1 D, a part of my solution was:

while(L<q[i].l)
	work(id[L++]);
while(L>q[i].L)
	work(id[--L]);
while(R<q[i].r)
	work(id[++R]);
while(R>q[i].r)
	work(id[R--]);

After debugging for a long time, I found that it should be:

while(L<q[i].l)
	work(id[L++]);
while(L>q[i].l)
	work(id[--L]);
while(R<q[i].r)
	work(id[++R]);
while(R>q[i].r)
	work(id[R--]);

Have you seen the tiny difference between the two? If not, please pay attetion to the 3rd line.

What's worse, I spent a long time on Div.1 AB (but got nothing) so that the contest was over when I corrected it. o(╥﹏╥)o

»
8 months ago, # |
  Vote: I like it +94 Vote: I do not like it
»
8 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Weak Pretests for problem B :(

»
8 months ago, # |
  Vote: I like it +47 Vote: I do not like it

Problem D's solution:

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone tell me why sorting is necessary for div2B?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Try this test case:

    500 100 2
    500 90
    500 500
    
  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Try this

    1
    1000 1000 4
    500 400 300 200
    1000 1000 1000 1000
    

    Answer will be $$$YES$$$

    Hope this help

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did without sorting

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It wouldnt pass. Consider the case where monster damages are 20 and 10. With your strength of 15, nonsorted order would give "No" (B=15-20=-5<0 after first kill; cannot kill the second) while sorted order would give "Yes" (B=15-10=5>0 after first kill; can kill the second).

      • »
        »
        »
        »
        8 months ago, # ^ |
        Rev. 2   Vote: I like it +1 Vote: I do not like it

        You can handle it without sorting check my submission 106764675

        • »
          »
          »
          »
          »
          8 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Oh yes maybe it can be handled, merely saying what the idea behind sorting was.

      • »
        »
        »
        »
        8 months ago, # ^ |
        Rev. 3   Vote: I like it 0 Vote: I do not like it

        i did it without sorting (but it might be incorrect ...)

        my approach

        Edit : oh sorry didn't realize the editorial was out

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

strong pretests?

click
»
8 months ago, # |
  Vote: I like it +7 Vote: I do not like it

Hello.

What is the answer for this test (Div. 2 B):

1 1 10 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    NO. But some code that calculates the total damage may lead to overflow and output YES

»
8 months ago, # |
  Vote: I like it +30 Vote: I do not like it
WeakPretestForces.push_back("Round #700");
  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    DisasterRounds.push_front("ROUND 700")

    it not weak pretest . wrong pretest 1 1 1 10 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 this test more than 40% people print wrong ans but getting correct ans after system test.

»
8 months ago, # |
  Vote: I like it +3 Vote: I do not like it

It's a really interesting contest?! Yes.

»
8 months ago, # |
  Vote: I like it +73 Vote: I do not like it

Please pay attention! The solutions in problem B (Div 2) were hacked by tests to which the system gave an incorrect answer. Example: 1 1 1 10 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 the system outputs "YES"

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +22 Vote: I do not like it

    I hope that the error will be fixed. Since there were no problems during the competition, the round in my opinion should remain rated

»
8 months ago, # |
  Vote: I like it +24 Vote: I do not like it

Problem C was so unique that i couldn't find any of its hint on the internet. clown face x 2

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    also the pretest were so good that no one got hacked. clown face x 2

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it +17 Vote: I do not like it

      solutions were so good that they failed FST even after it's hint were on internet.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Oh What a Suspense!!!!

»
8 months ago, # |
  Vote: I like it +1 Vote: I do not like it

It is taking a long time for system testing.However I am eagerly waiting to survive test case 12 and 23 for problem "B".

»
8 months ago, # |
Rev. 3   Vote: I like it -30 Vote: I do not like it

What the f*ck maan. this solution passing system 106771738 but it give wrong answer for the test

See test

correct ans: YES these means wrong problem setting. make the round undrated MikeMirzayanov. very much unfair to the people. Many solution got TL in system test. this not fair. Weak test case okay but wrong problem set not okay.

i also maked wrong hacks in B becoz of thinking my solution is right. but my B wrong so my score now in -200. i will not accept

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    No the answer is NO. Because the attacking power of the hero is 1 while the attacking power of his enemies are 1e9. It is easy to see that we can only kill 1 enemy in this test case.

    • »
      »
      »
      8 months ago, # ^ |
        Vote: I like it -7 Vote: I do not like it

      106787623 5002ryx the guy #1 in div2 700 getting YES. U tell u smart or he smart?

      just 1 question MikeMirzayanov the wrong solution for above test will again be system test after adding it or not????

      • »
        »
        »
        »
        8 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        This code can overflow in this test case. If you change B and sum in __int128 you will find it outputs the correct answer NO. So the true problem is hack tests don't have any case that can crack long long overflow. (I resubmitted my defective code and it got AC too.) In regular it won't change the rating, but Candidate Master and higher rating can hack this solution so other people won't make the same mistake.

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

My Binary Search FSTed in C and gave TLE on TC11 . Really Feeling Sad

»
8 months ago, # |
  Vote: I like it +9 Vote: I do not like it

Weak Pretests for B and C

»
8 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

No one :

Me each time after submitting Div 2B :- Wrong answer on pretest 2 (T-T)

»
8 months ago, # |
Rev. 3   Vote: I like it +11 Vote: I do not like it

TLE FST in Div2B seemingly just because didn't bother to optimize input.

Pretests passed with a huge margin, so I assume they just didn't contain a maximum test case

Normally I don't blame weak pretests, but come on, since when it is ok to require some purely technical optimizations in d2B and not to include tests that check it in pretests?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it +21 Vote: I do not like it

    Never have I ever seen such shitty pretests!

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Just like I thought The largest pretest was 33329 instead of 10^5

»
8 months ago, # |
Rev. 2   Vote: I like it +11 Vote: I do not like it

Edit: The type of problems were good