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

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

Henlo Codeforces! ^_^

I invite you to participate in Codeforces Round #663 (Div.2) taking place on Aug/09/2020 17:35 (Moscow time). The round is rated for users rated less than 2100, while other users can participate non-competitively.

The round features five problems, and you have 2 hours to solve them. There may, or may not, be an interactive problem; regardless, you should know how to deal with them.

I would, now, like to thank–

Please do not mind the long list of testers (I had to write code to tag everyone here) since the problem set changed significantly after the first round of testing.

We will announce the scoring distribution shortly. The scoring distribution is 500–750–1250–2000–2750.

Good luck, and stay safe!

UPD: Editorial

Here are video editorials by BRCode:

UPD2: Finally, congratulations to the winners!

Div. 1:

  1. tmwilliamlin168
  2. risujiroh
  3. fanache99
  4. LayCurse
  5. Sugar_fan

Div. 2:

  1. 00000010100001100111
  2. PouyaNavid
  3. 420iq
  4. I_want_2400
  5. silxi
  • Проголосовать: нравится
  • +1305
  • Проголосовать: не нравится

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

As a tester I think people will like this round because of interesting problems,diverse topics and short statements

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

As a tester... Damn there's so many of us!

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

OMG!!! another "as a tester" comments "/

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

Which ponies are we helping this time?

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

Omg Indian round! So excited

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

*insert cringe proud indian comment here *

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

I hope, we don't have to help Ponies, in this contest, unlike Previous Contest! :|

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

Hope the problem statements are made while you are not sleepy.

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

Memes/images should be posted in spoiler!

Indians on CF
As a tester...
How to feign consumer satisfaction to investors
Anton rounds

Disclaimer: The memes aren't specifically for this round, that's for you to decide :) I liked it a lot as a tester.

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

So we'll have video editorials too this time?

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

orz

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

As a participant, all we want is short and clear statement. Hope we won't get disappointed :)

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

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

Props for the 3b1b style video editorials! Sounds really cool, will definitely watch.

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

As a pony , I hope I'll not find any problem about ponies :(

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

Don't downvote sir

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

SleepyShashwat, AwakeAnay, AsleepAdhyyan, and RestingRajarshi.
Coincidence!? I think not. ;)

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

BRCode for making 3b1b-style video editorials of the problems!

YouTubers who make video editorials after the contest
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

I'm wondering why almost half of the recent contests, including this one, contain $$$5$$$ problems, but not $$$6$$$.

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

Is this the quartet of last year's IOI from India?

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

"Henlo" ?

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

Hopefully the ponies are grazing grass instead of playing chess coloring games with each other.

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

Happy to see an Indian round Again. :D

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

Not as a tester I hope you good luck!

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

Wait did I read it right that there are vedio editorials ? Cool.

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

How many testers do you need?
-YES!
How many pony stories do you need?
-NO!

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

I hope this round will not test our English comprehension skills.

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

Why is every div2 round having 5 problems now? Is making 6 problems too hard or are you sleepy while writing problems as well?

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

(I had to write code to tag everyone here) : How does one write code to tag people? O.o

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

Hope the statements are not sleepy.

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

As a tester i want to say that the contest is shit!!!! Thankfully i am not participating in this officially!! sighs: All the specialists brace yourself!!

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

Typo in spelling of Hello Codeforces Please change Henlo --> Hello

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

Although your Indian English is kinda weird, but the 3B1B-style video is so fantastic!

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

Why am I getting a feeling that this is going to be a MathForces round? I hope it is not though! :P

Also antontrygubO_o as a coordinator (Yay! :D)

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

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

Henlo Codeforces! ^_^ I think here must be "Hello" ^_^

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

Another contest!! As a regular contestant, I need a break :'(

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

As a contestant, I want rounds with aryanc403 as the author

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

I really starts enjoying memes here...

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

Thanks , Codeforces!!!

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

author, how could you misspell the word ,,Hello''? i want to cry((

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

Did any tester test anything with Python? Did someone spend the 10 minutes checking if the standrad solution in Python doesn't get TLE or too much memory?

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

Hope the statements are clear. I don't want to walk around the maze :)))

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

soo, if i utterly fail to do the questions then what will happen? (my rank is 0 , will to in minus or increase if yes then how?!

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

Thanks , Codeforces!!!

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

As a tester I think people will like this round because of interesting problems,diverse topics and short statements. Thanks, Codeforces!!!

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

shashwatchan please don't sleep during the going contest

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

Happy to see Indian School Students doing great on Codeforces and other CP Platforms! I wish, I also knew about CP while I was in School. Indian Students need to learn that "Apart from IIT JEE, there is also a world called CP". All the best shashwatchan for your future endeavours!

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

    Awwwwwwwww, Were you not able to clear JEE, you poor soul

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

      Poor Soul thinking that only a JEE Failure would write that statement. I think you are in the First Year of an IIT or you are not an IITian. Only some First Yearites(Fachas) at IITs have this attitude that they have cleared JEE and won the world OR this attitude is shown by Butt Hurts who couldn't clear JEE Advanced!

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

        What if i say i am in third year in an IIT ? What shitty explanation will you give then ?

        In my college "fachas" or first years, whom you are saying shit for no reason, are better than you in CP.

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

          I have seen people mention IITJEE many times before . So , does this university conduct some kind of computer science competition like I.O.I. , because I have seen it quite a few times like on this blog , Indian contest blog , cheater blogs and some ICPC blogs .

          Its a rare thing for universities getting mentioned so it kind of made me curious

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

        The only reason i am offending you is you tried to offend those students who busted their ass in getting a f***** IIT after like 2 years of rigorous studying ( maybe 4 years for some ) and you are into CP for like one year and still nowhere with CP ( to be honest ).

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

          I am also in the third year. And to be honest, you can check my submissions, I only gave contests till December last year. Many first years are better than me in my college also. They are Masters and it happens in all IITs I guess. I know I am nowhere in CP and it doesn't even matter to me. And what I have tried to say is there is a world apart from JEE also- for those who couldn't clear that! We also do CP only to get Jobs in MNCs and they also! I also spent 2 years in rigorous studies and I know that situation. And for your kind info, you are wrong even at judging my "Special and Reserved Community" LOL!!! It is just that some need more time doing CP some don't need that. Some do CP continuously and daily while some don't practice that much and I belong to the second one. I don't practice that much because everyone has different priorities. CP is a backup for some to enter the software/IT sector. They may want to do something else like Management, Civil Services, etc. And there are many such IDs on Codeforces- belonging to IITians, a general category and Pupil/Specialist. So, keeping all factors in mind stop judging people! And for your kind information, study for Internships rather than trying to offend me! And I didn't call first years SHIT. It was you who misinterpreted it! I just said they have that kind of feeling in mind in first years. But second-year onwards they know the situation :P.

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

      or he might have cleared JEE

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

      I cleared JEE but wish I'd rather got to know about CP back in school. I have been good at programming since I was in high school but thanks to the JEE culture in India I never got to know about cp.

      Whats worse, I got to know about cp only in my third year and I have only 1 year in my college life left now. Honestly if i could go back in time, I would tell my earlier self to do CP rather than jee.

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

    What is IIT JEE ? Is it something on the lines of web development or something like that

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

      it is the exam conducted to select students for studying in the most prestigious colleges of india (IIT). and no, u need to learn physics, chemistry and maths to crack the exam and secure the highest ranks possible to take up computer science(which is one of the many streams taught in an IIT).

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

Thank you.

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

Score Distribution?

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

where is editorial for this round?

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

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

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

very excited for round.

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

Very excited for the indian round :)

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

woweeeeeeeeee! 3Blue1Brown style editorials.

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

Half of the coders are giving Goldman Sachs aptitude test now lol

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

I can't understand what 'even length square sub-matrix' means in problem D.

Does it mean a sub-matrix with even width and even height?

Thanks

@SleepyShashwat

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

Problem B was too easy , should have been a little harder...

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

After solving A and B what should be the best thing to do?

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

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

Me after solving A and B :-) after-AB

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

Permutation lover SleepyShashwat

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

From today, I started loving permutations because no one knows how you can play with permutations except the master shashwatchan. Truly a good and well implementation based round. Only DS can help :)

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

The problem statements were really nice :) But the difficulty could have been a bit higher for C.

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

Determine if the contest is good?

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

My JEE notes help me in solving question C

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

Now this is what I call a Contest. loved it. Kudos to the author.

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

Nice problem set! A good round after a long time :)

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

Waiting for the end of the contest to start discussing the task E

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

Nice contest, too bad I wasn't concentrated enough :(

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

2 minutes of silence for these people.

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

Pretest 6 For Problem C ????

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

Such a nice D!

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

What's the pretest 3 for problem D

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

I liked the problemset.

How to solve D? (I had understood that for n>=4 and m>=4 the answer is -1, but I don't understand what to do next).

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

how to solve C please help??///

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

    n!-2^(n-1) is the answer.

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

      why?

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

        number of permutations is n!. And you have to count how many permutation of the form (2,1,3) do you have because that gives you a cycle between 1,2,3. (and 3,1,2 too). The permutations which are not from this type is 1,2,..n (increases) and after n decreases. And that number is 2^(n-1).

        (with 2,1,3 i mean some v[i-1] > v[i] < v[i+1] not just 2,1,3)

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

          Didn't the question asked to find the total permutations of length given n? For n=4, is [4, 2, 3, 1] having length cycle of length 4?

          As per the definition given, vi and vi+1 share an edge for all i (1≤i<k), and v1 and vk share an edge. v1 to vk edge is only possible either of 2 cases 1. n-1 at position and n is at last position 2. n is at first position and n-1 is at last position then only we can form a cycle of length n right? Correct me if I am wrong somewhere.

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

        Total permutations = n! Permutations without cycles = 2^(n-1) I'll explain how I got 2^(n-1): For any permutation, if there is no cycle in it then it should follow this logic: 1)For any i,(1<=i<n) numbers i+1,i+2,i+3,... n should lie on the same side, if not then the permutation contains cycle. Then start calculating the ways by following this logic. Eg: for n = 4 You can put 1 in either of the ends.(because all other numbers should be on same side of 1) Then 2 possibilities: 1--- ---1 (you have to fill blankns with 2,3,4) Now, 3&4 should be on same side of 2, so, our possibilities are now 12-- 1--2 2--1 --21 .Recursively this gives 2^n-1 ways.

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

    Use simple permutations and combinations and the principle of inclusion and exclusion :)

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

A very nice contest!! Problem statements were short and to the point.

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

People with WA/RTE/TLE on A. Care to explain your soln?
Congrats Beta_R for getting hacked on A twice.

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

how to solve D? I found it really hard to find answer for min(n, m) = 3 because there were too many states

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

Has the core idea behind C appeared in a contest in the last year or so? I remember solving a problem which had the same idea (sequence must increase then decrease, find number of ways) not too long ago.

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

problem D:

if the matrix is 4 by 4 or greater size answer is -1. and for smaller matrixes, we need to get the answer?

where I went wrong please help me?

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

can we solve D without brute-forcing every case separately?

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

Problem D: Am I right in thinking that if the no. of 1s in every 2X2 matrix is odd then no. of 1s in every 4X4 matrix will be even hence answer is -1 for all the matrices with n and m >=4? OR am I missing something. If I'm right, then how to go further?

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

Shame on me for not reading the problem properly. I didn't read that only 'R' and 'D' were valid directions for problem B, so I implemented something way more complicated to deal with all 4 directions cardinal directions XD.

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

    Maybe this will help you fell better but you are not the only one :D

    I started implementing the solution with all directions, after about 10 minutes I saw that there was more than 2K Accepted solutions so I knew something was wrong, read the full statement again and solved it in 2 minutes :(

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

the intresting fact about this contest was that nobody knew the proof for problem C but everyone solved it :))))

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

    I saw that you can have a cycle iff you have a "dip" in the sequence. 95% sure that that's correct, so then I tried to count every permutation without a dip and saw that for every n, it was double the previous one. You're right, no actual proof though!

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

      The permutations that don't work are ascending and then descending. The number of them is the sum of (n-1) choose k from k=0 to n-1, and it's well known that it's equal to 2^(n-1). So the answer is n!-2^(n-1).

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

        One way you can see why it's the sum of n-1 choose k from k=0 to n-1 is that you have a 1-1 correspondence between subsets of {1,...,n-1} and a not good permutation because you place all the numbers in your chosen subset to the left of n and then the remaining to the right of n (there is only one way to arrange these two subsets). Or you can just think of it as there being two choices for each number, being on the left of n or the right of n.

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

    Non-valid permutations are the one which first increases then decreases, rest all are valid, and number of such permutaions are $$$2 ^ $$$ $$$(n - 1)$$$. So ans is $$$n!$$$ $$$-$$$ $$$2 ^ $$$ $$$(n - 1)$$$

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

Problem C was really awesome and the statements were also quite perfect...

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

Isn't the answer to C is fact(n) - 2^(n-1) ???

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

Nice problemset. I think D can be done by bitmask dp, correct me if I am wrong.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится
How to determine if a round is good
»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

Really nice contest! D was the first dp problem I've done in contest in a while.

Solution for D: If n>=4, the answer is -1. To see this, note that each 4x4 matrix is broken up into 4 2x2 submatrices that are disjoint. If the sum in each of these is odd, then the sum in the 4x4 matrix should be even, which is a contradiction.

Now, we do cases on n=1 to n=3.

For n=1, there are no even sub squares, so the answer is 0.

For n=2, each column alternates between a sum of 1 or 0 mod 2, so theres only two cases to check here (whether the first row has sum 0 mod 2 or 1 mod 2), and that can be done in O(m).

For n=3, you can use dp. Let dp[i][j] be minimum number of moves needed to get the first i columns to satisfy the problem constraints, with the ith row equal to j in binary (so, for example, if j=5, then the ith row would be 101). Then, dp[i][j] = min(dp[i][j],dp[i-1][k]+add), where k ranges from 0 to 8 and is the state of the previous row, and add is the number of moves to change the grid ith row to j in binary (so it would be 2 if the ith row was 000 and j=5 = 101 in binary). Answer is min(dp[m-1][j]) from j=0 to 7, and time complexity is O(m*4^n), but n=3, so it passes. There might be a more efficient solution.

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

Thanks for such a nice contest!

  • Short and concise, formal statements
  • Good problems
  • Good video Editorials
  • Balanced Contest

We want more such contests :)

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

E is a nice problem

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

Idk if I'm dumb, was anybody else confused with the "Cycle of length n", for n = 4 there weren't 16 cycle of length 4. Although there were 16 perms. which have cycle.

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

My solution for problem C failed on pretest 6 using C++. Later, I changed it to python and it worked. Can someone explain why?

(Did n!-2^(n-1))

C++: https://mirror.codeforces.com/contest/1391/submission/89438077 changed to: https://mirror.codeforces.com/contest/1391/submission/89443077

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

Nice contest, math lovers for the win. I go back to Div4.

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

How to calculate modulo inverse efficiently ?

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

My solution to C — tn = (n-2)(n-1)!+2*tn-1

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

Problem C makes you fall in love with CP all over again. Concise and to the point statements. Great round :)

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

C is in oeis but i cant just implement it.

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

Excellent contest; I really enjoyed solving the problems! Here's my screencast and solutions to everything if you're waiting for the editorial.

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

Very Nice, It looks like an educational rounds format (i.e: the statements are formal)

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

For a moment while reading C , I thought the edges are directed and wasted like 10 min on so, But still I think that this version would be interesting one I would really appreciate ideas on this version of question if solvable

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

Another high quality contest. Codeforces back in form.

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

Damn. In problem D I figured out very quickly that n<=3, but then I thought it's greedy after that, and now I see people solved that part with DP! And now it seems so obvious I want to bloody kill myself :<

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

My opinion might be unpopular but I think the formula wasn't too hard to guess.. I came up after an hour into the contest but still I spent 15 mins trying to prove it.. and I couldn't prove it.

It would be better if the formula for the problem is harder to guess from samples else it beats the purpose of the problem...

I mean for problem C.

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

For problem A, How can any permutation work?

Like for n=5, 1,2,3,4,5 can be called as any permutation but does not work for index 1 to 2.

2^3 = 1 whereas length of the array is 2.

I just could not grasp problem A.

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

Can any bide tell whats wrong with my d solution?

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

Problem C was really fun, and in general the whole round was great! I loved reading and thinking about all the problems!

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

    Can you please tell how did you approach C?`` Like did you see a pattern or used oeis?? I want to know how good coders approach such problems

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

      Well, first I thought about what happens with the ID permutation (i.e 1 2 3 4 5..), and I saw that there are no cycles. Immediately I concluded that that the reversed also has no cycles (5 4 3 2 1). Then I tried to make one inversion, such as 1 2 4 3 5, and saw there is a cycle and then I thought that maybe any inversion might mean a there is a cycle, but then I tried to put the max in the middle, and my first example was 1 2 5 4 3. I saw it has no cycle, and that's because 5 has no one larger than him anywhere. Then I thought I had it, I checked 1 2 5 3 4 to see it has a cycle, and of course it did. (because of 5 3 4).
      My conclusion was that any "mountain" structure has no cycles, mountain means that for i < j a point p_i < p_(i+1) and for i >= j, p_i > p(i+1).
      I proved it to myself briefly by saying that if it isn't a mountain, then there is a "Valley", and a valley is just a triplet (a,b,c) where a > b < c (for example 5 3 4), and that creates a cycle!

      So then it became counting the number of "mountain" permutations. The peak of the mountain must be n (the max value in the permutation), and if you choose a subset of elements to be on its left (and the rest on its right), there is only one way to place them — non-decreasing on the left of him, and non-increasing on the right of him.
      So you just need to choose the subset of elements to the left of 'n' out of the n-1 remaining numbers. The number of different subsets of n-1 numbers is 2**(n-1).

      And the solution is (n! — 2**(n-1)). Of course you calculate both those value modulo P through out, and perform the modulo operation after the subtraction.

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

Excited for the 3b1b style video editorials

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

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

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

the problems are very good!

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

Solved div2C for first time but doesn't feel like an achievement because formula was too intuitive I think.But still enjoyed the contest

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

I really gotta say, this round was FABULOUS.

  1. Super interesting and formal statements.
  2. No speedforces: great problem D.
  3. Adrenalin of solving problem D in the last moment :P

Hands down, one of the best rounds I have seen upto now (the only round that comes close is AshishGup's #651)

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

Problem C is not that much intuitive. Permutation should increase then decrease to not make any cycle. ex) n=8 1 3 6 7 8(top) 5 4 2

Except top element, we can choose any subset of [1~7] for increasing part, then decreasing part is automatically decided. If we choose [1, 4, 5] then one permutation is made : [1, 4, 5], [8], [7, 6, 3, 2] so 2^(n-1).

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

    Just watched the video, and did read the tutorial severeal times. It is unclear why increase, then decrease.

    I assumed that any triple with the smallest number in the middle is enough to form a cycle.

    So, why is this?

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

      Assume there is last two values x and y which were previously decided and now I put some z next to y.

      [case1: x < y] i) z < x < y ii) x < z < y iii) x < y < z

      [case2: x > y] i) z > x > y ii) x > z > y iii) x > y > z

      Except for case2-(i, ii) no cycle is made. So once previous values started to decrease, then we cannot make it increase again.

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

      If you create a permutation that increases first till you reach the largest element and then add all the remaining elements that form a decreasing sequence, it will mean that there is no cycle as there is no triple with smallest element in the middle. You can calculate the number of such permutations (which increase first, and then decrease) and then subtract the total from factorial(n) to give you the correct answer.

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

Please join me in congratulating shashwatchan and the numerous team on a great problemset and contest!

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

Why did the round not allow registrations after the contest began. In general why is it ever beneficial to have this restriction? The contest blog didn't even mention if it was so.

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

In D, Can anyone please find mistake in my code I tried it by generating all possible matrices of 0s and 1s but it giving wrong answer for all m,n<=4

https://mirror.codeforces.com/contest/1391/submission/89455694

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

Very good contest, thanks to the authors. The length of the question is also quite appropriate, neither long nor short. After three consecutive unsatisfactory performances, I finally played a bit normally today. After quickly solving a and b, I found that c is not the type I am good at, and I have no idea for the time being. I made a bold decision.skipping c and slove d first. It is not difficult to think about the algorithm ofd, but there are many details in the implementation.(I did not notice the constraint of n<=m, so I copied a part of the code),After two wrong attempts, I finally passed d at 01:50. Looking back at c, I didn’t feel very difficult.But Before I found a conclusion, the game was over. I don't regret slove D first, because if I slove C first, it is likely to pass before the end of the game, or simply get stuck on C. Hope to play better next time.

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

Great problems :)

shashwatchan

And thanks for quick editorials! Will be looking forward for more Indian CF contests ;-)

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

/*Deleted*/

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

One of the most elegant contests ever. Loved it.

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

I really enjoy these interesting problems!Great contest!:D

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

Kudos to shashwatchan for an excellent round with some really nice problems!

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

Very cool contest :)

Here's my video solutions for all problems + very funny moment at the end.

https://youtu.be/c3mjIQR902k

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

My screencast, where you can watch me die on E (includes solutions for A-D)

(quality will be better when youtube processes it)

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

Nice Contest! .I did a dumb act in c by calc. n-1c0.... so on by fermat thrm .and i cracked iit jee maths how?

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

No offence, but it is so strange to me that most people in the comments prefer this to the ponies.

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

Thanks BRCode for such high quality editorial. I pretty much appreciate to your hard work. By the way, are those videos generated by manim?

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

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

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

Thanks for this cool round! I really enjoyed the problemset and +193 rating as well :)

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

My solution to problem C: Use the following recursive formula: a_n = 2*a_(n-1) + (n-2)*(n-1)!. 2*a_(n-1) means that '1' is placed in index 0 or index n-1. (n-2)*(n-1)! means that '1' is placed in the other middle indexes.

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

    I thought of the same: a_n = a_{n-1} * n + ((n-1)!-a_{n-1})*(n-2). But I don't have a explanation for the (n-2) factor. My thought process was if a sequence of len "n-1" has cycles I can insert n at any point and it will still have a cycle, (a_{n-1} * n), if not ((n-1)!-a_{n-1}, don't have cycles) there is (n-2) ways of inserting n and creating a cycle in a sequence that doesn't already have one? That seems to hold but I don't know why. How did you arrive at that relation?

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

      Nvm, there is (n-2) ways of turning a sequence that has no cycles in a sequence that has cycles because every sequence that has no cycles is bitonic and we have 2 ways of inserting (n+1) and still be bitonic, just before the element with value "n" or just after.

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

Why was there no need to check for cycles in problem B to get AC, for e.g.

RL... ...... ..... ..... ......C wont reach C if we start at the cell 'R'. Then why didnt we need to check for cycles? EDIT: I just realised there were no L or U in the grid. Now i just feel dumb ;-;

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

Thanks...the problem E helps me review some basic properties of graph traversal...

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

One of my favorite contests!

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

Извиняюсь, меня забанило за совпадение с другим аккаунтом, дело в том, что я из Беларуси и у нас во время выборов очень плохой интернет,я побоялся писать со своего аккаунта, и написал с другого,моего преподавателя, он для этого и служит,и меня забанило за списывание, хоть и тот и тот код это мой, а с основного я сдал больше, прошу понять т.к у нас с инетом очень сложно, а отключаться посередине соревнования не охота была, большой минус был бы. Прошу понять, это все изз за ситуации в стране, если бы этого не было, все было бы как всегда. Если это можно посчитать честным, можете тот аккаунт обнулить участие, а этот вернуть рейтинг.

P.S. доказать, что тот аккаунт мой не проблема

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

Sorry, I was disqualified for a match with another account, the fact that I'm from Belarus and we during the election, very poor Internet,I was afraid to write from his account, and wrote another,my teacher, and he serves,and I sabanilla for cheating, though he and the code is my main and I passed more, please understand because we have with the Internet is very difficult, and disconnect in the middle of the competition not hunting was a big minus would be. Please understand, this is all because of the situation in the country, if this did not happen, everything would be as usual. If this can be considered fair, you can reset that account to zero participation, and return the rating to this one.

P.S. prove that my account is not a problem

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

explicit,novel and diverse round it is. It is worthy that the round will get more upvotes after finished.