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

Автор sum, история, 3 года назад, По-английски

Hello Codeforces!

omeganot and I are excited to invite you to participate in Codeforces Round 919 (Div. 2) which will start on 13.01.2024 17:35 (Московское время). You will be given 2 hours to solve 6 problems. One of the problems is divided into 2 subtasks.

This round will be rated for participants of Division 2 with a rating lower than 2100.

We would like to thank

The score distribution is $$$500 - 1000 - 1500 - 2000 - 2250 - (2500 - 2500)$$$.

We hope everyone will enjoy the round!

UPD 1: Editorial

UPD 2: Congratulations to our winners and first solves!

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

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

As a tester the round is delicious palatable luscious mouthwatering delectable toothsome succulent juicy dainty appetizing inviting tempting piquant.

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

As a tester, the problemset is even better than pokémon diamond & pearl

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

As a tester, I can confirm that this will be the first div 2 round of 2024.

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

As a tester, the round is delectable.

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

As a tester, this round is certainly an amazing round!

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

As a tester, I think this round is very interesting and problems are very cool :)

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

As a tester, the round brought positive curvature into my life.

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

It clashes with COCI :(

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

As a tester, this round is certainly a round.

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

Hope to reach cyan rank

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

exited......

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

Fully prepared to drop back down to specialist

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

It is first Div.2 round in 2024.

I hope this round is fun.

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

$$$5000$$$ score Div2F is 💀

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

Hope the problem statements are as long as this blog post

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

damn they prepared it 2 month ago?

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

Wont this round be based on (or coincide with) BelOl like last year same time? Asking just in case, cuz took part

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

I just wish to solve A-D this time.

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

As a participant i will try to enjoy the questions :)

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

I hope my brain don't lag at the time of contest and I am able to give my best in this winter season without my hands getting freezed :)

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

Looking forward to crying in a fetal position after round ends

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

I'm a freshman,I want to know how difficult div.2 is?if it's possible for me to become green?

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

    You have participated in Good Bye 2023 and Hello 2024 — the difficulty should be comparable to those (except that the very difficult last problems are missing here, but that won't affect you).

    Is it possible for you to become green? Yes. But is it likely? Probably not. I see that until now, you've only gained rating from contests. Remember that in some contests you will lose rating and you shouldn't get demotivated by it. But anyway, good luck, hopefully you perform well!

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

As a participant, I want a positive delta :3

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

Do you know why others (mathematicians, physicists, chemists and...) doesn't have such big communities like codeforces?

Because we didn't make one for them...

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

My Gut tells me it will be a good contest >⁠.⁠<

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

Hoping to get better at problem solving. Will try my best.

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

hope to solve 5 problems this round!!!

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

Hopefully the problems will be short and precise just like the announcement

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

As a participant I hope I get non negative delta.

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

(Wait this might be the shortest announcement I have ever seen.)

Hope I can enjoy this round!

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

Hopeful

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

How to become a tester? I am new here and would definitely appreciate the help!

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

Was feeling alone without cf contest ;

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

Worst contest in a while! Congrats, it is quite an achievement to surpass gb2023!

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

Wtf is rainboy doing? Why doesn't he solving first three problems after solving the rest??? Somebody explain this to me.

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

Enjoyed the problem set.

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

Weird problems, not as good as should be

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

need to improve debugging skill

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

Thanks for contest, I really liked problem $$$E$$$!

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

One of the best rounds in a while

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

why the fuck are problems made so that contestants have to handle overflows during contests

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

NOOOOOOO! I just finished debuging the F1 samples!!!

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

Any ideas for D?

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

How to do C?

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

Problem D test 7 ))))))))

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

Most enjoyable round since I can remember.

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

Why is D considered an original problem? Isn't it a very simplified version of persistent treap (cartesian tree)?

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

A really interesting round <3

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

For C, I had to ask ChatGPT because I had no idea how to determine if we can make the subarrays equal. Well-known maths are too hard for me.

https://chat.openai.com/share/f7668e07-29c9-4963-9140-d6d963858131

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

https://codeforces.me/contest/1920/submission/241485816 All testcases are passing on vscode but not on codeforces

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

    Where is #include <bits/stdc++.h> using namespace std; ?. I think you forgot to copy smth.

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

    Next time I recommend using the flags -g3 -fsanitize=address when compiling your solution as it will halt your program when it gets stuff like address boundary errors, that is, your program tried to access memory you have not allocated. Without these your program will peform undefined behaviours, which are very unpredictable, and sometimes it will give you the illusion of a correct solution.

    Notice that in the for loop when calculating the answer at line 42 you have i >= n - 1 - k. In the case of $$$n = 1$$$ and $$$k = 1$$$ you'll have at some point $$$i = 1 - 1 - 1 = -1$$$, so you'll try to access the vector pref at index $$$-1$$$, which is undefined behaviour, and can have any value depending on how you compile the program. That's the reason for the wrong answer.

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

I got memory limit exceeded on D ( https://codeforces.me/contest/1920/submission/241477487 ), but as far as I can tell, my solution uses O(n + q) memory, which I assumed would be fine. Is the issue that I was using python, or is O(n + q) memory too much (or does my code actually use more than that)?

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

amazing contest, I enjoyed a lot solving problem D!

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

I was so close to solving my first DP problem during a contest.

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

Good contest, problem C was interesting

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

why it gives wa ?? 241464609

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

Can anyone tell me why i can't change my handle name?

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

A.Maintain a minimum and maximum variable for operation1 and opeartion2 respectively and for operation3 make a vector of numbers that we can’t take. Now the problem converts into the count of numbers that is between min and max and not present in the vector. we will check how many numbers are in the vector which is between min and max we can’t take these. Then the answer is (max-min+1)-the number of elements in the vector between min and max.

B. The first intuition is that if Alice has to remove some k1(0<=k1<=k) element it will remove the biggest element in the array so that Bob can’t make them negative or Bob will multiply -1 to smaller element. Now in the shorted array, we can check for every k1 (0<=k1<=k) alice will remove the last k1 element and Bob will multiply -1 to the last x remaining element in the shorted array and we can calculate this sum using prefix array(Dp) in O(n).

C. We can divide the array into n/k segments of length k, here k is the divisor of n. The count of possible numbers k will be in O(n^1/3). Now for every k we have to check if there is any m>=2 for which updating the array a[i]%=m makes all the segments equal. For some k we have to compute some m for which 1st,2nd…. kth element %m of every segment equalise. we can represent all first elements like a*m+r, b*m+r, c*m +r…… . We can see that if we pair-wise subtract the elements of the first position we will get some (a-b)*m, (c-b)*m. here we can see that m can be the gcd of all elements or divisor of gcd of all elements of 1st,2nd,3rd…. positions.There may be different gcd of different positions, but m can be the divisor of gcd. so we will again take gcd of all gcds on different positions.we will check if gcd that is m>=2 or not. we will count these numbers and give the output.

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

Problem C has weak tests. This submission passed with 140 ms, but it's clearly too slow and should have exceeded time limit. I was able to hack it with a simple test where N has many divisors and all elements are the same, except for the last one.

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

There is a bug in Problem F2 tags, there are double Binary Search and Data Structure tags. (The bug exist when I'm writing this comment)

Tags

Note: Today, the bug has fixed.

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

I don't quite understand how it is possible that three accounts handed in all the tasks at the same time (with a difference of a few seconds, and the solutions were handed in exactly the order in which the participants are in the table), and as a small additional detail — their nicknames are from the same subject.

Task / LeviAckerman1945 / NarutoUzumaki1579 / ItachiUchiha8569

A / 241427625 / 241427527 / 241427718

B / 241440017 / 241439964 / 241440092

C / 241448078 / 241448021 / 241448153

D / 241454923 / 241454872 / 241454992

All these solutions are similar in style, but contain different initialised classes and completely non-obvious solutions. It looks like bypassing the anti-plagiarism system. Could it be cheating?

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

I wish I got a -9 so that I can farm the div. 3

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

How problem B could be solved if array elements are allowed to be negative as well ?

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

Can someone tell me why is this failing on some hidden case ?241532507 I'm calculating the prime factors of N and then checking for each prime factor if it is a valid divisor or not. If it is possible for some prime A then for all multiples of A which are also divisor of N should be valid. Is something wrong in it ?

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

What will be the Rating of C? Great Contest BTW

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

Thanks for the interesting problems!