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

Автор DeadlyCritic, история, 4 года назад, По-английски
$$$~-\text{In the name of God}~-$$$

Hi community,

I'm glad to invite you to my first contest, Codeforces Round 652 (Div. 2) which will be held at Jun/23/2020 17:05 (Moscow time) ($$$\text{notice the unusual time}$$$). The problems are mainly prepared and invented by me. The round is rated for participants with rating strictly less than $$$2100$$$, others are able to take part in the round out of competition. You will be given $$$2$$$ $$$\text{hours}$$$ to solve $$$6$$$ $$$\text{problems}$$$.

Firstly I'd like to thank adedalic for coordinating and reviewing the round, as well as helping with many different things.

I'd like to thank antontrygubO_o, physics0523, McDic, Ashishgup, dannyboy20031204, Kuzey, SinaSahabi, FieryPhoenix, ma_da_fa_ka, ITDOI, AM_I_Learning, awoo, lynmisakura, JustasLe and ArimeZ for testing the round and giving valuable feedback.

Also I'd like to thank coauthors, amiralisalimi, AS.82 and davooddkareshki for helping me with inventing and choosing the problems.

Finally, thanks to MikeMirzayanov for very nice and convenient Codeforces and Polygon platforms.

I wish you all will find the problems interesting, thank you for participating, and good luck!

$$$\text{Scoring distribution : } \; 500 ~- 1000 ~- 1500 ~- 2000 ~- 2500 ~- 3000$$$

$$$\textbf{UPD}$$$ : Editorial is out

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

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

An Iranian round after a long time .....
Thanks for your hard work.

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

I am an atheist.Can i participate in this round?

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

Ashishgup held three rounds and now he is a tester in this one. That's a lot of work.

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

Deleted

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

I am a beginner.Can any one give some advice about this contest.Please ,It will be helpful for me.

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

    A — dificulty will be less than 1200 & B -will less than 1400 most of the time..practise those problem from problemset with those difficulties . I think it will help

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

      many many thanks for your advice.

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

      If you get stuck on these, read the editorials. They will give you an idea of the sorts of algorithms that you need for problems at this level.

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

    If it your first contest, don't worry if you don't solve much. Even as a very experienced programmer (40 years as a professional software engineer) it took me a few tries to get the hang of programming contests.

    Unless you are in the last couple of minutes of a contest, always try running the provided examples locally (or using "custom test") before you submit. On Codeforces you lose points for failed submissions.

    If you know more than one programming language use whichever you find easiest to write. So long as you find a reasonable algorithm, performance is unlikely to be a major issue until at least the 4th of 5th problem. I use Python for my submissions, and (using PyPy3 to run it) I have yet to find a problem that it is too slow for.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    • A-difficulty between 800 to 1200 with tags including 'brute force', 'implementation', 'math', 'sorting' (rarely), etc;
    • B-difficulty between 1200 to 1500 with tags including 'binary search', 'data structure', 'divide and conquer', 'strings', 'combinatorics', etc;
    • C-difficulty between 1400 to 1800 with tags including 'dp', 'dfs', 'trees', 'graphs', 'bitmasking', etc;

    Moreover, after the contest is over you can always read the editorials or can refer others solutions. You can practice for any difficulty or any tag from the problemset by using filter provided on the right side.

    "Happy Coding :)".

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

      Thanks a lot...... I will remember your suggestions... again thanks a lot .... "Happy Coding you too & this community :)"

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

As a Tester I feel that the problem set is more diverse and good for everyone , there is something for everyone to solve and ya the round is good for those who just want to start with competitive coding!. Hope everyone to give this nice round!

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

Any specific reason for the unusual time?

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

Very Excited for your first contest!!

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

I think that's the beauty of codeforces. We get the best of problems from different countries which covers lot of diverse types of problems and helps us improve in different areas with each contest. We got 2-3 good indian rounds, this one is an Iranian round and 654 Div2 will be a Japanese round:).

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

    First time when i came across this platform, I found it very weird because it's UI is not very attractive but when i started participating in contests I have just fallen in love with this platform and no other coding platform gives me this much of joy while solving questions. I think codeforces community is really great and helps a lot in growing as a competitive coder.

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

Now Wish you Bad luck for downvoting bruh!

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

Downvoted. There's no reason to drag in religion here on Codeforces -- keep it to yourself.

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

    I don't see any reason to not to add a single line, which doesn't hurt anyone in any kind(or does it?). If i could see, then i would not.

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

      I'd say the setter has some freedom to include selected topics in his announcement/problems. A few contests back we defended Codeforces Round 645 (Div. 2) for having the corona-virus theme. Clearly, while the theme is offensive to some people, the vast majority of users seemed to find no harm in the in the author expressing his personal humor here.

      We must not adopt double standards: we tend to give our authors leeway to include their personal touch in their contests and announcements. Whether it is references to anime, marvel universes, corona, or religion, a persona touch is usually tolerated by the community historically.

      If a subject is considered too divisive then the community will naturally express it with sufficient downvotes, so either way we'll find out what everyone thinks.

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

        I think allowing the authors to add their 'personal touch' is the right approach. It's lots of work to author a contest, they should be able to broadcast their messages to people who read the CF announcements.

        Also, I can't imagine too many people caring enough to mass downvote an announcement or editorial. And this is good because most of us are here to improve on our CP abilities and not to get offended by the authors' political views, religion, and memes.

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

          I think as long it is not offensive for anybody, authors can add whatever they want.

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

        Thank you brother karim

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

      You can proudly add it bro. I think, this will not hurt anyone.

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

      I personally love when the authors include their personal touch to problems(or blog) and the editorials. It feels real-like problems. Also if you make an editorial like this I'd love it :-)

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

    When You are not start every work with name of GOD means there are not any GOD that is the best.

    if he use "In the name of Allah" it may be correct but it's a General sentence and all of people know it and hear it at least once.

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

    FYI in Iran it's a formal compulsory custom, much like a head cover for girls. Every article, movie etc. must start with this string. It's not an author's personal statement. More like a national trademark for a text.

    please correct me if I was wrong.

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

      Yeah you're right! Just like a white-man in America that MUST be racist if not he should survive under Polices' hits. Just stop trying to make a saint out of yourself.

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

      omg, why som many downvotes lol? If anyone bothers to explain, I'd gladly read that.

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

        So let me to do so. You just tried to make a bad and ugly face out of Iran with mentioning Iranian "formal compulsory" and pretending that they are just in Iran! And I think you got a proper feedback.

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

    Guys! Just take it easy! You are blaming the author cause of adding a simple line with some common words(And not a verse of Quran!), while you are sharing the black lives matter hashtag on Instagram and Twitter, HYPOCRITICALLY! You put knees on faiths' throat and try to kill them instead of learning that they exist, and you should live along them. I'm sorry if I just hurt someone with a kind of brute comment, but think about it!

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

      Bismillāh is not "some common words", and your metaphor is ridiculous. Regardless, everyone should be free to follow their beliefs and traditions.

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

        Do you see any "Allah" word?! God is a common word that doesn't really refer to any specific religion. It's not Allah, Jesus and things like that which they belong to a religion. Of course God is a common and general word

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

    Stop being so boring

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

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

Ok, I'm deleting this meme.

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

In the name of God... Me an atheist....

It is going to be an interesting round.

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

Great

»
4 года назад, # |
  Проголосовать: нравится -41 Проголосовать: не нравится
  • Will this round be rated?
  • How many people will be participating?
  • Is there going to be any math involved?
  • How large are the statements?
»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Looking forward to the contest!

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

Lol Ashishgup everywhere orz...

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

[Deleted]

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

    you can not be a good coder by skipping geometry problem.so need to practice more in which you are weak

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

I wish there aren't any interactive problems because i'm done with those.

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

Hey guys..did you notice vovuh is back with his div-3 round...? so excited!!

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

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

Is it just me or do others feel as well that the quality of comments section is going down? All I see are a lot of shitty memes, "Is it rated" and relentless pursuit from a lot of people to just comment on something for the sake of it. It's extremely uncomfortable as quality discussion on problems gets suppressed due to a lot of this unnecessary crap

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

The last time there was a single setter vs an army of testers,Ehab happened! Hope God saves this round!

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

Please mention about unusual start time in announcement. I noticed it after reading it in comment section.

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

BTW I did my best to make the statements as short and clear as they should be, stories are written in another font so you can skip them, but don't forget to read them when waiting for system test. I tried to lessen number of tests so we should not see long queues.

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

You welcome.

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

guys post god memes

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

thanks for your explanation!

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

    Polygon is the platform where all the problem is set, tested, and validated for the Codeforces round !!

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

All the best to you for your maiden contest!

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

Thank you for remembering me.

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

How much money does someone makes by problem setting in these contests ,

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

once again Ashishgup

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

Edit: Got it. thanks.

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

.

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

Well ,Is there anybody else other than me who can relate to this ?
WhatsApp-Image-2020-06-22-at-4.00.51-PM.jpg

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

Score distributions are out.

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

Till now I was thinking that the round will be held today. I was prepared for it. :(

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

OK, got it.

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

Hope your first contest will be more interesting.

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

I have a good feeling to this contest <3 ;)

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

How can i see my solved problem distribution on CF ? (difficulty-wise) Thanks in advance........

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

 DeadlyCritic Bro what an inspiring curve of rating you have . As a beginner these things motivate me a lot . Hoping to have more rounds from you!!

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

UNUSUAL TIME

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

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

Me: Yes, I can do it. I can solve all the problems. I will be rank 1. But after solving at max two problems, enough I am done with it. I am going to sleep.

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

I hope to be a pupil in today's contest anyway.

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

CodeForces and all the problem setters, coordinators, testers are doing an amazing job to arrange such good contests on such regular basis. Hats Off to their efforts!

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

Why people nowadays are discussing such irrelevant topics in the comment sections?You guys have other social sites to do these stuffs.CF is not the right place to share memes & have a discussion about if the author can add "In The Name of God" in his post or not.

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

Humble request to authors: Don't make it Propaganda forces Thank you!

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

Hopefully, your entry as a contest writer will be interesting and hoping for an interesting contest as you said :).

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

submissions in queue for a long time. will contest delay?

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

This time is very unusual as per India. As many of the students stay in the hostel, and it coincides with dinner timings of the mess: 1930-2130 IST. So either we have to skip dinner or lag in the contest.

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

    its not tough to delay dinner about 1/2 hours..Its worldwide..so some people always face problem brother..

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

    dude leave this contest and go to your home first, :)

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

    I don't know if you are lucky to have nice food in mess, I never gave a thought to skipping or lagging in contests for mess food.

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

    U are in college at the time of this lockdown ? Seems very far-fetched :P

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

GLHF EVERYONE!

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

Man I keep getting Wa on A again I solved 3 problems and my rating will stay the same :(

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

How to solve D What was D.

  • »
    »
    4 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +10 Проголосовать: не нравится
    if(x%3==0) f(x) = 2*f(x-2) + f(x-1) + 4
    else f(x) = 2*f(x-2) + f(x-1)
    
    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +7 Проголосовать: не нравится

      can you please prove this.i was able to get both recurrence but was not able to figure out when to put the condition .

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

        The tree of level x can be decomposed into three subtrees of level (x-2), (x-2), (x-1) respectively, which are connected by root node. Claws can be chosen from the bottom. The claw including root is used for x=3. For x=4, one subtree will be of level 3 so its root cannot be used. For x=5, two subtrees will be of level 3 so root cannot be used. For x=6, the roots of all three subtrees are unused so one more claw can be picked. similarly, for every multiple of 3 one extra claw is picked.

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

I lost too much time convincing myself that the proof for problem B I had in my mind was correct :D Anyway, I really enjoyed the problems. It was a good contest.

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

"For each test case, print a single integer — the maximum number of yellow vertices Lee can make modulo 10^9+7." — having the maximum modulo instead of the maximum actual answer modulo 10^9+7 was very nasty. Should have been explained better, as usually the problems require the actual maximum modulo something.

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

    What? I think that's just messed up wording, because I solved the standard problem and passed the pretests.

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

Summary of the contest:

Wrong answer on pretest 2

Easy D

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

How to solve D??

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

    $$$f(n) = f(n-3) + 4*T_{n-2,0}$$$
    where $$$T_{n,0}$$$ is the number of nodes with degree 0 in the RDB of level n

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

Please don't write −In the name of God − from next time :(

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

    Please don't comment Please don't write −In the name of God − from next time :( from next time :)

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

How to solve problem E? I tried to model the problem using graph network- food type as node and each friend as edge. How to proceed?

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

    If solution exists then for any subset of people solution exists as well, so try to find a guy who can be in last position.

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

    E should be solved using greedy and has no relationship with graphs.

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

any hint for problem D !?

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

    Greedy from the bottom

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

    The tree obtained at level I is a combination trees obtained in level I-1 and level I-2. this is. A hint. Now everything is a Dp

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

    Think about how many leaves you can have in a k-level tree. You can build up your solution based on this.

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

    is it solvable by math solution ?

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

      All 1-D DP relations are actually mathematical functions. Same about this one. But obviously, here you would be needing memorization to avoid TLE.

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

    Use greedy and simple dp. The code is quite clean.

    for(int i = 5; i <= 2000000; i++){
    	f[i] = (f[i] + 2 * f[i - 2] + f[i - 1]) % mod;
    	if(i % 3 == 0) f[i] += 4;
    }
    
»
4 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

How to solve E? It is a variation of Cow and Snacks. How to handle multiplicity of plates?

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

Nice and hard problem E, thank you author

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

I did not like this one. For me D and E where hard to understand, I restarted two or three times just to notice after some times that I did get the question wrong.

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

    Agree. I have to read D and E many times to understand them correctly. The statements are easy to cause confusion.

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

You tried to make a hard D ? You definitely made a deceptive D. Loved solving it.

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

    Actually earlier D was something Different which you might not Like , this was invented after hardships , this was a really nice DP problem I ever solved.

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

I don't know why my D solution is correct.

    for (int i = 4; i <= 2000000; i++)
        f[i][0] = max(f[i - 1][0], f[i - 1][1]) + max(f[i - 2][0], f[i - 2][1]) * 2,
        f[i][0] %= P,
        f[i][1] = 4 + f[i - 1][0] + 2 * f[i - 2][0],
        f[i][1] %= P;
  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    Edit: oh nvm disregard

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

    [deleted]

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

    You are very lucky, because the modulo of the max is different from the maximum of modulo. But in this problem the two values doesn't differ from more than 4, so with some luck it works.

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

    you get maximum of two thing that differ at most one. this solotion is correct but our solotin is another thing

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

    Generally max(a, b) != max(a % mod, b % mod)

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

      Wow, it's true, and my solution with max should fall, but it worked :)

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

        It should not, as we know $$$a$$$ and $$$b$$$ differ by $$$4$$$ at most, so it works as long as $$$max(a \% mod, b \% mod) < mod-4$$$, and smallest such $$$n$$$ was so big.

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

          Did you consider changing Mod value instead of N or was it intended to leave that solution AC?

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

            I didn't realize that I can change Mod, thanks I will note it for my later rounds, thank you. I prefer those solutions to fall, at least one-third of the solutions would fall.

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

              You're welcome :) I liked the problems actually they were very interesting. In the contest I've written solution similar to his one but was sure it will fail and you planed to trick us with such a case so I gave it 10 minutes more to find out the pattern when N is divisible by 3! That's why I tried to generate a valid MOD to prove I was thinking correctly LOL.

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

                :), If the MOD was something special, then yes I would do the same, but not when MOD is $$$10^9+7$$$. Also the sample had $$$2\cdot 10^6$$$, so there were no room for WA. Except some special Time Limit exceeded.

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

                  Sure actually $$$1000002193$$$ is the first prime number >= $$$10^9$$$ which could make their solution fail as I tested for each prime all possible values of N. I know it's hard to find such cases unless you predict that someone would do that exact solution while writing the problem constraints!

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

    I think it's OK, this is my code:

    for(i=3;i<maxn;i++){
    	f[i][0]=(max(f[i-2][0],f[i-2][1])*2+max(f[i-1][0],f[i-1][1]))%mod;
    	f[i][1]=(f[i-2][0]*2+f[i-1][0]+4)%mod;
    }
    

    Isn't it right? Why you think it's incorrect?

    My English is't well, please forgive me. ovo

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

    To be sure that they will be no errors with the max, you can remark that the second value is greater than the first one if and only if i%3 == 0

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

Very descriptive questions. And I must say, the names were quite good too.

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

Why problem D I can mod then max to pp the testcases?

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

    No need to use max, ans is:

    dp[x] = (4*(!(x%3)) + ((2LL*solve(x-2))%mod + solve(x-1))%mod)%mod;

    PS: Just clarifying that badcw was asking another thing before, I have no idea why the solution with max works.

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

Can someone please help me out with B?

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

    you just have to find first and last occurrence of "1" and change substring between first and last "1" to either "0" if any "0" is present in it . or substring remains same if there is no "0" in it

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

'A' problem ruined my day,thx

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

'C' --> peace of shit

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

    was C about picking first i+b(i)-1 FOR.MIN AND THEN K max elemnt for max?

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

      It was sorting plus two pointers problem. First sort both arrays. Then one pointer at last element of arr1 and second at n-kth position, then move both pointers carefully.

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

      Every friend gets one of the k biggest numbers. Then distribute from the remaining numbers the w[0] smallest to the friends getting the most numbers. Then next friend with next biggest number gets next w[1] smallest numbers etc...

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

    After got 4 wrong answer and then got accepted.. Then just i thought ,, "How foolish i am" !

    Edit: answer was quite easy .

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

Cool problem D, even though my finger is fat and I typed %2, instead of %3. Just realized :D

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

How to solve D?

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

    By DP, ans is:

    dp[x] = (4*(!(x%3)) + ((2LL*solve(x-2))%mod + solve(x-1))%mod)%mod;

    If you try to draw the first trees, you will realize that a tree of level x is composed by this three trees.

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

    By DP. You can build a relation. ans[x] = (4*leaves[x-2] + ans[x-3]). Here leaves[i] denotes the number of leaf nodes in ith level tree.

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

When First Problem is A Geometry Problem, its just a mood spoiler ! :/

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

Why the problem suffix has to be "LEE"?

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

Interesting problems. Especially E, though I could not solve it. How to solve E?

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

Looks like I am the only one who thought that the sum of n over all test cases can exceed 10^7 in problem D :(.

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

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

Nice Contest! Liked the problems, hoping for more contests from you in future :)

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

https://codeforces.com/contest/1369/submission/84784993 really?? What about making strong systests?

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

Problem A, why call it OX-axis and OY-axis ? What does O stand for ?

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

Plenty of examples. +1

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

Story in problem E was amusing

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

.

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

Here as the virtual Moss for Codeforces, busting cheaters and getting them out of their bills. I hereby present you another team Admiral_Wolf and smiling_addu

B: 84762137 and 84789248 , If you swap the if-else part, it's easy to say the solutions are the same.

C: 84771585 and 84786359 , Only the vectors in both the solutions are different. Also c <= k and the strange way c-k <= 0 are again the same, they did to save them from the moss.

D: 84791187 and 84796767 , Again the solutions are the same if you look at the parts below it's evident something is strange

dp[i] += (dp[i - 1] + dp[i - 2] + dp[i - 2]) % MOD;

dp[i] = (dp[i] + dp[i-1] + 2*dp[i-2])%mod;

To save from Moss, 2*dp[i-2] == the strange way dp[i-2] + dp[i-2]

DeadlyCritic MikeMirzayanov adedalic

UPD: The solutions are skipped

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

Not able to view the editorial. Its showing- "You are not allowed to view the requested page".

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

Recently, lots of cheating is happening in codeforces. In most of the contests solution of problems A, B, C and sometimes D (Div. 2) are being made available in ideone, which is not only increasing fake ratings, many genuine ratings are also being affected because of increasing ranks.

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

    It's very disappointing and the ones who are suffering due to this are mainly noobs, after doing 3 problems many are getting huge rating drops. It is even leading to frustration and loss of confidence.

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

    Really glad to see someone speak on this. In almost every contest, someone posts the solution on ideone(knowingly) and there are so many talented coders out there copying the same and getting their ratings boosted. Also some people are getting huge rating drops due to this. It's also ruining the fun of the contests. Are we helpless and can't do anything against this other than plagiarism checks.

    Also, I am ready to receive all the downvotes from the cheaters.

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

That was quite the LEE-round

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

I submitted the C question and passed the pretest but now it shows wrong answer. My logic matches the editorial and i am not able to find the bug in my code. Please help. https://codeforces.com/contest/1369/submission/84786141

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

    Aiman11

    This happens cause you are accessing storage that is out of bounds In your while loop, add a condition of q<k.

    Here 84786141 is the submission with the changes.

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

      Thanks! I submitted it again and it was accepted. Cant believe i lost ratings due to such a silly mistake :(

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

Why does this doesn't work for D? I find for every level how many more(new) vertices with 3 children were added from previous level and then do dp[i]=dp[i]+dp[i-2]. Solution: https://codeforces.com/contest/1369/submission/84822790

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

Can anyone tell me how the answer for the case n = 5 is 12 in problem D? Any image would be highly appreciated

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

I accidentally used Ideone on public settings and someone copied and submitted the same code int this contest and now i received a system email regarding the penalty for this. Can someone guide me as to what should i do. This is the link of my submissions https://ideone.com/qDpu3b

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

Why I am getting MLE on this submisssion https://codeforces.com/contest/1369/submission/84815861 for problem C? tnx. My biggest variables are two arrays of integers of size 200000 each which makes it in total less than 2 MB.

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

    Your insertion sort doesn't terminate if the element needs to be at the start of the array.

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

      It seems insertion sort works fine. Can you please be a little more concrete?

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

        Try the test case below. During insertion sort key will be -1 and get compared to 13 (a[1]), then 1 (a[0]), then undefined (a[-1]) and at that point you rely on uninitialised memory to be <= -1 to stop it.

        1

        4 2

        1 13 -1 17

        3 1

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

Here's my screencast of getting 7th place. I discuss the solutions to all problems at the end.

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

Enjoyed the contest and neat editorials. Thank you DeadlyCritic and team !

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

Мой русский разбор на E (может кому-то будет интересно) https://telegra.ph/Razbor-zadachi-E652-Div2-06-23

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

A fact :

Problems' names are connected to difficulties, also they show you the gaps with high accuracy.

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

My first round))

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

My first round

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

Мой первый раунд)