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

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

Hi everyone!

I would like to invite you to my fourth Codeforces Round, which I have made with my friends FastestFinger and TheOneYouWant. In terms of problems, it is my favorite among all my rounds.

With that said, I bring to your attention our new Codeforces Round 646 (Div. 2) that will take place on 31.05.2020 17:35 (Московское время). If your rating is less than 2100, this round will be rated for you; otherwise, you can participate out of competition.

I would really like to thank:

You will be given 6 problems and 2 hours to solve them. Scoring distribution will be announced later.

Good luck! :D

UPD: Scoring Distribution: $$$500-1000-1500-2000-2250-3000$$$

UPD2: Editorial (with memes, and detailed explanation) — Hope you guys enjoyed the contest! :D

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

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

I really like your problemsets. Hope this round is interesting too. Good luck :)

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

    Thank you. The statements are concise and hopefully you'll enjoy solving them.

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

      Are the pretests strong

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

        Stronger is better.

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

        You need to understand that setters always try to make pretests as strong as possible. It's just that they miss trivial/edge cases sometimes and that is completely unintentional. Sometimes, these are suggested by other people involved in setting the contest and sometimes, it just misses everyone's head. Well, there are very very rare exceptions to what I just said.

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

      concise... nice!

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

      Wouldn't be a surprise it you said that you will not enjoy solving them.

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

      Problem D concise. Hmm...

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

        If you look at the statement barring input and interaction section, it looks concise to me. Interaction section of such problems has to be a bit descriptive. Some contestants found the description a bit confusing, so I'd like to know if this is what most people felt.

        I personally feel the statement is simple enough to grasp after reading it once or probably twice.

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

          Agree with you. I also don't see much scope in reduction of statement. I liked the problem though. For a while, I thought a better example could have brought more clarity but then realized that it could lead giving out unnecessary hints. Hence, I do think it was a decent enough statement. Anyway, in general, interactive problems tend to go lengthy.

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

      Sir , itna tough , one of the toughest A problems i have seen

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

      Problem C man! Problem C. Wrote a huge code which took 20 minutes of debugging and even after that just missed the deadline and then you present a solution like that. Felt so dumb after that.

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

Indian Round :)

Thanks for this round.

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

Ashishgup fanclub; Can't wait for contest :3

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

As a tester, I found the problems interesting and the contest to be well balanced in terms of topics/difficulty. Highly recommend taking part in the contest

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

It's my first time participating in a live Ashishgup contest and I feel so proud!( there aren't many Indian rounds :') )
Big fan here !

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

hope,setter provides short statements.

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

Wow, Indian Round.

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

I have already started liking the contest.

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

It's kinda proud feeling for me to participate in Indian rounds..So excited...Jai Hind !!!

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

After seeing this name Ashishgup it gives me goosebumps

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

'''

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

A graph prob for sure.

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

Feels like an Adrenaline Rush .... Can't wait XD

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

Great to see you back after more than a year. Looking forward to an educative and interesting round :)

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

I am proud of my country India. Thank you very much Ashishgup..

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

Please make sure the problem difficulties are balanced and don't go from 1000 in B to 1700 in C...!

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

It was a pleasant surprise waking up this morning seeing a contest blog and a contest scheduled just after a day too.

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

So excited to see Indian Round in Codeforces

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

Really excited to participate for the very first time in an Indian round. :')

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

First time, i will get a chance to part in competition by Ashishgup .

Big Fan Ashishgup :)

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

Man, it has been a long time that comments go in such a very positive way. And it’s really cheerful to see these support and confidence to a problemsetter. I hope the round goes well and thanks for the great efforts!

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

Wow, An Indian Round and that too of Ashish Gupta. Can't wait to participate in it !!!

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

Thanks a lot codeforces for these contests !

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

Excited!

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

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

Woah! An Indian CF Contest, after a long time! It will be fun! ;)

Thanks!

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

    Can someone please explain, why so many downvotes, on my above comment?

    I didn't make a wrong statement! I haven't made any wrong claim! I didn't say anything wrong about anyone!

    I just thanked the authors! What's so downvoting in that?

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

Good to see aryanc403 as one of the testers.

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

Woah, Indian round! That's so nice

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

Hope strong pretest and clear statement!

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

After a long time Ashishgup wouldn't participate in a contest XD.

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

$$$I \,\,am\,\, from\,\, India\,\, and \,\,Participating \,\,for \,\,the \,\,1st\,\, time\,\, in \,\,Indian \,\,authored \,\,contest.\,\, Quite \,\,excited!!$$$

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

There are many red coders from India. I request Mike to give the opportunity to make one contest by an Indian in a month.

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

It's good to see Indian Problem Setters ! Expecting :) Great Problemset :)

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

    I don't know why I got so many down votes for this comment But Yeah atleast I know they werent Indians who disliked this ! :) :)

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

gonna attempt my first indian round .. #excited

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

DELETED

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

After long time Indian setters...hoping for a great contest

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

WOW!! Extremely excited for a contest by GRANDMASTER FastestFinger

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

Eagerly waited for this trio to set problems. :D :D

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

Good luck! Hoping for an interesting round

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

It is my first Indian Codeforces Round. XD Overexited to participate in it. Hope that this contest goes very well :D

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

I hope one day problemsetters will be hyped caused by quality of problems instead of nationality.

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

    I agree. The reason behind the hype is only the fact that there aren't many Indian problem setters and the last round by Indian setters was quite a while ago, so this round comes as a pleasant surprise to many.

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

    I agree. The setter is not hyped here. You can see the past contest prepared by him. The quality of problems prepared by him are always good. Indian contests are rare on Codeforces which is the very reason of the excitement.

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

    Problem-setters are hyped for their problem quality indeed, McDic, Monogon, FieryPhoenix to name a few! And Ashishgup does make good contests!

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

      I think that PrinceOfPersia's problems are really nice. But he did not offer problems for a while...

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

        I saw too much hate speech in his last round. Sadly.

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

          I don't know what kind of drug(s) you're on, but I suggest you change your dealer man.

          めんどくさい

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

            Maybe I am mistaken. I thought there was something happened around #406 and later two guys who claimed to be your student.

            I thought the community wasn't kind to you that time and I felt bad for you. Now I know, I were in drug then maybe.

            Anyway, good to know that wasn't the case.

            Btw, your logic has fallency, if my drug works so well, I shouldn't change the dealer, right?

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

Congrats to our indian problemsetters, I'm really excited about this round!

And talking about excitement, we will upsolve the problems 5 mins after the round:

https://youtu.be/yDdzbZhSYD0

See you on Algopedia!

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

It's a Div. 2 round. So why there is no Expert or Specialist testing the round?

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

Can't wait to compete in another round after a yearr! >.< so excited. cc LalisaManoban

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

We are expecting short background story. I hope there will nothing like this

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

    I liked the editorial very much. It's the first time I've seen something like that and it's cool ig.

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

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

wow Indian round :) . Hope for good problemset. First time participation in a south Asian problem setter contest in codeforces...

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

I'm an Indian and also admire Ashishgup but I swear majority Indians get proud even if the word "India" is mentioned lol.

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

We will remember this round!

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

Another contest in May!

This is going to be the 11th rated round hosted in the month of May. Though, out of the previous 10, one got declared unrated due to long queues, but still it's an effort worth appreciating. Kudos!

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

    Yet Another HateForces and FollowTheHerdForces Problem!

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

      Dude that meme has been posted thousand times in codeforces comments section.Stop crying for downvotes everytime. The community knows better.

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

      How 'bout reflectin' on your comment's content first bub.

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

Ashishgup, see the number of your fan followers XD

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

I really had enjoyed testing it ,and highly recommend it for every one

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

Happy to see Indian problem setters!!

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

How can i miss my favourite coder's contest !! Very excited :)

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

I hope current long queue won't effect this contest :(

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

As the Round number is a palindrome!(646) . Thinking that some tasks will be pal IND romic

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

How many problems FastestFinger set? I am afraid that my typing speed is not so good.

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

it's been a while since i have participated in contest, keenly looking forward for this round

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

    me also, will target pruple this time

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

      I think both you are same person !! Why did both of you not give the contest ?

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

        oh yeah, sorry i am same, actually i was about to give from the above account and i was really excited about it, but unfortunately my internet connection messed up, it took a long time to load the question so i skipped

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

Ashishgup :: "TheOneYouWant for helping with preparing problems and giving new ideas"

Me :: You are really good friends. :-D

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

Indian Round :D

Hopefully, there will have no ugly geometry.

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

hope to solve problem C ..

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

This round is so much more famous than other codeforces rounds so far . Seriously, just have a look at the number of upvotes it has so far.

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

    https://codeforces.com/blog/entry/76777

    Also, by famous do you mean famous in one place or just really famous worldwide? Because the second one can't be accurately deduced by codeforces upvotes (see the number of participants from each country).

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

      Though the number of participants are almost same but the number of upvotes says about the popularity of these guys in India and the number of Indian participants taking part regularly in CF contests.

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

Even the contest is Made In India by the "Make In India" initiative!!! Aur kitne ache din chaiye Mitron!

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

enjoy this round

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

Good contest!!

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

[Deleted]

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

Hoping to see short and concise problem statements!

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

Problem setters from other countries write contests every week: Nothing happened Problem setters from Indian: "wow, Indian round" Indian, Indian everywhere Plz stop yelling Indiots!

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

It will be my first Indian round. Hope to have a good contest!

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

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

amnesiac_dusk Waiting for your round

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

Why is every Indian comment getting so many Downvotes?

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

    Its really cringy to associate codeforces contest with patriotism lol, which many are doing here. Thats why they are getting downvotes

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

      But I have seen similar comments during the Chinese contest's but none of them got any downvotes. Can you give the reason for that as well

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

        https://codeforces.com/blog/entry/76895

        This right here is the blog for the previous chinese round. I have scrolled through the entire comment section and found very few, probably less than five comments that are being "patriotic" about the chinese round. (Of course, I counted two, but I'm willing to admit I may have lost a few because of the sea of comments complaining that it interferes with breaking fast on the Indian subcontinent).

        I haven't counted the number of "patriotic" comments on this blog, but I'm willing to bet that it's a bit more than five. Reading that kind of thing gets annoying very quickly.

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

every comment on this round

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

Wow, even I'm Indian, but this comment section is next level cringe.

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

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

Thoda time jane do. CF pe indian rounds hi dikhenge.

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

When do you guys have dinner since the contest runs from 8pm to 10pm in India?

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

Although final sem exams from tomorrow, how can I miss this contest set by great Ashishgup!

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

Here's the problem statement:

for comment in comments:
    if 'india' in comment.lower():
        downvote()

Please explain the logic of this Problem??

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

Itne excited hai sab kahi chutiya na kat jaye.

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

Docking Complete !!

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

Good luck, have fun, guys!

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

Now I am seriously doubting myself why I started CP in the first place.

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

Short statement and Nice Problem Thanks :)

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

Thanks for the contest! IMO the problems are really interesting!

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

Man I made stupid mistakes ugh... I could have done better

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

problem C -> Test case 3, please reveal yourself :( :( :(

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

    There's only one node in the graph...

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

    Could be something like this- 1 4 1 1 2 2 3 3 4 A skewed tree considering the special element as root. Answer is always 'Ayush' in such cases

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

    EDIT -> I am stupid to have read the problem incorrectly. Ignore below

    I tried a few approaches, but one approach which looked really correct was -> If x is leaf then -> Ayush, else if K = N — 1 — degree[x] (number of nodes not counting level 0, 1 when tree is rooted at x) is odd then player 1 else player 2.

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

      if x isn't a leaf, x will become a leaf only after N-2 removals, so change your K to N-2 and it will work.

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

Either D or E alone would have made this contest worth all two hours of it. Nice problems. :)

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

How do you do problem E? I tried constructing an euler tree and sorting by values and doing some stuff with that using sqrt decomposition but it failed pretest #9... I didn't use segment tree because I'm bad and don't know how to update ranges from [l,r] to 0 and find sum from [l,r]. Is that the correct method?

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

    Problem E is just a greedy observation. First, you observe that you should replace each value of A with the root-to-leaf minimum (since if you can swap here you can swap at any ancestor). Then, within each node, you just swap as much as possible (such that as many 0s and 1s are in the right positions as possible). This can be implemented with a depth-first search to find how many swaps you perform on each node.

    At least, I assume that's the correct greedy observation. Systests could end up proving me wrong.

    Edit: passed systest. Seems my greedy is correct after all.

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

      Ohhhh ok I was thinking of the root-to-leaf thing during contest but didn't go through with it ahhh, that's very smart. Cool problem

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

    Actually the solution is easier: first check that number of 1-0 and 0-1 vertices is equal. Then mark all such vertices that there is no vertex on the simple path between them and root of smaller value. Now notice that you only want to shuffle equal number of 1-0 and 0-1 vertices at a time. Go through the marked vertices in dfs traversal order and match the maximum possible number of 1-0 and 0-1 vertices in their subtree. You can return the leftover vertices from dfs to the parent call to avoid any complicated technique of tracking what's been matched and what's not.

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

    It was a simple dfs, nothing special.

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

Why is this incorrect in D — Find maximum. Then use binary searchto find which subset contains that max element. Ask another query not containing that subset

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

    I passed by doing this. Did you see that when only 2 elements remain, 1 query is enough?

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

    I also did this but I think my binary search is lousy. So it may be taking more than $$$10$$$ for worst case of $$$n=1000$$$.

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

Damn man, I don't remember having such nice concise no bs questions before. And not to mention that I loved both the graph problems. Jolly good contest bois.

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

I was only able to solve the first three (took way too long on C) but those were really good and interesting. I especially liked the short and direct statements. Waiting for the editorial..

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

Very nice contest. Problem E was very interesting.

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

Indian rounds are allways great!

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

In D I am getting WA on pretest $$$4$$$. But I think in worst case I am querying only $$$12$$$ times.

My approach is to first put all indexes of subsets in query to get the maximum element. Then I binary search the appropriate subset which has maximum. This should take maximum $$$10$$$ query. Then I leave that subset and query all other subset. This is $$$1$$$ query.

In total $$$12$$$ query where I went wrong? Thank you. Reference submission: link

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

    The union of all subsets may be not the whole array $$$A$$$, so if the maximum value is not in any subset, you will get a WA. Try this:

    1
    3 1
    1 1
    

    and array A is $$${1, 2, 3}$$$.

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

Why do I feel that A is always harder then B and C /:

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

life of a div2 scrub:

WA on div2A twice, take 15 minutes to solve

skip problem B because misread and thought it was too hard

go to problem C, misread and overcomplicate solution, then spend next hour tilting because you overlooked one bug in your code that messed up an otherwise correct solution (after WAing 6 times)

go back to problem B, realize it's not as hard, but since you have like 10 minutes left you code a greedy solution that probably will TLE once they use stronger tests

pog champ tbh

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

After 10 mins: +4000 submissions for A and only 800 AC.

This feels like: Bro, am I joke to you? xDD

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

Can somebody please help me out on why my solution fails for problem A- https://codeforces.com/contest/1363/submission/82135360

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

I'm surprised that D didn't have as many solves as E. Maybe the somewhat confusing problem statement threw people off.

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

    That's usually the case with interactive problems, people just get scared of them

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

Can anyone tell why my solution 82140244 shows WA on pretest 1?

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

    your solution gives $$$!$$$ $$$3$$$ $$$4$$$ as the final answer. It is different from $$$!$$$ $$$4$$$ $$$3$$$ as order matters

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

Problems are interesting and tricky both.Though i just read a,b,c and solved a & b(with many WA).

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

A — Find the number of odd and even values in the array, then enumerate how many odd numbers are chosen (or, equivalently, how many even numbers are chosen).

B — A good string is always either some number of 0's followed by some number of 1's, or some number of 1's followed by some number of 0's. Enumerate where this change happens, and maintain the number of 0's and 1's on each side.

C — If x is a leaf, the first player wins. Otherwise, if n is even, the first player wins; if n is odd, the second player wins (I do not know how to prove...)

D — Consider the maximum element of the array. Note that all but at most one value in the password will be this maximum element (because at most one subset can include it). We find the maximum value of the array using 1 query, and binary search to find where it is. Use another query to find the value in the password whose subset contains this maximum element. When n = 1000, exactly 12 queries are used (10 for binary search and also 2 other queries).

E — Set all a[i] to be the minimum a[i] of itself and its ancestors. Then do a DFS and greedily try to match as many values as possible, leaving values that cannot be matched to operations performed further above.

I do not know how to solve F.

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

    C is because in the 2 node case whoever's turn to move wins otherwise it's a race to put the other guy into a losing situation (if anyone knows the 21 game it's kinda like that)

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

    In problem C, you keep removing nodes until a node — x is connected to only 2 nodes. then if player 1 removes the next node then the player 2 wins.

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

    For C, consider this tree of 4 nodes 1 2 1 3 1 4

    and the special element being 1. In this case won't the winner be second player?

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

      No. The first player would win in this case.

      After the first player removes a leaf (let's arbitrarily assume it is node 2), the tree will become (1, 3) and (1, 4).

      After the second player removes either 3 or 4, node 1 becomes a leaf and the first player can remove it, thus winning the game.

      Remember that the tree is not rooted.

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

        Thanks for clarifying, I mistook 1 to be a leaf for the whole contest and was trying an overcomplicated solution. Looks like I should stop practicing coding and start practicing reading.

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

    My solution for C was very different: Let dis[i] be distance of i from node x.

    Choose a leaf where dis[i] is even and smallest, and remove it.

    If no even dis[i] exist then: Choose a leaf where dis[i] is largest, and remove it.

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

    You can see editorial for the proof of C :)

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

Can somebody help me out with problem B. I couldn't really come up with an algorithm.

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

    Divide the string into 2 parts. The first part' elements are all 1 and the rest are all 0 and vice versa

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

    You can see that for the strings to be good, it should be of one of the following 4 types:
    000000...001,000000...011, ... , 011111...111 — 0s followed by 1s
    111111...110,111111...100, ... , 100000...000 — 1s followed by 0s
    all 1s
    all 0s

    You can use n^2 solution to check the cost of converting to each type and take minimum of all the cost. O(n) solution would be to use prefix sums to compute the cost of each type and take minimum.

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

    Try to make the sequence monotonic, i.e ..11110000.., ..000111..., ..111.. or ..000.. using bruteforce. Pre count the total number of 1s to do that efficiently.

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

    Count all 1 in string, then loop for the separating point of string (The string should be 11111....00000.... or 00000.....111..... SO find the point where 1 change to 0 of 0 to 1). While looping, keep the count of the number of 1 since the beginning. This way you can know the numbers of 1 and 0 of the first section and second section of the string. And knowing those you can find the minimum number of character you need to change (Sorry if I confused you)

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

Cries in green tears :)

Pics-Art-05-17-05-41-15

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

This is really a good contest. D is really interesting.

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

What's the proof for C?
I'm really shocked by the solution

EDIT: Misread the problem didn't notice it was an unrooted tree :(

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

    No one would pick the node that will let opponent win.

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

    A tree has allways leafs. The player can allways choose a leaf not adjacent to X if such one exists. If it does not exist the tree has size 3. (X and two other nodes).

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

    If $$$x$$$ is leaf then it's obvious Ayush will win. Else in last only three node will be left where $$$x$$$ will be in the centre of both of the nodes. Thus problem reduces to NIM game , where we have pile of nodes size n-3 and each player can only remove one at a time and that person will lose who has the turn after n-3 nodes have been removed .it's easy to see that if n-3 is odd Ayush will win else Ashish will win.

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

my bad luck ..submitteed problem c solution on problem d ... and then after getting wa .. then leave that question....

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

Here is the link of solution of problem — A

https://ide.geeksforgeeks.org/glqVZp3ceg (ide.gfg link)

This is giving wrong answer on pretest 3 Can anyone tell where I did wrong ?

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

    Check this test case

    3 2

    1 1 1

    Your solution should output "Yes" but the answer is "No". The problem here is that the testcase only allows you to choose maximum 2 odds but your solution allows 3.

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

In C if tree is connected then how can degree of x be 0.(Wrong answer on pretest 6)

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

Any idea of testcase 4 of E. I tried recursive solution. Link to submission: 82138471

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

Is B is some well-known algorithm?

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

    I kept a count of 1s and 0s at each index, then iterated over the array and at each iteration, calculated the cost of making 00..11 or 11...00 or 00...00 or 11...11. Kept track of min so far.

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

    It's an ad-hoc problem. The observation is that the final string will be composed of two parts, one part is all 1 and one part is all 0. You can simply try all N possible cutting points, keeping track of the number of zeroes and ones in the prefix (using that to calculate cost of each cutting point), and then taking the minimum. Time complexity should be O(N) if you calculate cost of cutting points efficiently.

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

Fun problems. A friendly suggestion would be to perhaps keep the names of game problems as Alice/Bob or at least something more distinguishable. Would likely be less confusing for people unfamiliar with such similar sounding names.

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

Good statements, strong pretests, only me left stupid

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

17 submissions to solve 3 problems, that's a new personal record

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

    Atleast you realised where you were wrong before the contest ended. I realised what i did wrong after the contest ended :(

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

Wow! what a bad day for me. Overkilled A with Dp and couldn't solve C just because of the case missing when n = 1 i.e. degree of x is 0.

»
4 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
left the contest in between-
     I am so f-ck-ng sick of myself!!
»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Great problems! I was wondering if someone has a solution along the lines of Nim for C. I first reduced it as piles of size $$$size[v], v \in N(x)$$$ where $$$size[v]$$$ is the size of the subtree rooted at $$$v$$$. However, that is wrong here since the losing state is not when all piles are empty but when there is at most 1 pile. I wonder if there is a correct reduction.

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

    I also tried it but unfortunately couldn't proceed further because the answer also depends upon the last pile left.

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

    Yeah, I used the exact same approach. The key observation is that no matter what (unless it's a trivial case where x is a leaf) the final state will always be x and two leaf nodes. After that the next person that plays loses as the person after that will take x. The answer will always be the same irregardless of the structure of the tree (again ignoring the trivial case). So the answer will only be dependent on the parity of the number of nodes i.e if n%2==1 then Ashish wins else Ayush.

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

    The nim value would be xor of all the values of $$$size[v] \pmod{2}$$$

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

I thought codeforces is using an API to get my first name and use it in the problem statement. In between contest I opened the problem statement in incognito to verify! P.S: My name is Shubham and I could only solve the first two problems with my name. Coincidence? Think not. RIP rating btw

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

I'm kind of mad about D. I didn't read in the string "Correct"

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

can someone here explain problem C ?

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

    Edit: This doesn't work.

    Haven't solved it. But I think it should be like the typical DP approach to the stone game. If you start with BFS at the winning node, then mark it as WINNING and every neighbor of the WINNING node will be a LOSING node, and so on, every neighbor of a LOSING node will be a WINNING node. After this go to all leaf nodes, if any leaf node is a WINNING node, the first player wins. Not sure, but I think it should work.

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

    if node x is already a leaf node then Ayush wins.

    In other cases, the player will make sure that other player don't win.

    The player will keep removing nodes until a node — x is connected to only 2 nodes. then if Ashish removes the next node then the Ayush wins and vice — versa.

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

    if nodes that are connected to node x is less than or equal to 1 then answer is Ayush else if n is even then Ayush else Ashish.

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

    if x is a leaf itself then Ayush will remove it and win.

    if x is not a leaf that means at least two nodes are directly connected with x.

    The first player who will make x leaf will lose.

    Remaining these x and at least one node directly connected with x, we have n-2 nodes.

    Among these n-2 nodes they can turn non leaves into leaves by removing leaves one by one.

    Following this process, whoever will remove the last leaf (among these n-2) that is directly connected with x will lose.

    (Sorry for my bad English )

    Update: I was typing and Harshil_ posted a good explanation.(Again sorry for re posting)

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

Hume toh apno ne loota , gairon mein kaha dum tha ! INDIAN ROUND

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

Unfortunately , problem F has appeared previously (Shifts) but otherwise nice problemset !

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

Thanks for a nice problemset — well written problem statements (the brevity was refreshing!) and good distribution of difficulty. Problem E in particular was very interesting.

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

In problem, C I ran a dfs to count total number of nodes even so it was given in input. smartness level — INF

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

do we have to solve B using prefix sum values of of ones and zeroes???

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

To the patriotic people after round

Anyways,thank you problemsetters for such amazing problems.

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

Problem F is the same as gym101438A https://codeforces.com/gym/101438/

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

Why are the constraints of C so weird? I had a O(n) solution in mind, but I got diverted thinking maybe O(n^2) is the intended solution and I'm thinking in the wrong direction.

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

    Why don't you use a $$$O(n^2)$$$ solution for A?

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

      Even though n in both problem is same, number of test cases in A is 100, whereas in C is just 10, hence the self doubt and hence the confusion.

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

    +1. I spent a lot of time assuming I missed something because it's quite simple. But it's a different experience because I had to prove the solution.

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove the cheaters, fix wrong division cases and update ratings them again!

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

Take a look at this submissions for 1363C - Game On Leaves and 1363E - Tree Shuffling. Looks suspicious. 82106134 82137533

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

Can someone explain Problem C — Game on Leaves?

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

    If the special node is a leaf node, then the 1st player will win. If it is not a leaf node then both players will remove the edges/nodes one by one keeping in mind that they don't let the other player win. So, both of them will remove edges such that the removal of the edge doesn't make 'x' a leaf node. It turns out that the answer will be player 1 if the number of nodes(n) is even and player 2 if n is odd.

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

Please, for the love of god, someone tell me what is wrong with the following answer to E: https://codeforces.com/contest/1363/submission/82145487 I really hope something is wrong so I won't feel I was python-robbed again.

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

    I say yes, you are robbed by python. You got runtime error due to stack overflow. Actually, recursive calls in python require more stack space than other languages. So you can just avoid recursion instead use an iterative version of dfs or use bfs.

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

      I ended up finding one solution, and creating one solution.

      1) At first I searched for a while, and found "bootstrap recursion" that someone posted a while ago. Solution: https://codeforces.com/contest/1363/submission/82165464

      2) I implemented an iterative dfs. That was challenging, because you need to deal with the return values for the "recursive" calls, and also maintain local variables. Unlike a simple dfs, you can't just push all your neighbors onto a stack, but you have to push one, finish with it, somehow get a return value, and then push the next. I kept a counter that shows how many of the node's children visited the node, and when the counter reached len(neighbors), I filled the return variable, and popped it from stack. Maybe it's trivial and this solution is simple, but I looked a while for solutions for this and did not find even one (only a reference to a pdf that didn't work, about this matter). Solution: https://codeforces.com/contest/1363/submission/82215100

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

Where are pretests? 29 people got WA37 on problem D. It is right solution, but with output second maximum instead of right query (ask maximum without set, which contain maximum). Really? None of more than ten testers didn’t offer to make such an obvious test in pretests? Normally Codeforces. That's one of the reasons why literally everyone exept 1300 newbies dont like that platform. I go in every time, hoping that I will finally write a good round. Why rounds are getting worse and worse? This round was like 5 very easy standart task, and string dp. I Recommend problemset. I recommend problemset if you want to be disappointed again.

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

I liked the problems so much that i have upvoted this blog from my 4 fake ids.....thanks to all problem setters....

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

Great problem set! Really enjoyed solving them. Got stuck on D because I assumed the sets to be a complete disjoint classification of indices. Ah well.

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

what is wrong in this solution and how can I see the rest of the test case? https://codeforces.com/contest/1363/submission/82125300

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

C's examples is igual to nothing

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

    But i think if the problem had more illustrating example then it could have been an A category problem...

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

why we should run many test cases in one run ? why we should read result after outputing answer in interactive problem ?

all this shits are in codechef, so indian setters don't use these stuffs in CF please.

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

Really interesting set of problems! Multiple solutions were possible for B and C. I don't know about D,E and F.

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

Wonderful Problem Set Created... Cant't Wait for Next Contest!! :)

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

Why are my uphacks of problem F getting "Unexpected verdict"? Does the model solution also forget about multiple test cases and do memset on a 2000x2000 array in each test?

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

ME: Sees First Problem (Thinking it's cakewalk). Does 8 submissions none get AC.

Also ME: Tries B. Gets AC in first attempt.

Sad Life :(

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

    A had ridiculous amounts of corners :( I personally think that A is harder than B + C, maybe harder than even E (simple logic, but 3 corners?).

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

solution of Problem C (Div 2) : Problem C

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

An overall good contest but disappointed with C because many got that right just because of guess.

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

This round was something else man!! It took me more than an hour to recognize that I should move on to question B . All I can do now is to take help from editorial . Anyway , this was a great experience in the start of my journey , though I didn't do well .

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

In problem C, why were constraints too light?

1<=t<=10 1<=N<=1000

These constraints keep on telling me that it can be solved in O(n*n) and no less.

By the way, nice problems :)

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

.

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

    Because :

    1. There's no reason to be proud to be Indian if some other Indian makes a good contest.
    2. No need to thank Mike because authors thank him in every announcement blog.
    3. Your P.S. is annoying.
  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Please don't bring patriotism to codeforces. We're here to become better coders. There's nothing to be proud if an Indian setter sets good problems because it has nothing to do with the country but just the individuals. Finally be proud when you do well yourself

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится -11 Проголосовать: не нравится
      Finally be proud when you do well yourself
      

      Don't!

      It might just be rating inflation doing well and not you lol!!

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

can anyone please explain to me why this N^2 solution of the problem B is giving TLE on test case 4. My Code

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

    as far as i know, passing by value is faster since the value is only pushed and pop into/from the stack(if ever, and not copied to a register) and thus, generates few operation codes (in bytes), i think only 2 bytes for push and another 2 bytes for pop instructions. while in passing by reference, the compiler generates a pointer to the variable, and this generates more op-codes for a particular set of instructions.

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

[Deleted]

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

Waiting for another round!!

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

Thanks Ashishgup and team for such a wonderful contest. I indeed felt this tough than other contest and was hardly able to solve two problems. Rating dropped hardly matters, knowledge gained that matters the most. :)

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

A genuine doubt: How do you guys handle the prefix, suffix array questions. Like I figured out the approach for B very early but implementing it was a headache. I had to dry run on many test cases to figure out the exact equation inside the loop. Like whether it should be pref[i] or pref[i+1]. I spend too much time on these types of questions. Is there any standard way of solving prefix suffix type questions? Eg. using n+1 size prefix or n size prefix?

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

    I can relate to that. Some time ago I'd always guess the index arithmetic (like, should it be i < n/2, i <= n/2, i < (n+1)/2, etc?). What helped was sitting down with a sheet of paper and figuring out the rules and proving them for myself: which indices should be inclusive, which should be exclusive; how to find the element on the opposite end, how to iterate until the middle and so on. Some of these things are different between 0-indexing and 1-indexing!

    For prefix (suffix) sums there is a general problem that the first (last) element is special, but you can avoid it by adding one dummy element (as you said, size n+1). If you prefer 1-indexing, you can actually use a prefix sum array where 0 is your dummy element, and it turns out to be quite natural. Since I prefer 0-indexing, I started using suffix sums by default, because then I can add the dummy element at the end. Here's my solution for reference (not a single if!): 82071669. You can see that I actually put two dummy elements at the end because in this particular problem, k needs to go through n+1 different positions, but that was probably not necessary.

    As to pref[i] or pref[i+1], decide for yourself if you want to work with inclusive indices on both ends (my preference) or half-open intervals (like C++ std lib). For example, I set pref[i] := a[0] + a[1] + ... + a[i], and then I know that pref[i] and suff[i] always contain a[i], so:

    • sum(l, r) = pref[r] - pref[l-1] (because l-1 is not in l..r)
    • sum(l, r) = suff[l] - suff[r+1] (because r+1 is not in l..r)
    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +5 Проголосовать: не нравится

      Thank You! That was very helpful. I guess 1 indexing with including prefix sums would be best for me. Equations look clear and descriptive then.

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

I have been trying the Problem D from quite a long time. I am always getting an Idleness limit exceeded error on test case 7. I am also flushing the output as it is asked. Can somebody please tell me as to why something like this happens. Here is my code 82189239

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

    There is a problem in the last query, you need to query on the compliment of $$$S_{ans}$$$. Let say S be the required set. Where ans is the index of the set containing the index of the maximum element.

    $$$S$$$ = $$$S_{1}$$$ U $$$S_{2}$$$ U $$$S_{3}$$$ . . . U $$$S_{k}$$$ — $$$S_{ans}$$$, according to your solution. But it should be $$$S$$$ = {1,2,3,4,....,N} — $$$S_{ans}$$$

    Try this once. You can see my submission for reference: 82155489

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

      Thanks a lot for the reply man. I will definitely try and do this. I haven't understood all of it clearly but I am trying to understand. Can I dm you in case I am not able to understand it?

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

Yesterday my sublime text editor was not working , it was due to installation of some web frameworks i was working on web development. So i used ideone and forgot to make it private and you can see that i submitted the code earlier and the other person doesnot even code in C++ , he submits in python but he copied my online code . I tried to check it from ideone but history was available for only last 11 hours . Please forgive me and i make sure such thing never happens again. Thank You

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

Did anyone else's rating change disappear suddenly?

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

Rating changes Removed ? Weird ! Is it still rated ?

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

QAQ...Why the rating rollbacked?

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

Ratings rolled back

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

I want to know why this round should take my points back.

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

My younger brother has been excited for changing to purple for a night,and now he is a little forlorn....

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

codeforces returned the rating with percent, it is a success!

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

CF-1

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

Thanks for the contest! This was my first one. Also, I really enjoyed the Editorial with Memes haha

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

    For me also , this was the first contest but it will not come in records because I didn't had even a single submission . Though , this contest tought me a lot about how you do not have to loose hope till the last minute .

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

Amazing div2!

Enjoyed DE a lot!

Authors — you are the best!

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

Codeforces Round #646 (Div. 2) C. Game On Leaves

In this question you have clearly stated that Each of the next n−1 lines contains two integers u, v (1≤u,v≤n, u≠v), meaning that there is an edge between nodes u and v in the tree.

That is for n=1 their would be zero lines so n=1 cannot be a proper test case but test case number 6 is->

1

1 1

which cannot be possible

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

I could solve a single problem. Why my rating increased?

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

    Basically you are rated on a level all other participants having the same result. In this contest this level was higher than your rating.

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

Does your rating ever disappered for some time or goes back to previous rating

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

https://codeforces.com/contest/1363/submission/82775041 can someone tell me why my O(n) solution for F fails ?