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

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

Hi fellow Coders!

AntiBsayer, Salem_Alwarawreh and I are glad to invite you to take part in Codeforces Round 699 (Div. 2), which will take place on Feb/05/2021 17:35 (Moscow time). Round will be rated for participants with rating less than 2100. Participants from the first division are also welcomed to take part out of competition.

You will be given 2 hours to solve 6 problems, each problem has a picture and a story above it. The stories are skippable if you want to focus on the real problems.

We would also like to thank:

Score distribution will be announced before the start of the round, hopefully.

We hope you like the problems and enjoy solving them!

UPD: Scoring is 500 — 750 — 1500 — 2000 — 2500 — 3000

UPD: Editorial

UPD: Congratulations to the winners

Div1 :

  1. dreamoon_love_AA

  2. neal

  3. Sugar_fan

  4. hank55663

  5. kotatsugame

Div2 :

  1. Quirrel

  2. -ohweonfire

  3. tuagoale

  4. buihoatpt2k3bc

  5. njwrz

Thank you all for participating!

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

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

Finally an expert in problem setting :)

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

As a non tester, I just commented to make SlavicG's comment appear further down.

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

Jordanian round ❤

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

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

Thank U AntiBsayer, Warawreh & Salem_Alwarawreh so much for setting problems on this round, I am sure the problems are gonna be so much fun to think of, also to solve ^^ Can't wait to participate!

Jordanian round ❤

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

Even though final exams, we don't have contest prepared by our neighbors everyday.

Jordanian round ❤

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

As a participant, I thank Khaled for drawing pictures for all the problems.

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

Looking forward to the colorful pictures!

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

Thanks for the stories and also making them skippable. They are really fun to read, but only when the contest is over :D

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

We definitely need more picture problems :) Also, please lesser of these

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

It's a joyful thing to me to see Arabic round again. Hope our contribution in problem solving community keep it's progress and see more Arabic rounds in the future.

I am realy intersted to praticipate in your round ,thank you guys.

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

I wonder who's gonna read all those interesting stories?

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

It feels so good having a contest in your birthday when you're lifeless and have nothing to do.

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

My Pledge for round #699: I will solve at least Three problems! And then declare the Fourth great Ninja War!

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

We hope you like the problems and enjoy solving them!

How to enjoy when one is not able to solve them? reading stories xd?

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

As a tester, I recommend enjoying problems!

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

AntiBsayer == Thanks :D

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

thanks for the skippable stories :hearts:

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

Pictorial explaination of all the problems, nice !! It seems an interesting round.

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

As a tester, I wish everyone good luck!

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

Downvote this comment for ancient goodluck curse !

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

Irrelevant

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

As a participant, I'm happy with the frequency of the contests! ;)

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

Hope it will be a good round

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

What's the point of stories in problems if they are skippable? Like tourist mentioned in one of his streams, the stories must sync in with the problems themselves, similar to like Google Codejam's problems. Otherwise, why not just remove stories altogether for the problems that do not require such?

In any case, hopefully, the contest will be enjoyable.

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

    It has happened where the story and the statement do sync up, but the authors just choose to separate it to make it easier for participants. They separate the informal statement and the formal one, so participants can choose whether they want to read it or not. I personally like this choice, because it makes the problems more enjoyable for the participants (and the authors to write), without getting in the way of the actual problem solving if the participant doesn't actually want to read it.

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

.

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

Нужно переносить раунд. В 17:30 по мск начинается стрим папича по шреку!!!

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

Hello.

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

Tonight I can write the saddest lines.

Write, for example, “The night is starry and the blue stars shiver in the distance.”

The night wind revolves in the sky and sings.

Tonight I can write the saddest lines. I loved her, and sometimes she loved me too.

Through nights like this one I held her in my arms. I kissed her again and again under the endless sky.

She loved me sometimes, and I loved her too. How could one not have loved her great still eyes.

Tonight I can write the saddest lines. To think that I do not have her. To feel that I have lost her.

To hear the immense night, still more immense without her. And the verse falls to the soul like dew to the pasture.

What does it matter that my love could not keep her. The night is starry and she is not with me.

This is all. In the distance someone is singing. In the distance. My soul is not satisfied that it has lost her.

My sight tries to find her as though to bring her closer. My heart looks for her, and she is not with me.

The same night whitening the same trees. We, of that time, are no longer the same.

I no longer love her, that’s certain, but how I loved her. My voice tried to find the wind to touch her hearing.

Another’s. She will be another’s. As she was before my kisses. Her voice, her bright body. Her infinite eyes.

I no longer love her, that’s certain, but maybe I love her. Love is so short, forgetting is so long.

Because through nights like this one I held her in my arms my soul is not satisfied that it has lost her.

Though this be the last pain that she makes me suffer and these the last verses that I write for her.

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

The contests are very rewarding I will be participating in the upcoming contests.

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

Hope to be Master

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

Shanks, Salem_Alwarawreh and Warawreh thankyou to all of you for another contest.

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

Expecting the problems difficulty order to A<B<C rather than (A or B)<C<(B or A).

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

All the best to everyone participating in the contest.

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

If existing muti-solve in problemC, just output a random one?

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

Hello who can point me to a good tutorial covering graphs topic?

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

Tasks was interesting. Thank you

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

Why are C's and D's implementations so dirty?

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

2 WA submissions on C for writing n instead of m and half an hour to find this bug that feels like shit especially I fu**ed in B

(dying sad dog picture)How to solve B?

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

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

How to solve E?

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

Can someone give a test-case for which my code fails for problem C WA_CODE

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

A great and well balanced problem-set. Also, C was a nice question, although it took me an hour to implement it and fix bugs :(.

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

I think who passed the first test case of the c problem he must pass all pretests

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

I have codeforces account and wanted to participate in above contest. But I haven't registered for it. Why CodeForces don't allow to participate unregistered coders like me in Contest.

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

    According to rules: If you are late to register in 5 minutes before the start, you can register later during the extra registration. Extra registration opens 10 minutes after the contest starts and lasts 20 minutes.

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

B turned out to be a bluff

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

I was so close on solving D just did not have had the time... You just had to notice that when there is no such pair that edge[i][j] = edge[j][i] and when m%2 != 1 (which are the 2 conditions that one can solve very easily with constructive solutions) then you could see that if you had 3 vertices again a constructive solution is possible.

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

Loved the art! Thanks for a great contest!

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

One of the best CF rounds I have recently taken part in. Finally, we had WriteSomeCodeForces rather than omnipresent Notice1E9ThingsAndWriteOneLineForces. Kudos!

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

Can anyone help me find why my code for B always get TLE? I thought the complexity for my code is O(10^6) Thanks ;w; http://codepad.org/Nf4Rkb1n

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

May I know what is pretest 2 of B?

UPD: Managed to solve it, my brute force was not brute force enough and missed some corner cases sigh

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

Nice pictures in problems! I like them.

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

How to solve B?? I was getting TLE on 2nd test case.

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

Very nice problems set in this contest. Can anyone explain how to solve E?

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

In part D , what was needed to handle the case when there is no such pair of nodes (i,j) such that a[i][j] = a[j][i] and M was an Even number. I think this was the entire question , because rest all part were quite easy. How to solve for this case?

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

    Hint 1: Suppose a valid path exists when m is even. This implies that there must exist some nodes u, v, w such that a[u][v] = a[v][w] (Think of the middle two characters in palindromic string).

    Hint 2: Consider the case when you start at u, and the case when you start at v, and only travel between these three nodes in a cyclic fashion.

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

      Yeah, thanks lavish315 for this. Now, it is evident that if there are 3 such nodes such that a[u][v] = a[v][w]. I can complete (M-2)/2 visits between (u,w) and then end at either u or w. Take 2 more steps to go to the alternate vertex w or u. And then , continue another (M-2)/2 visits.

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

      I was wondering the proof of the existence of (u,v,w) is quite satisfactory. But , if such a (triplet)/(a cycle with all edges of same letters) does not exist , can we say for sure that solution does not exist?

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

        Yes, we can claim so. Consider m = 2k, and let say there is no such triplet. Assume that a possible path exists. Then, again by the same logic, character at position k and k+1 are same, and by contradiction, this implies that such a triplet/cycle exists.

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

    You can proof that there must be a method in three random vertices

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

    If m is even and If there are 3 edges that form the pattern aabb/bbaa when you go from 1-2-3-2-1 then answer exists and you just have to repeat the pattern or else answer is No.

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

    Hint 1: You're right, that's the case you need to figure out to solve the problem.

    Hint 2: In this case, consider 3 vertices and the path between them.

    Hint 3: In this case, if there exist distinct i,j,k such that a[i][j] = a[j][k] then does it work? What values of M does it work for?

    Hint 4: Can you make it work for the remaining values of M?

    Extra credit: What about if they don't exist, can you prove that it doesn't work? Even stronger, you can actually prove that for n>=4 there will always be i,j,k that satisfy the condition.

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

Really loved the problems! While I didn't really give my best performance (something close to the opposite actually xP) but the experience was definitely appreciable.

Huge thanks to everyone involved in the creation and conduction of the contest! :)

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

I felt this round to be more implementation based !!

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

Problem D is a trash and third-class problem. Stop setting such brain-dead problems. They take away time from the really interesting problems.

Pretty sure this garbage D would have been rejected if Anton was the coordinator.

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

Got to say, a great contest finally after a long time. Loved the problemset !

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

How to solve D ??
and Is CF little bit slow to browse ??

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

I didn't like problem D because even though I had the entire idea it took way too long to code it. I don't find these types of problems enjoyable. If they are interesting that is another case. But it was neither interesting nor easy to code.

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

Despite having done horribly in this contest, I'd like to say that this was a nice contest!

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

In problem A & C there are sentences like

  • You can print each letter in any case (upper or lower).

but in problem D there's not. This is only a minor issue but i think it's better to be consistent about the case of YESs and NOs.

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

Why h in B is not <= 10e9 too? With h<=10 it's just straight simulation, Div2B should be something more difficult than it.

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

Loved the problems... This went too good to be true for me...

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

When I saw problem B and see 1<k<=10^9, I thought the h must also be 10^9, so I just use a stack to implement, which take me over half an hour.

I was wondering why so many people get accepted by problem B until I see the constraint 1<h<100.

Oh, shit! If I saw this at the first glance, I will have enough time to do problem D.

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

I'm lost 1 hour and 30 min to find the bug in problem C and I can't find it :(. I can AC D but I'm lost too much time in problem C :( This is my big lesson. Specialist time.

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

one step back to accelerate (rating -23)

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

https://mirror.codeforces.com/contest/1481/submission/106608013 Div2C could someone kindly provide me a test which causes wrong answer?

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

Why am I getting Memory Limit exceeded on this? Any help?

Submission: 106602826

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

AntiBsayer Salem_Alwarawreh

Warawreh MikeMirzayanov

106611585

This is my code for Round 699 div 2 task b. I have used dynamic memory allocation for the array. In this approach i am getting memory limit exceeded. Whereas the same approach with static memory allocation works just fine. I know that i haven't deallocated the memory after every iteration but it was given that sum of n over all test cases is less than 100 so i dont see why deallocating that array after every iteration is required because at the end of the day i am only making a long long array of size 100

Please Help and point out my mistake here if any.

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

My solution for D is wrong answer on test 2's 145th test case! Can someone give me a smaller example to debug?106582694

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

106598727 (My submission for Problem B) . Can anyone please point out why this code is failing ? I am really not able to figure out the possbile reason. Thanks.

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

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

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

How to solve C?

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

I can't seem to figure out the mistake in C. My idea is the same as given in the tutorial. Some help would be really appreciated. Here is my submission Submission

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

Thanks for fast tutorial release

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

Here is my Screencast for today's contest, if anybody is interested in watching a noob attempt this round xD

YouTube Video

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

Thank you very for the contest

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

In Div 2 Problem C: Fence Painting

I read the editorial and tried writing it's code however it is giving me TLE, can someone please help me out?

We must first see that the most important painter is the last one (and he will paint plank x where bx=cm) because of two reasons: when he paints plank x it won't be changed and if some other painter have a color that we don't need we can make him paint plank x, which will be repainted later.

Now we need to find x where bx=cm, there are three options:

bx≠ax. bx=ax. There are no bx=cm this case is impossible and the answer is "NO". If the first two are true we choose x such that bx≠ax, then we greedily distribute all painters j (1≤j<m) such that:

There is plank i such that bi=cj and bi≠ai then the jth painter will paint plank i (as a result the color of the ith plank will be changed). There is no plank i such that bi=cj and bi≠ai then the jth painter will paint plank x. At the end there might be some planks that didn't end up as we want so we make a last liner check on all planks i and check if bi=ai, the total time is O(n).

Code Link: https://ide.geeksforgeeks.org/DqHB8ngckI

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

Weak pretests :( In problem C, by mistake i did l=mid-1 and r=mid+1. I should have to assign l=mid+1 and r=mid-1. But still it passed the pretests. It's just the reverse which we have to do with some extra element from other side. Link

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

MikeMirzayanov

Problem ratings for this round have not been updated, although the ratings for the round after this (Round $$$700$$$) have been updated.

EDIT: wow, that was fast :P