Hello Codeforces!
I'm glad to invite you to my first contest, Murasame's Contest 1 (Div. 2.5)! Whether you are looking to sharpen your skills or enjoy some interesting problems, everyone is welcome to join.
The contest will start at 01.16.26 17:50 (UTC+8, China Standard Time) and last for 8 days. There are 5 problems in total, with difficulty ranging from Div. 3 to Div. 2 (I guess). All the problems are authored by me.
Since this is a long contest, feel free to solve the problems at your own pace. I hope you find the problem set interesting and educational.
I would like to thank the following people for making the contest possible:
- You for participating in the contest.
This is an ICPC-style contest, where every problem has the same weight, and every unaccepted non-CE submission will incur a penalty.
Good luck and have fun!
About how to register: Open https://mirror.codeforces.com/contestInvitation/bbbb4ddb6f3fc3f77ea467a10a06e35181e87b5f, click "Register" on the right, then click "Enter" on the left to enter the contest.
UPD: statement for E has been changed
The previous statement was incorrect due to AI's misinterpretation during the statement translation. I manually fixed it and your penalties on problem E (before the fix) have been removed. Apologies for the bad experience.
UPD2: Congratulations to the winners
- 1st: meta-circular
- 2nd: dooglius
- 3rd: hardworkiskey_1308
- 4th: TheCodeDominator
- 5th: NPsolved.cpp
- 6th: WA_ON_TEST_2
- 7th: sidat
- 8th: KinaRight
- 9th: Patilaniruddha
- 10th: Pip
Editorial will be available soon.
UPD3: Editorial is out!
Check it here (pdf): https://file.murasame.site/shared/cp/cf/contest-1-solution.pdf








Auto comment: topic has been updated by Murasame-chan (previous revision, new revision, compare).
Overnight, a large number of user-created contests sprang up in Codeforces like mushrooms after rain.
That would be great if you add constraints
its at the start of the explanation
yay, first AK and first solves for B, D and E!
I really enjoyed this contest, thank you. I wish codeforces had official long contests (even if unrated), I think I like this format better than 2-3 hour contests.
Hi, for the second example in B, shouldn't it be -1? it's not possible to add anything to 2 such that the sum stays <= 3 while also making it divisible by 10. The given answer implies that the new number will be either 2+2=4, or 2+0=2 which are not divisible by 10.
Please correct me if I am misunderstanding something.
you should use X to replace a_i,making abs(X-a_i) smallest. In this case, you can use 0 to replace 2.
Ohh got it, thanks!
I wonder if Problem D can be solved using Python. I tried my best but failed. Hope someone would finally succeed.
After several attempts with Gemini, I managed to create a solution that works:
Naively converting my C++ solution to Python resulted in ~6-7 seconds for $$$n = 1e6$$$ in custom invocation, and my first few attempts at coaxing gemini to optimize it further did not improve that.
What finally made it work was using integers instead of tuples (my original C++ solution used
std::array<long long, 3>).To quote gemini:
Yet another reason python sucks, it feels like every time I use this language I discover another reason to hate it.
N.B. I don't actually know if what Gemini said is accurate, but I trust it to know more about python than me. And, the following program takes ~600ms vs ~4s in custom invocation when commenting vs uncommenting the
data.sort()line, so Python definitely is slow at sorting tuples:Thanks a lot! Changing the tuples into numbers is a great idea!
Auto comment: topic has been updated by Murasame-chan (previous revision, new revision, compare).
Auto comment: topic has been updated by Murasame-chan (previous revision, new revision, compare).
will there be contest 2?
There will be, but maybe after a period of time. Setting problems and preparing it may require a long time.