Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

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

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

Hello, Codeforces!

I'm glad to invite you to Round 643 which will start at 16.05.2020 14:35 (Московское время). Please notice the unusual time.

There will be 6 problems in round, one of them will be interactive. If you are not familiar with interactive problems, you can learn about them here.

Round is based on Team Olympiad in Lipetsk which is being held for the fifth time. Problems were prepared by fake123, iura, Masha237, Villen3tenmerth, Inessa Shujkova (Lipetsk teams' coach) and me. I would like to thank antontrygubO_o for CF round coordination and testers: KAN, I_love_Tanya_Romanova, vepifanov, Merkurev, golikovnik, Ekler and some other people who asked me not to write about them :)

Of course, I'd like to thank all Codeforces team for this beautiful platform!

Scoring distribution will be announced later.

Wish you good luck and high rating!

UPD.1 Scoring distribution: $$$750-750-1250-1500-2000-3000$$$.

UPD.2 Editorial is available here.

UPD.3 Congratulations to winners!

Official participants:

  1. NaimSS

  2. tianxiawoyou

  3. Lomk

  4. wisteria0410ss

  5. TheOneYouWant

Unofficial participants:

  1. risujiroh

  2. jiangly

  3. 244mhq

  4. hitonanode

  5. turmax

UPD.4 Full problemset from the olympiad is available on gym: Пятая Липецкая командная олимпиада школьников по программированию. Финал. 8-11 классы

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

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

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

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

    A bet:

    Spoiler

    So miserable.

    Just joking.

    Edit: Why are you downvoting me? I said I was just joking.

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

      I am the type of guy that don't want to hurt peoples.

      But really you are the worst joke teller I've ever seen.

      Sorry.

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

      Please don't spread this kinda demotivating jokes. Especially it's hurt peoples those works hard to make the round successful.

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

      People are downvoting as using nested spoilers doesn't make it a joke

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

Thank You MikeMirzayanov, for excellent Codeforces and Polygon platform.

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

is it rated?

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

Excited about the solo div 2 round after a long time.

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

Is it me or anyone else observed, bulleted list make announcement look bigger!

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

Yay! Another contest, hopefully I get a positive delta, as I have got a very bad feeling about my rating after how bad my previous contest went :P

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

it's been long time since we solved last interactive problem

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

Thank you Code forces Team and all problem setter for this contest frequency in this pandemic time.

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

Google jam round 2 is just after this round. 4500 participates has qualified for this code jam round and most of them wouldn't prefer to give two contests in a row... So wouldn't it be great if the contest is rescheduled to 18th May? So that more people could participate.

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

    I don't see any problem here. There is almost 30min break between contests, for some people it's even better to solve a few problems before contest. There were a lot of situations with multiply contests in one day.

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

      I am agreeing for some people there performance improves if they solve some problems before a contest but there is also another type of people who prefers a cool mind before a contest.So if the contest is rescheduled, then both type of would get the chance to prepare themselves to the fullest as well as participating in this round...

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

        See the point is, if you are in div 2 and thinking that you are going to be in top 1000 in codejam then you are either lying to yourself or living in world of fantasy or will be some mere coincidence

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

          Maybe you are right, it would super hard for me to be in the top 1000. I am still a beginner, I need to improve myself a lot. If I don't do different types of contest, how would I improve! I would definitely going to aim the top 1000, so that I can do my best and most importantly improve myself!

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

            I will also have to skip this round because of the Code Jam. Get what you are saying. I also perform poorly with 2 contests a day. But I think the unusual starting time is maybe because of the Round 2.

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

      25 minutes not 30 :D

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

    There are 25 minutes between Codeforces Round finishing and GCJ beginning. Of course it's not too much but in my opinion it's not a problem. I also don't think we can reschedule this round to 18th May because it's based on olympiad which is scheduled for 16th May. Some participants can start discussing problems and it will ruin the round.

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

I want to thank the author. Hope all the participants can achieve higher rating after this contest, especially me.

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

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

.

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

Three contests back to back! Thanks for saving us this lockdown

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

what will i get if i get a succesfull hacking attempt? i mean how will it affect my rating?

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

![ ](41h4pd)

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

    Oops, I am lated for the contest. Nevermind, I will try my best solving problems ^^

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

Can I get 100 downvote?

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

The starting time is very considerate for the contestants participating in Google Code jam :D

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

Long time no interactive problem! Look forward to it.

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

hoping for strong pretests this time

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

I need to delete the original comment just to say this. For f*ck sake.

Seriously, Codeforces community has a major problem. Not all of them, but some of them. They keep disliking comments, whether it is good or not. This is not good and need to be changed.There are a lot of nice comments and they are so underrated.

I don't say this just for my comment, but for all negative comments out there.

Recently, arrogant and memes are getting so much upvotes, while others are not.

The underrated comments are having so much downvotes because they are having a movement against the commenter.

So please, vote properly. Every comment is just the commenter's ideas and doesn't deserve to be downvoted.

Again, I don't say this to my comment. But, if you downvote someone that has literally good comments and innocent, you are a loser.

That's all I have to say. Vote properly, or you will make the Codeforces community worse.

STOP BEING RUDE TO PEOPLE.

I tried to be polite, but I need to say this.

Thanks for reading.

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

    a simple advice .. don't take downvotes personally anyone's comment could be downvoted just don't post your meme unless you think it's funny in the previous contest I had no funny memes in my mind so I didn't post anything if I did put some meme that isn't really funny I'll get downvoted as well let your comment adds something new if it doesn't it will look like a noise and will get downvoted probably

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

    The comment section of an announcement is supposed to discuss about the round such as time, quality of problems, solution etc. People looks for informative comments here.

    Making jokes, sharing meme on same topic and same idea doesn't make any sense. It gets boring. Discussion on irrelevant topic such as contribution, downvotes are also not good topics to discuss in an announcement.

    People gives contests here and solve problems so that they need to discuss something here. Don't make it like we need contribution so we solve problems and give contest.

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

would be my first round as an expert

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

I am new in cp.i don't understand the contest rating system of Codeforces. Plz someone tell me about it.

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

I think Codeforces-Logo needs a Mask of different color as Masks need to be changed after some time !

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

There's much mystery in this contest announcement:

  1. Why is DishonoredRighteous righteous yet dishonoured?
  2. Who is I_love_Tanya_Romanova's love Tanya Romanova? (is she Tatiana Romanova??)
»
4 года назад, # |
  Проголосовать: нравится -95 Проголосовать: не нравится

_**its iftar time in bangladesh. so u need to change the time otherwise contestants will be decreased dramatically. _

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

    otherwise contestants will be decreased dramatically

    Nice, smaller queue!

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

    .

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

      Every time it is on weekday during school days many American high school students can't take part, yet they don't complain every single time it conflicts, and that is many more times than because of iftar. It's not about religion or really even when most people can take round, it's about when problem setter can have round and have semi-consistency with times i.e. being within a few hours of normal time, and no matter the time some people will have conflicts. In other words, just deal with it.

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

It must be a good contest.

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

Is it rated? (Let's have -40 likes)

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

Educational Codeforces Round 87 (Rated for Div. 2) — May 17th (14:35 — 16:35 IST) clashes with Google Kickstart Round C 2020 — May 17th (16:30 — 19:30 IST). If this is a problem for many codeforces participants, please consider rescheduling Educational Codeforces Round 87.

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

That's great. Consecutive contests for 2 days.

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

am i the only one who can not spell Lipetsk (~˘▾˘)~ (~˘▾˘)~

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

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

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

My rating has been increasing since 7 contests, hope to continue streak.

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

I would compare div. 3 and div. 4 peape to paralympians. I hate pupils newbies and specialists. They should give up programming.

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

    first, change your profile picture. It scared me.

    second, you need to know that you are still a newbie. you shouldn't say something like that, especially when you are one of them.

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

      He got what he deserves Downvotes :P

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

      Lol this is my alt account, Can you guess? That's why you deserve to be noob...

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

        so be polite to everyone.

        You are not a noob for solving contests, but you are a noob at making content.

        Sorry for not being nice to you. I need to say this for everyone you hate, including me.

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

        Are you trying to make a record for most downvoted comment?

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

750 points for problem A. Is it for the first time?

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

While quarantine, time is always usual. Stay home, stay safe, do coding.

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

This is a friendly time for China.

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

Interactive?? In this round, Im in the rated ~~ BAAAAAAAAMMMMMMM

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

When you start to submit problem F...

Submit...

WA on pretest 5.

"WTF!!!"

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

Is the difficulty level of A and B same ?

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

bad time

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

I think A and B will have nearly the same difficulty and A might also be a little harder than usual A problem in the rest Div.2. Just guessing based on the Scoring! Hoping for a great contest!

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

Stop making contests with unusual time please :( many participants have trouble with this new timings, like coincide with university or school online class, Iftar time in Muslim countries, and ... You try hard about one week to make a beautiful contest but you annoy many participants because of the unusual timing(I'm sure you have your reasons for that but I think they aren't enough to change the usual time about 2 hours)

EDIT : Sorry, I didn't know the Google Codejam time :(

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

    First, you don't know about Code jam? It will be starting 25-30 minutes after the contest. It would be annoying to almost every Code jam users that is using both 2 webs if we delay the contest by 2 hours.

    Second, if you don't feel fine with unusual time, enjoy your thing with your family, friends, and participate in other contests in the future. Your rating won't change.

    If you want, you can give virtual contests a try. I hope it would be good for you :)

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

      Sorry, I didn't know the google Codejam time(Google Codejam is unavailable for Persians because of USA sanctions, so I wasn't aware of that)

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

Codeforces is the best platform to develop your cp skills. Thank you codeforces.

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

My first contest after Candidate Master.I hope good for me!

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

Why do I see all the normal comments downvoted?

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

The time is friendly to Chinese students!

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

The second earliest announced score distribution in Codeforces history !

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

I love Div.2.

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

Registration for educational codeforces started, so we would find masters in educp rated.

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

sorry-forces everywhere . . .

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

In problem D, does the subarry have to be consecutive?

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

I remember registering for this contest but am not able to make any submissions . the system message says that I haven't registered. where exactly am I going wrong?

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

C and D should swap their positions.

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

    so should A and B

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

      idk, i did A in one go but made 1 wrong submission in B, that was the case with a friend too, iterating through the array in reverse after sorting(ascending) seemed to be more intuitive for me, but that was obviously wrong.

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

If not F, it could easily be an Educational round.

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

F is so weird

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

how to solve A.I have know idea after two hours of thinking. Pls help me somebody.

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

    minDigit(a_n) will become 0 rather quickly and then your answer does not change anymore, because 0*x == 0

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

Video Tutorial for C

Enjoy watching!

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

Awesome contest!!! During the first 30 min, I was like holy shit!!! none accepted ...which question to try...

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

How to solve E?

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

Am I the only one, Who try to consider each one in one of the group. Problem B.

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

I solved D, but can't prove solution.

I can prove solution in C, but can't solve it :)

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

C: "Non-degenerate triangles".

CF users:

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

Solved C and D but couldn't solve A and B ,I was blank for the fist 30 mins XD

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

    When you will get to know the solution of A, then you will be surprised possibly. I was laughing at myself. peace!!

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

Specialist rank here I come...

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

lol I used FFT in C.

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

    Wait what?

    I still don't know where FFT is usefull and know even less about what FFT really do, and I destroyed two forests with draft copies, please, save the earth and tell me how to use it xD

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +32 Проголосовать: не нравится
      tot = 0
      for (x = a; x <= b; x++)
        for (y = b; y <= c; y++) {
          for (z = c; z <= d; z++) {
            if (x + y < z) tot++;
          }
        }
      }
      

      The naive solution is like that. Basically, I just create two polynomials X and Y. X = 0 + ... 1x^(a) + 1x^(a+1) + ... 1x^(b) (everything is zero before a) Y = 0 + ... 1x^(a) + 1x^(b+1) + ... 1x^(c) (everything is zero before b)

      I multiply the two using FFT in O(nlogn), then we get polynomial product. We check all terms in the product, and count how many z (third side) can we build using it.

      I know there are simpler solutions, but my brain is tired today lol

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

    If you want to solve it without using FFT. It can be solved easily, by some pref arrays(two). you can see my submission.

    Note : x + y > z Hence i made a prefix array for all possible values of z — y.(x > z — y). and then make another prefix array in which, pref2[i] denotes total number ways to obtain sum < i.

    so we can simply iterate over all x.

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

    what FFT means? i solved C by fixing x and finding optimum y and z in o(1) time https://codeforces.com/contest/1355/submission/80351154

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

Newbie rank here i come...

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

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

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

I can say that when the writer(s) are writting problem F, they are listening to something interesting...

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

It's only my opinion, but I found the C waaaay more difficult than the D. It tooks me like one hour to do math and two paper sheets died in the C, and the D tooks me 10 minutes and 1 minute of thinking... or maybe there were some formula that I didn't knew about which would be very helpful for the C ?

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

Maximum solved doesn't cross even 8000.Hardest round without a doubt.

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

Problem writer should have boldened this line "It's not necessary to include every explorer in one of the groups: some can stay in the camp" in problem B. Created a lot of trouble for me today.

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

    Same, Like when there these types of conditions, Generally It is written in the Note section.

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

C and D should be exchanged.! C looked pretty easy at first, but gave a Hard time because of so many corner cases!

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


Tbh the contest is really good. Regardless the hard C.

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

    I found C rather easy to think but troublesome to implement. Had to think exhaustively forthe edge cases and ultimately that took more than an hour in the end. Let's hope it doesn't fail the system tests :)

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

I can't understand why am I getting a TLE if the code was submitted in C whilst the same code being submitted in CPP gives me AC.

My code : https://codeforces.com/contest/1355/submission/80368483

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

RIP codejam

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

If the problems are meant to be in the increasing order of their difficulty then the setters should strictly follow it.

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

Irritating A. I could not think of any logic, then I just wrote recursion, and surprisingly it was terminating to a single value every time. Can anyone explain why it settles on one value. Is it not possible for minimum digit to be never zero. And for the fact that C was much harder than D it should have more points.

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

    Maybe it's possible for the last digit to never be zero, but since the number increases by at most 81 every time (in the absolute worst case), the third last digit can't skip over zero, and since in each iteration (before any digit becomes zero) the number increases by at least 1, it will take less than 100 iterations.

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

    Note that the maximum term that can be added ever to a(i) is 81. We start from a[1] and keep adding terms to obtain new a's. Now as soon as the thousands place changes (i.e. increases by 1), the corresponding hundreds place will always be 0. This will obviously take less than 1000 steps.

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

      Thanks finally understood what you are trying to say. if a number less than 1000 (let's take 987), if it crosses 1000, than 100th place has to be zero because we can add maximum up to 81. In this case a(i+1) = 1050 (987 + 7 * 9).

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

ahhh shit, starting from C was bad strategy mehn

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

How to solve E? Is it 3-point search?

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

Solved A, B and D, but all of them just a guess. Would not be suprised to fail all three of them in system testing.

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

Difficulty level : A>B && C>D .. Not sorted and even I can not solve A but solved D .

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

Constructive Forces!

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

Why problem E satisfy binary search?

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

    ternary search

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

    I solved it using binary search on the answer.

    The graph of the cost vs height would be a parabola. So the only thing monotonic is the slope.

    So find the cost of building walls of height mid and then also find the cost of mid+1 and mid-1.

    this would give you a fair idea as to where the slope is negative.

    The binary search conditions would be:

    • if ( val( mid+1 ) < val( mid-1 ) ) then high = mid-1
    • if ( val( mid+1 ) > val( mid-1 ) ) then low = mid+1

    and always keep updating the answer as minimum of previous answer and val(mid)

    Link to my code

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

The pretests for Problem D were weak. Solutions only considering K, not S-K were passed. They should have included test case like

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

I solved C.

I guessed A,B and D.

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

How to prove that choose k=1 and a[i]=2(except the last one) in D is the optimum solution? I attempted to prove it in the contest but failed. Wasted a lot of time...

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

I wasted one hour on C, and still wasn't able to do it. Could have easily done D in that time. Waiting for the C problem editorial.

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

A think more code less round. I like this although i can't complete thinking of C in time.

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

In problem D, can the selected array contain 0?

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

Can anyone please tell me why this submission for problem A got TLE? https://codeforces.com/contest/1355/submission/80313479 Similar solutions got ac.I don't know why!

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

How about we have strong pretests once in a while? D had >= 21 pretests, so I thought my logic was solid and I should not waste my time on thinking over it, and now I got it failed at test 24. Amazing.

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

Does anyone know why my solution for B got TLE https://codeforces.com/contest/1355/submission/80331871? I can see that other similar solutions submitted with PyPy2 got accepted.

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

codeforces setters be like

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

I wonder what is this pretest 24 of D many people are failing on it

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

The pretests of F are extremely "strong". :)

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

Almost 70% of the pretest-passed submissions to Problem F failed on system tests... What a scary ratio...

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

I got a WA on test case 5 of Prob C. When I ran the same test case on the same code in my system, I got the right answer. Can somebody tell me when does such a situation arise? I had used the same logic as given in the Editorial.

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

BADC

Find the minimum number of swaps to sort the contest. Still a good contest..Thanks for efforts :)

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

C and D should swap their position

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

When does rating gets updated?

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

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

Can someone pls explain me the 1st question ie Sequence with Digits of today's contest,I have seen the editorial ,but then also I am not getting the thought process behind the sol of other people. I would be so thankful if any body can help me

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

    Have you understood the problem? If yes then just implement it straight forward. Just keep in mind that once you get 0 as min digit then the no will never change. So you can break when you get 0 as min digit.

    The fact is proof of solution that it will not exceed tl and overflow 64bit integer.

    As min*max can be atmost 81 so you can't add more than 1000 as one of the digit will be 0 by this time.

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

Does anyone have a faster solution on E

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

@DishonoredRighteous It says TLE for O(n) solution in Pypy 3 after system testing, same code works in Python 3. Can you please check the time limits. Thanks

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

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

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

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

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

Hello, I don't know why my solutions are giving TLE on Test Case 22 for Problem D. Can someone please help?
Solution 1
Solution 2 — this was taken from Ashish Gupta's C++ solution. I just wanted to check whether it is being accepted in my case or not. But its the same story.

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

I think problem E is so easy and I solve first 5 problems in only one hour while I only can solve less than 4 pronlems in others div2 rounds...

I can't believe it is div2(and thank for +83 lol).

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

Wrote in wrong competition :)

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

Нужно просто делать cout команд.

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

why set is slower than map in STL?
For 643 div2-B, the same algorithm with set TLE (test #26) but map AC.
set code:

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+10;
int T, N;
int e[MAXN];
int cnt[MAXN];
set<int> s;
int main() {
    scanf("%d", &T);
    while(T--) {
        scanf("%d", &N);
        memset(cnt, 0, sizeof(cnt));
        s.clear();
        int e;
        for(int i=1; i<=N; i++) {
            scanf("%d", &e);
            cnt[e]++;
            s.insert(e);
        }
        int ans = 0; int rest = 0;
        for(auto e : s) {
            ans += (rest + cnt[e])/e;
            rest = (rest + cnt[e])%e;
        }        
        printf("%d\n", ans);
    }
    return 0;
}

map code:

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+10;
int T, N;
int e[MAXN];
map<int, int> mii;
int main() {
    scanf("%d", &T);
    while(T--) {
        scanf("%d", &N);
        mii.clear();
        int e;
        for(int i=1; i<=N; i++) {
            scanf("%d", &e);
            mii[e]++;
        }
        int ans = 0; int rest = 0;
        for(auto e : mii) {
            ans +=(rest + e.second)/e.first;
            rest = (rest + e.second)%e.first;
        }        
        printf("%d\n", ans);
    }
    return 0;
}
  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Your set code seems to have a excessively common problem: the line memset(cnt, 0, sizeof(cnt)); dominates the running time for tests where there are very many small test cases, as it clears the whole array every time.