Привет, Codeforces!
В воскресенье пройдет Московская олимпиада школьников для 6-9 классов. Олимпиаду подготовила Московская методическая комиссия, известная вам также по Московской командной олимпиаде школьников по программированию, Открытой олимпиаде школьников по программированию, олимпиаде Мегаполисов и всероссийской олимпиаде имени Келдыша.
Мы рады пригласить вас поучаствовать в Codeforces Round 1078 (Div. 2) на основе задач олимпиады, который состоится в 08.02.2026 12:05 (Московское время). Обратите внимание на нестандартное время начала раунда. Раунд будет проведён по правилам Codeforces и будет рейтинговым.
В связи с этим мы просим всех участников сообщества, участвующих в соревновании, проявить уважение к себе и другим участникам соревнования и не пытаться читерить никоим образом, в частности, выясняя задачи у участников соревнования. Если вы узнали какие-либо из задач МОШ (участвуя в ней лично, от кого-то из участников или каким-либо иным образом), пожалуйста, не пишите раунд. Участников олимпиады мы просим воздержаться от публичного обсуждения задач до окончания раунда и официального тура олимпиады. Любое нарушение правил выше будет являться поводом для дисквалификации.
Задачи соревнования были придуманы и подготовлены silvvasil, Semen07, allvik66, dope, teraqqq под руководством TheEvilBird, grphil и Андреевой Елены Владимировны.
Спасибо FairyWinx за координацию раунда и помощь в подготовке задач, а так же MikeMirzayanov и KAN за системы Codeforces и Polygon, которые использовались при подготовке задач этой олимпиады.
Также выражаем благодарность:
t.ravnushkin, KiKoS, didedoshka, feblokas, makrav, blook, zhiganov_v, lewc, gmusya за тестирование задач олимпиады.
__baozii__, _istil, ArSarapkin, fishy15, PvPro, madlogic, -firefly-, FelixArg за тестирование задач раунда.
RP-1, stepanov.aa за подготовленные задачи олимпиады, которые не вошли в раунд.
Разбалловка будет объявлена ближе к началу раунда.
UPD: Разбалловка: 500 — 1000 — 1750 — 2000 — 2500 — (1750 + 1750)
UPD: Так как раунд проводится по очной олимпиаде, то просмотр чужих посылок и дорешка будет доступна с 12 по UTC.
UPD: До 13 по технических причинам.
UPD: Разбор









ожидается животрепещущая комба от александра бабина❗❗❗
А хромой чекер будет ???
Hope to become expert again:)
It's Russian contest ^_^, don't even try it. You will stuck on A).
It's Russian contest... for schoolchildren
Never underestimate the schoolchildren :)
In USSR first-graders solved these problems
am I so dead tomorrow?
Its not even russian contest, it is russian olympiad problems, i solved some of them and usually they are to tough for div.2 so this round is unlikely to write for rating.
Nah man I went through some problems I am away from my laptop rn but questions aren't that tough just basic mathematical manipulation will get my laptop tomorrow morning let's see if I can +
Anyways, I slept through that
I aactually read moscow as mexico, now i just realised what have i gotten myself into
same lmao
Good luck!
AS a beginner it is normal.(not too easy and not t0o hard)
no rated div.2 testers for a div.2 round?
CMs are rated for div 2, so there is one rated div 2 tester
oops, my bad
Hope to become master again:)
Why did you break your streak of solving yesterday :(
GLHF!
Надеюсь E не будет ДП на подсчеты.
orz
Hope to be pupil! :( --> :| --> :)
hope to reach CM
As a femboy, I hope to become an femboy expert!
Is it really okay to say this kind of thing on a public online platform?
Yes.
May I ask, does the 'yes' here mean you agree with what I said, or...?
Because my English is very poor, especially reading comprehension, after all, I am still in elementary school.
Umm, for you maybe this is not okay. But better to don't say to others: I'm a femboy! I can say that i don't see this soo bad or something else, thats normal to be gay, femboy, and a simple person.
I'm really sorry, my computer was taken away by my mom, which is why I'm only replying to you now... Um... I think your advice is great, and I totally agree.
No worries.
It says that cf would be down 5 minutes before the contest for me
Are you Chinese?The blog here says it will start at 17:05 UTC+8 not UTC
Hope to become expert again!!!
Hope to become expert again!!!
Please pay attention to the abnormal start time.
Yes! I thought the starting time was supposed to be 2:35pm UTC (my codefolio app setted an event to my calendar to that particular time). Did it get re-scheduled?
Looking forward to being goomba stomped
i got goomba stomped
warioooooo timeee for the contest
Like all rounds "based on Moscow Olympiad" I expect $$$-1000$$$ contribution even before end of the contest.
Удачи! Люблю всех
My first contest. Hope to solve at least one problem.
us bro
same here
My second contest,wish me high rating
SpeedForce A and B
It was supposed to be round where I get blue, but I got magic 10 extra points from somewhere (So it's round where I lose blue to tasks for 14yo's instead)
Generous scoring, don't you think?
isn't the scoring little bit surprising ? :)
Easy F1?
All my submissions have been skipped ever since the beginning of the round for seemingly no reason, what gives?
That means you got caught cheating at the beginning of the contest. Congratulations, I guess.
And do you have any proof of that? Rhetoric question because there can't be any proof that I cheated since I didn't.
I think E is too easy to be an E.
Yes.
Even more so the scoring. F1 is so much harder than E
F1 is too easy to be F1 too
rubbish problems
E 2500 and F1 1750 is crazy
i can't believe my eyes when i see that
Is D CHT ?
greedy solves it
you want to split x = totalsum/2 (this maximizes a*b)
go down while you can (accumulated row sum does not exceed x) and then go right to get the missing elements
ohh , i c . we can adjust from the down and left the simple L shaped boundary to achieve it
ImplementationForces
ImplementationForces
Isn't $$$D$$$ just implementation of the border? Because $$$(cnt / 2) * (cnt - cnt / 2)$$$ is always achievable?
yes
Fuck :(. I was thinking of DP. Too late by the time I realized this :( So sad rn.
also i have implemented DP solution but 4 minutes after contest
Same. Let's see if it will pass. The bitset DP.
yes i am waiting for when we submit the solution for problem
exactly, it is always achievable
I actually guessed that, but anyways tried dp and failed.
I was confused by your statement. Then I realized that I assumed a = number of ones, and b = number of zeroes, on either side. This would involve two dependent variables and make the problem much, harder.
is F2 FWHT?
is F2 FWHT?
Yes. In F1 you can always FWT and iFWT in DFS, but in F2 you need to avoid doing these in DFS, by implementing single-index addition and query on FWT results.
In F1 you can just do nested (1 << k) loops in dfs
Yeah some O(n 4^k) solution might work for F1, but I havn't tried it.
But the main difficulty of the task is to store the dynamics without causing a inverse transformation and only do it at the very end
The XOR FWT can be defined by the following expression:
where $$$i \circ j = (-1)^{\operatorname{popcount}(i \land j)}$$$. Using an XOR linear basis, each value can be uniquely represented, which reduces the overall transformation to a series of single-index additions and queries. To do these, you only need to iterate all 2^k positions and add/subtract by checking $$$\operatorname{popcount}(i \land j)$$$.
any hints on F1 and F2?
F1: Let's root the tree at any vertex. dp[v][msk] = # of beautiful sets (excluding the condition on the component of v) on a subtree rooted at v, such that XOR of vertices not in the component of v is XOR of all b[i] for set bits i in msk. Transitions are XOR convolutions.
is it FWHT ??
O(n*4^k) passes, but you could optimize it with FWHT.
Spent my whole time trying to solve D using DP... but it turns out to be a greedy problem :(
Same, I was thinking of DP too.
yeah, I skipped C, spent a lot of time to solve D with DP, at the end went back solved C but got not much point as it was later in the competition, and the last 30-40 minutes did nothing as I didn't have success at D earlier.
How to do C.
iterate over all divisors of n and you can easily detect for each divisor i if it is possible to construct a string with informativity i.
Store, all the candidate lengths that a repeating string can have. As, it must be divide n, hence, we will get at max. 192 different candidate lengths for any string. Now, we can just brute force them and the first smallest valid length will be our answer.
Code : 361971199
For each factor of $$$n$$$, check by brute force whether it is a feasible cycle length.
Why set problems like this? It’s a total waste of my time.
A question was a real pain in the ass.
Why my solution fails for C https://mirror.codeforces.com/contest/2194/submission/361992869
The questions were Good I was only able to solve 2! How to solve C!
361978428 why WA? i feel like the reason's obvious but i can't seem to find it
int overflow
Thanks for the round ! Congratulations to the setters/coordinator,
Here is my feedback about the problems
Ok.
It was kinda unclear that you could only transfer exactly x rubles. The problem is ok otherwise.
I think it is much better than the average 2C (it felt more original than an 1e9-th binary search problem)
I think it is a cool problem but it's way too standard. Maybe it would have been more suited for an Educational Round (but since the round is OI based, this problem makes sense in an OI perspective).
I liked the subproblem "compute the best path that skips cell (i,j)". I never saw it before so I felt enlightened by the problem. It seems that it might be well known/standard according to the solve count so idk...
didn't try it yet
first contest ever, got absolutely destroyed :sob:
When can be upsolve,it is 12:00 UTC.
Until 13:00 UTC due technical reason (
Cool.
I'm still not able to upsolve
I think everyone who solved C but not B (like me) did so because they assumed only adjacent banks could transfer money to each other.
Oh yeah, I managed to upsolve E
D is to easy to be D , It is hardly a 1500 :\
D appeared to be a standard question but got no idea about C.
Can we have an extra registration time from the start of the contest instead of 10 minutes after the start? I had to wait for 10 minutes since I forgot to register.
Hope my poor English can make you understand.
The
Notein problem B was intentionally constructed to make you overcomplicate the problem @.@when will the ratings be updated
Why is it still not possible to upsolve problems?
Isn't 13:00 UTC passed already? Why is still upsolving not possible?
На этом раз задачи былы легчее честно. This time the tasks were easier, honestly!!!
bvbcbcvbc
bvbvbvcvbbvc
Good round!
Why I can't view other solutions?
can someone pls get me a proof on B[problem:2194B] i just guessed it looking at the number of solves
why isn't making the values multiples of n isn't helping the answer to get any better??
105512D - Последнее испытание seems familiar, doesn't it?
I need help to find the test case for which my code fails (problem D). Let me know if anyone finds it.362024569.
Any hint for problem E?
Any hint for problem E?
Any hint for problem E?
can anybody tell me where am i wrong for question d?? >>>>
Your handling of the first row case does not look right, you want it to work the same as the other rows. Consider a one-row case like "1 1 0".
Any idea when will the submissions get unlocked?
It was a pretty smooth contest, and my rating up.ヾ(≧▽≦*)o
This was my first contest. And i am a newbie now. ( ̄︶ ̄)↗
^_^
Hello, I received a similarity warning for my submission for problem 2194E.
I would like to clarify that I solved the problem independently during the contest. I did not view or share any code with other participants, and I did not publish my solution anywhere. The approach I used is a standard Dynamic Programming solution, so similar implementations may naturally look alike.
I am fully willing to provide further explanation of my solution if needed. Thank you for your time and consideration.