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

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

Hello, Codeforces!

I'm glad to invite you to Round 643 which will start at May/16/2020 14:35 (Moscow time). 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: The fifth Lipetsk collegiate programming contest. Finals. 8-11 form

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

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

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

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

Thank You MikeMirzayanov, for excellent Codeforces and Polygon platform.

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

is it rated?

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

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

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

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

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

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

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

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

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

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

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

.

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

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

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

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

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

![ ](41h4pd)

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

Can I get 100 downvote?

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

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

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

Long time no interactive problem! Look forward to it.

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

hoping for strong pretests this time

»
6 лет назад, скрыть # |
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.

  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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

  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

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

would be my first round as an expert

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

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

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

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

»
6 лет назад, скрыть # |
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??)
»
6 лет назад, скрыть # |
 
Проголосовать: нравится -95 Проголосовать: не нравится

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

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

It must be a good contest.

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

That's great. Consecutive contests for 2 days.

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

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

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

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

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

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

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

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

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

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

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

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

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

This is a friendly time for China.

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

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

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

When you start to submit problem F...

Submit...

WA on pretest 5.

"WTF!!!"

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

Is the difficulty level of A and B same ?

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

bad time

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

»
6 лет назад, скрыть # |
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 :(

  • »
    »
    6 лет назад, скрыть # ^ |
    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 :)

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

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

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

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

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

Why do I see all the normal comments downvoted?

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

The time is friendly to Chinese students!

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

The second earliest announced score distribution in Codeforces history !

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

I love Div.2.

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

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

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

sorry-forces everywhere . . .

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

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

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

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

C and D should swap their positions.

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

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

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

F is so weird

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

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

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

Video Tutorial for C

Enjoy watching!

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

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

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

How to solve E?

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

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

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

I solved D, but can't prove solution.

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

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

C: "Non-degenerate triangles".

CF users:

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

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

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

Specialist rank here I come...

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

lol I used FFT in C.

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

Newbie rank here i come...

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

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

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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 ?

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

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

»
6 лет назад, скрыть # |
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.

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

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

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


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

  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 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 :)

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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://mirror.codeforces.com/contest/1355/submission/80368483

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

RIP codejam

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

ahhh shit, starting from C was bad strategy mehn

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

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

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

Constructive Forces!

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

Why problem E satisfy binary search?

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

    ternary search

  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 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

»
6 лет назад, скрыть # |
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
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +37 Проголосовать: не нравится

I solved C.

I guessed A,B and D.

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

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

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

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

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

In problem D, can the selected array contain 0?

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

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

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

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

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

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

codeforces setters be like

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

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

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

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

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

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

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

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

BADC

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

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

C and D should swap their position

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

When does rating gets updated?

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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!

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

  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

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

Does anyone have a faster solution on E

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

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

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

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

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +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).

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

Wrote in wrong competition :)

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

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

»
6 лет назад, скрыть # |
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;
}