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

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

Good Evening Codeforces! ^_^

This round is unrated; please read this to know why.

I invite you to participate in Codeforces Round #682 (Div.2) taking place on 13.11.2020 17:35 (Московское время). The round, authored by Anti-Light and me, is rated for users rated less than 2100, while other users can participate non-competitively.

The round features six 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–

We will announce the scoring distribution shortly. The scoring distribution is 500–750–1250–1750–2250-3000.

Good luck, and stay safe!

UPD: Editorial

For students in high school or below—

Participants who are currently in high school or below are eligible to win prizes — 25 USD gift cards to 5 random participants who solve at least 3 problems. Prizes are sponsored by Athena Education and are NOT related to Codeforces. To be eligible, please fill this form (it will be closed after the round ends). If you're interested in participating in other technical events, such as Machine Learning and Computational Linguistics, please head over to exunclan.com.

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

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

Registered Participants are eligible for the following prizes.

Registered participants on round or those who filled the form?

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

Hmm, it would have made sense if there were cash prizes for top rankers + random people, or only top rankers. But to have prizes only for random people is a bit weird.

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

Expecting a Good Problem Set. Because it's shashwatchan

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

Hope you weren't sleepy while writing problem statements.

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

.

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

intresting problems.

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

I'm currently in high school but over 2100, so this round will be unrated for me. Will I still be eligible for any prizes?

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

As a tester these problems were very interesting!

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

[Your text to link here...](IMG_20201111_021152.jpg)

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

Finally!

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

Wow that's a whole lot of testers!

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

Now I am more excited about the 3b1b-style video editorials!!

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

lol, 1 week without contest,

It was difficult, MikeMirzayanov

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

please we request don't take 10 days gap for codeforces contest

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

These 10 days made me realise the plight of div 1 users. Guys hats off to your patience (all div 1 users)

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

yo 3b1b type videos? that's sick

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

Finally a contest now :)

It seems that there are much more people testing for the contest. So I think this Div.2 would be an excellent one :)

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

Finally something to cheer about

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

Waited)

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

![ ](IMG_20201113_113829.jpg)

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

Wow, there is Anti-Light in writers too!!

I guess this round is going to be awesome.

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

Happy Diwali :)

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

They say it's an Indian contest but it isn't just an Indian contest, it's an Indian_Iranian contest. Because Anti-Light is Iranian. So... it means it's gonna be so good.

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

I didn't finish the form which to prove i'm a high school student. Could I finish it now?

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

Happy Diwali Everyone !!

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

problems are very sexy 10/10 would bang

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

Is it rated?

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

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

happy diwali to everyone out there

this diwali i pray to god so that your code gets compiled and accepted at one go(mine too :) ).

happy diwali happy coding

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

Every body holds his hat XD

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

registered already but showing need to register to submit

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

queue?

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

I submitted a source code before they changed N and T, and got WA for no reason, very cool.

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

what's going on. is that really unrated?

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

I don't get it

What was wrong with B?

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

Got a round after so many days and that too became unrated :(

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

Friday the 13th

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

When I will tell my granchildren that we had rated contests on CodeForces, I bet they wouldn't believe me.

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

After waiting for so many days, we got unrated round... :-(

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

Why unrated? I was really fast in ABC, so sad :/

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

So sad that this is unrated! It's first time I pass the D

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

The problems are really good!

It's a pity that so many testers and no one caught the issue with constraints on B :(

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

You know . when you make round unrated half of participants are happy and half not !. im in unhappy group . also when the reason of that is just a bit change in limits!!!!

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

when u finally get <2k rank but round becomes unrated :(

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

Luckily I didn't use array with constant space in B

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

40 testers and noone used assert while testing to check the constraints??? Seriously what did all these testers do? Felling sad for the authors :(

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

Very disappointing. 3 questions inside 25 mins and on track for CM status, and then it's unrated because the constraints were wrong.

I sympathise with the writers and am grateful for the effort that is put in. How did the testers not pick this up?

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

What was the mistake(in constraints) in B ?

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

I am not sure what the testers are supposed to do but confirming the constraints seems like one of the first things to do. Anyways, the problems were nice. Also, I think there should be a gap between different tests in sample. Makes it a lot easier to read.

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

.

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

It's a shame the round is unrated, the problems are quite beautiful. The issue with constraints on B was not the fault of authors, so please don't downvote the blog out of anger.

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

Feeling Sad for SleepyShashwat !!! Problem set were really good !!

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

(IMG_20201113_213202.jpg)

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

This is the first time i solved a problem with in 60 seconds i got 500 points but sadly the contest became unrated :(

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

Even though it's unrated, don't discuss the problems, please, before the end of the contest. Writer is still going to give prizes

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

One request to codeforces if round is unrated please use bold letters so we don't get a blow after a while

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

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

[Deleted]

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

B positive

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

The tasks were really very interesting.

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

When you solve 3 problems in 12 mins finally, after consecutive blows in previous contests, and the entire universe conspires to screw your rating!

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

Damn I couldn't get C but solved D and climbed to rank 18 for a moment. And now I am like bruh

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

Actually,B doesn't really need an array.

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

Thank you. I love Codeforces!

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

If you got the idea of problem B, it didn't matter the constraints. And the notification of the correction was done with plenty of time to review the problem for any player. I don't think the effect to the score would be stronger than what happens when hidden tests fail at the end of the round after pretests passed. In my opinion, the round shouldn't be unrated...

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

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

came to read comment section just to be sure that It's unrated.

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

I was supposed to lose 73 points... and then the round became unrated.

Anyways, I still think it's a pity that the round is unrated because problem B was nice (even though I couldn't solve it). Based on comments, the remaining problems were also nice.

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

well i think i found solution to C but its way too hard for C and takes too long to code ... D was really easy for me on the other hand maybe im a potato :/

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

Today maybe it was my best performance , and it got unrated .In the next contest it will be rated and I will get a minus 50. Cause that's life.

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

what is wrong with this idea for $$$D -$$$ If n is odd $$$or$$$ (n is even and there is no odd frequency element) then $$$YES$$$ else $$$NO$$$

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

Dear division 1, the short interaction between you and me was nice. Now, we have to part away.

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

.

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

    for each i and j, ensure that inp[i][j] + i + j is even (or odd). then adjacent numbers will have opposite parity, making sure that adjacent numbers are different.

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

    Try to arrange elements like ,

    0101010
    1010101
    0101010
    

    where 0 represent an even number and 1 represent an odd number. Of course you can always change the parity of a number by adding 1 to it.

    I have seen that most of the people have done it by using dfs also.

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

Well it was Friday the 13th. Coincidence? I think not :)

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

Can someone explain how to solve problem C?

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

did you also overcomplicated solution for B or are you normal?

expected solution was if all elements are distict print "NO" else "YES".

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

So in D, I constructed solution for odd n and couldn't get the x-or = 0 thing for even n, foolishness 100. Just got it now.

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

Did anyone else use 2-SAT for C? xD

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

Nobody did any hacking, interesting XD

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

It's okay that the round is unrated. It happens.

However, I hope the announcement would emphasize the fact that it's unrated when it's unrated. I saw only the first two sentences of the announcement, and I didn't read the rest of it because I saw that it was talking about problem B and I already passed it, so I thought there is no need for me to read it any further.

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

Can anyone explain why my dfs solution for C is giving wrong answer on pretest-2 here's my Submission.

I've tried it on some other test cases and unable to find any mistake. Can anyone help?

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

My solutions:

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

Finally 13 th November. It's Unrated,still intrigued with some great problems....

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

Can anyone please tell me as to why this solution to B was wrong?

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

Never keep a contest on Friday the 13th

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

Is it unrated now?

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

We want one more rated contest in this week as this contest became unrated

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

Why this solution doesn't work 98303387, but this solution works 98327745?

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

Important test case is missing from D. I submitted what should be an incorrect solution, and later resubmitted a correct solution. However, my incorrect solution also passes.

The test case in question is where N = 4 and the answer is YES, e.g. N = 4, A = 2 2 2 2, or N = 4, A = 1 1 3 3

My incorrect code printed out "N-4" as the the number of steps, which gives an output: steps = 0, ops = 1 2 3

Clearly this is incorrect, and I corrected my code to output: steps = 1, ops = 1 2 3

However the test cases are not currently sufficient to identify this bug.

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

some please point the mistake in this Problem C solution solution_link

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

Easy solution to problem E:

Notice that if $$$a_l \oplus a_r = a_{l+1} + a_{l+2} + ... + a_{r-2} + a_{r-1}$$$ is satisfied, then $$$a_l + a_r \geq a_{l+1} + a_{l+2} + ... + a_{r-2} + a_{r-1}$$$ is also satisfied.

Assume we fix the position of the rightmost element $$$r$$$. Now let $$$l$$$ be the index of the first element to the left of $$$r$$$, so that $$$a_l + a_r \geq a_{l+1} + a_{l+2} + ... + a_{r-2} + a_{r-1}$$$. The sum of $$$a_l ... a_r$$$ is at least twice as large as the sum of $$$a_{l+1}...a_{r-1}$$$. Lets denote the sum $$$a_{l+1}...a_{r-1}$$$ by $$$x$$$. Notice that the element at the next valid left endpoint will have to be at least $$$x * 2$$$, the next one at least $$$x * 4$$$ ... Hence there are at most $$$log(maxA)$$$ candidate left endpoints for a single $$$r$$$. We can check all of these subarrays $$$O(N \cdot logN \cdot log(maxA))$$$ time using range queries or set (the solution works with a very small constant factor).

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

Hello, a newcomer here.

I was trying to use pypy3 to do F, and I got a lot of TLE's. I tried many ways to go around this, but I wasn't able to find a not-very-dodgy solution: I had to do it in "batches"

https://mirror.codeforces.com/contest/1438/submission/98332683

Is there a not-very-dodgy way to do this with pypy?

Here are some of my failed attempts: https://mirror.codeforces.com/contest/1438/submission/98331404 https://mirror.codeforces.com/contest/1438/submission/98330796

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

can anyone explain code from jiangly

    int t;
    std::cin >> t;
    while (t--) {
        int n, m;
        std::cin >> n >> m;
        for (int i = 1; i <= n; ++i) {
            for (int j = 1; j <= m; ++j) {
                int a;
                std::cin >> a;
                std::cout << a + (a % 2 != (i + j) % 2) << " \n"[j == m];
            }
        }
    }

// Plz explain this line
//  std::cout << a + (a % 2 != (i + j) % 2) << " \n"[j == m];


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

upvote this comment if you too think today's contest was mainly based on simple observations only.

[please don't downvote to pull my leg]

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

    That's the case with most Div2 rounds nowadays, which is by no means a bad thing. In fact it's only true with A, B and C problems. Give D, E and F a go and you'll be proven wrong very easily. People of all levels get 1 problem to play with, while others stay far below/above their current level and in my opinion that is very well balanced.

    Problem solving is all about logical thinking and making observations, maths and algorithms are really the tools to execute the idea.