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

Автор Supermagzzz, 3 года назад, По-русски

Привет, Codeforces!

<almost-copy-pasted-part>

Привет! Во 25.03.2021 17:35 (Московское время) начнётся Codeforces Round #710 (Div. 3) — очередной Codeforces раунд для третьего дивизиона. В этом раунде будет 7 задач. Задачи подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше, могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-часовая фаза открытых взломов. Мы постарались сделать приличные тесты — так же как и вы будем расстроены, если у многих попадают решения после окончания контеста.

Вам будет предложено 7 задач и 2 часа на их решение.

Штраф за неверную попытку в этом раунде (и последующих Div. 3 раундах) будет равняться 10 минутам.

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в двух рейтинговых раундах (и решить в каждом из них хотя бы одну задачу),
  • не иметь в рейтинге точку 1900 или выше. Независимо от того, являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Задачи на этот раунд были придуманы MikeMirzayanov, Supermagzzz, Stepavly и sodafago

Спасибо darkkcyan, bugdone, harlequen, iankury, bfs.07, songsinger, infinitepro, sodafago, Gassa, Rox, sharepoLOVEDDD за помощь в тестировании раунда.

Спасибо MikeMirzayanov за платформы и координацию нашей работы. Удачи!

</almost-copy-pasted-part>

UDP: Разбор опубликован

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

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

Finally another Div 3! I was half expecting to go a month without one... Wishing everyone an enjoyable contest and positive delta!

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

Always so exciting to have these div 3's in my life!

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

Always so exciting to have these Div 3's in my life!

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

Isn't it risky to have a round without testers? Are there are some hidden testers for Div-3 rounds :P?

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

Can't wait for my first Div3 Round....

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

I'm waiting this contest since days ... it's best for me ^_^ We hope that are no any mistakes during the contest ... Thanks for your efforts !!

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

Wishing you all A big positive delta!!

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

wow, there's no comments with more likes than dislikes.

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

Are you saying no matter what I write I will still get downvotes

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

![ ](11)

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

َ

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

.

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

Will any comment here get upvoted?

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

After the div2 brutal round hopefully this contest will serve as a motivation to continue CP! haha

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

plot twist: this comment is gonna get downvoted

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

Guys let me compete with Monogon for 1 rank in contribution, I need your help to achieve that goal!!!

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

    Upvoted. I think you have a lot of work to do. You made a few mistakes with this comment, such as not posting it immediately after the announcement comes out. Also, in this comment you state that you have a particular goal and people should upvote you to help you reach that goal. Unfortunately, this will isolate people who are willing to upvote you for different reasons. So, you should not state any reasons or argument for why the reader should upvote you. Instead, just directly command them.

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

Why all comments are getting downVote?

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

We Want vovuh in upcoming div3 rounds :P

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

Is it rated?

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

Downvote

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

I was gonna post a meme but I changed my mind

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

BanjoByster who?

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

One who dislike this post doesn’t love his/her mother!!

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

    One who dislike this post doesn’t love his/her mother!!

    Why go on mother, you could have gone on anything like keyboard, mouse, CP, electricity, Edison, etc. but don't comment such to just gain some upvotes, PLEASE!!!

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

The comment is hidden because of too negative feedback, click here to view it

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

plz downvote me, i'd like to have anticonributiuon on this acc

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

¿Quieres?

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

.

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

This is my first comment.Hoping to become pupil. P.S. Don't Downvote

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

I am not scared of anyone of you......... >.<

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

The round starts in 20 mins, make sure you registered. I wish everyone participating good luck and a fun round !

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

please don't downvote

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

good luck everyone! hope to get rating increase

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

why so many downvotes???????

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

my solution to problem E: https://youtu.be/efrkmxiEDNc
code: https://codeforces.com/contest/1506/submission/110998366

nevermind i think i missed the joke.

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

    Comeon Man, this isn't fair... Your video was posted way before the contest was gonna end... Atleast could have waited for the contest to end! Your videos must be source of logic and thinking for upcoming coders, not a way to help them seek an easier way to just copy and paste

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

      no it wasn't. it was supposed to premiere at 10:15PM IST. I made it live at 10:05PM IST exactly when the contest got over. do you seriously think I would do something like this for a few hundred views?

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

        I don't have a personal grudge here man... Just that someone has commented there exactly 15 minutes ago... Meaning at 10:01(+5:30). This would mean that your video got uploaded before 10:01 itself

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

          if I premiere a video on youtube, the thumbnail will be visible way before it goes live. people are allowed to comment, like/dislike but not watch before the premiere begins.

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

Almost all solutions are aviable online : C: https://www.geeksforgeeks.org/longest-common-substring-dp-29/ G: https://www.geeksforgeeks.org/lexicographically-smallest-string-formed-by-removing-duplicates/ @MikeMirzayanov It should be made unrated cause it is not fair to those who are giving.

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

How to solve problem D?? but nice contest though loved it:)

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

    If some number occurs x > floor(n/2) times, then, it is 2x — n. Else, its 0 or 1 depending on the length of the array

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

I was just going to submit D and contest finished :-( :sadpuppynoises:

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

    I wanna know abt D... It took so much brain power and idk why but i feel it's gonna be damn easy

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

      Just use priority queue keeping frequency of nos...Run a loop untill its size is strictly greater than 1

      In loop reduce frequency of first two nos and insert each one iff its frequency is still greater than 0.

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

      firstly, sorry for my english

      let max be the maximum number of times the number occurs. if max>n-max, then the answer is max — (n-max) tk we can delete this number with all the others, but we can't delete it with ourselves. otherwise, the answer is n%2, because we can delete the remaining numbers up to the number of our number, and then delete them with our number. well, if n%2 == 0, then we can delete everything, otherwise everything is clear

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

How to solve G?

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

why does my implementation using sets fail

https://codeforces.com/contest/1506/submission/111057558

Afaik the time complexity must be O(N*log_2(N))

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

what the heck happened to the comment section?!

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

Thanks for the round! Here's my screencast (HD versions forthcoming): https://www.youtube.com/watch?v=s7owI7Uo2rk

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

Is there any difference between :
auto itr = st.lower_bound(val); and
auto itr = lower_bound(st.begin(),st.end(),val);
One solution gave TLE and the other passed and the only difference is listed above, ACCEPTED and TLE

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

    yes for set its the right way -> st.lower_bound(val);
    and it totally wrong ->auto itr = lower_bound(st.begin(),st.end(),val);

    i once faced that.

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

      Okay I understood that it is wrong, that is why it must have given TLE, but what is the exact difference between them or their time complexities

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

        In lower_bound(set.begin(), set.end(), val), std::set doesn't have random-access iterators (think of them similar to array indexing), so the time complexity is linear. With set.lower_bound(val), std::set has that lower_bound built in, so it's much faster, logarithmic time complexity.

        Edit: Just realized that b23v said pretty much the same thing :/

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

I see too many downvotes in this blog post. I'll investigate it in few days. Sorry, no time to do it right now. But I'll try to revert unfair votes and prevent such behaviour in the future.

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

    Hey, MikeMirzayanov Just wanted to bring before you plagrism of two users

    cyborg_7459 and cyborg7458

    Both of these Users don't know whether same persons or different has submitted solution of Problem A and B with minor Changes. Please Do look at their submission. Even their template is same. Since Even submitting Solutions from alternate account is clear voilation of policy please Review their submission. Maybe they would be same person just submitting solution from one account to confirm its correctness and escape penalty, which is voilation of Rule and needed to be punished if really found guilty.

    Their Submissions:

    Problem A: 110996666 and 111008607

    Problem B: 111007814 and 111006918

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

      MikeMirzayanov plag_report Yeah my bad, but I have an explanation for that which I think might be justified. Since the past 3 contests I've been facing issues with the CodeForces server being down, as might be evident from the bad results of my past 2 contests as well as the fact that I could not give the Division 2 immediately preceding today's contest. Thus, to prevent a negative effect on my rating I started today's contest with my alternate account but switched back to my original one after facing no issues for about half an hour.

      I had no idea that submitting from 2 accounts is also a violation of Rule, and I thought that since I could easily prove the 2 accounts to be mine, I would be able to show that the code is completely original in case someone said otherwise.

      I can assure you that it wasn't a case of trying to avoid a penalty because I did get penalties in my D and E as well. If I had been trying to avoid penalties by testing solutions with my alt account, then I obviously wouldn't have stopped that for the harder problems

      Moreover, I submitted the solution for A from my main account 15 minutes later, which covers up the 1 penalty advantage that I would've received in problem B

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

        Still, you should have read the rules. They are right before registering into the contest. And also, don't you think it is unfair to whenever you have a good performance in your alt to you switch back to your main? This way it would be very easy to farm rating, just create an alt where you compete normally, and if you have a good performance switch back to your main account. This attitude shouldn't be tolerated since it is unfair to other participants. There is no justification to this, it is obviously unfair and violates the rules.

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

    I wish that could be prevented but I wonder how especially that deciding if a comment should be downvoted or not is an opinion

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

is CF oke ?? may be some bug for downvoting . mesanu sir do something

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

Almost all solutions are aviable online : 1. C: https://www.geeksforgeeks.org/longest-common-substring-dp-29/ 2. G: https://www.geeksforgeeks.org/lexicographically-smallest-string-formed-by-removing-duplicates/ - - @MikeMirzayanov It should be made unrated cause it is not fair to those who are giving.

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

    It wasn't phrased as "find longest common substring" so the task was really figuring out that lcs was optimal. And constraints are low enough to brute force.

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

Garbage Contest and Discussion!

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

Is there any specific reason why B is always tougher than C on CF contests ?

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

can someone help me understand why my code is giving tle hacking, i am not able to find the test case in which it can give tle.

https://codeforces.com/contest/1506/submission/111050778

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

When you miss B because you type k instead of j.

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

Could anyone tell me how my code to E 111026430 being hacked... :(

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
    		F(int, i, 1, cnt) {
    			x = a[maxi[i]];
    			F(int, j, maxi[i] + 1, maxi[i + 1] - 1) {
    				while(vis[x]) x--;
    				ans2[j] = x, vis[x] = 1;
    			}
    		}
    

    see you are deccrementing x and then finding the max avaiable number there is to fill. maybe this is causing tl in some very specific testcase.

    for example lets read

    N=8

    5 5 6 6 7 7 8 8

    answer is 5 4 6 3 7 2 8 1

    now see to get to 4 at index 1 you decremented x 1 time

    for index 3 you decremented 3 times

    for index 5 you decremented 5 times

    for index 7 you decremented 7 times

    total complexty is 1 + 3 + 5 + 7 + 9 + 11 + ... n (sum of all odds upto n). this looks like n^2. and exactly where tl is coming from.

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

I am black. If u downvote me — u are racist.

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

My computer was just used by others.I'm sorry to say rev.1's words

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

    Yes,I used his computer because of this easy round.

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

      He who fights with monsters should look to it that he himself does not become a monster. And if you gaze long into an abyss, the abyss also gazes into you.

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

Why I get TLE in question D upon using unordered_map instead of map ! Isn't unordered_map is implemented using a BST which makes me think it should be faster than map ?

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

    Same I too got TLE on 8th case in problem D this is because the value of a[i] can be 1e9 if in any case there are more values greater than 1e8 then it will form chain structures to hold key-value pair so instead of O(1) per query the amortised complexity may be O(n) resulting in O(n^2) overall. So better to use map which has constant factor of O(log(n)) it won't hurt you!

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

hi, it was my first contest and I solved 3 questions. will I get a rating, if yes when will the rating changes be announced?

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

hello guys can someone help me out with problem D (Epic transformation). IDK why i am getting tle

my solution is given below code

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

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

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

hello guys!!

i am getting a tle for my solution of problem D(Epic Transformation)

Can anyone pls look at my code and help me correct it??

My Code

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

MikeMirzayanov wrote 2 yr. ago (https://codeforces.com/blog/entry/65383):

Yesterday slappy advised me to stop writing problems. I will not listen to his advice and will not stop coming up with new problems.

This was another good Div.3 round! (After https://codeforces.com/contest/1490).

So thanks for authors for their problems, and keep composing!

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

in problem d i used unordered map and time limit got exceeded but replacing unordered map by map ans is accepted how is it even possible .111012090 time limit exceeded 111111133 accepted

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

For question B what will be the output for-

11 2

....*.....*

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

My solution was skipped even though I neither copied nor showed anyone my solution.How can I prove that I did not copy?This is really disgusting.This contest was unrated for me but what if it was rated.Please do review this. My D problem matched with someone I neither know and neither follow

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

My solution was skipped for this contest even though I neither copied nor showed anyone my solution.How can I prove that I did not copy?This is really disgusting.This contest was unrated for me but what if it was rated.Please do review this. My D problem matched with someone I neither know and neither follow