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

Автор Supermagzzz, 5 лет назад, По-русски

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

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

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

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

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

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

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

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

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

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

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

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

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

Wishing you all A big positive delta!!

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

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

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

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

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

![ ](11)

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

َ

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -71 Проголосовать: не нравится
string s="sretovnwod uoy etah";
reverse(s.begin(), s.end());
cout<<s<<endl;
»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -56 Проголосовать: не нравится

.

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

Will any comment here get upvoted?

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

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

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

plot twist: this comment is gonna get downvoted

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

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

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

Why all comments are getting downVote?

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

We Want vovuh in upcoming div3 rounds :P

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

Is it rated?

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

Downvote

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

I was gonna post a meme but I changed my mind

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

BanjoByster who?

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

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

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

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

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

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

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

¿Quieres?

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

.

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

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

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

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

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

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

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

please don't downvote

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

good luck everyone! hope to get rating increase

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

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

nevermind i think i missed the joke.

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

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

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

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

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

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

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

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

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

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

How to solve G?

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

why does my implementation using sets fail

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

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

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

what the heck happened to the comment section?!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Garbage Contest and Discussion!

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

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

»
5 лет назад, скрыть # |
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://mirror.codeforces.com/contest/1506/submission/111050778

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

MikeMirzayanov wrote 2 yr. ago (https://mirror.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://mirror.codeforces.com/contest/1490).

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

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

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

For question B what will be the output for-

11 2

....*.....*

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

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