Привет всем участникам платформы Codeforces! В эту субботу состоится студенческий финал BSUIR Open XIII, а вместе с ним пройдут раунды Codeforces Round 1021 (Div. 1) и Codeforces Round 1021 (Div. 2) в 26.04.2025 11:35 (Московское время) по задачам этого тура. Обратите внимание на то, что раунд стартует в необычное время.
В этом году задачи для раунда и олимпиады готовили teraqqq, FairyWinx, Kirill22 и wilcot; в каждом раунде будет 6 задач, и у вас будет 3 часа на их решение. Отметим, что wilcot уже не первый год составляет задачи для BSUIR Open и привлекает новых авторов к участию в этом событии. Мы считаем, что именно благодаря этому в этом году получился разносторонний и интересный студенческий финал из части которого получилось составить раунд на codeforces.
Выражаем особую благодарность MikeMirzayanov, geranazavr555 и KAN за замечательные системы Polygon и Codeforces! Также выражаем благодарность:
- Artyom123 за координирование раунда и привлечение тестеров;
- arvindf232, A_G, N_z__, jtrh, __jk__, reirugan и larush за тестирование раунда;
- Golovanov399, SomethingNew, allvik66, golikovnik и OG_Matveychick1 за тестирование задач олимпиады;
- i_love_gold_and_nt, Gornak40 за помощь составлением условий.
Отдельно хотим сказать спасибо людям, благодаря которым состоялся BSUIR Open XIII:
- Великовичу Владимиру, Швед Елизавете, Внук Ольге, Юрченко Ольге, Гороху Андрею, Макаревич Дарье и Севрюкову Степану за организацию чемпионата;
- Удовину wilcot Ивану, Марковцу Роману, Байтасову Ринату, Ромашевскому Герману, Бутоме Виталию, Любашенко Андрею и Ситникову Алексею за подготовку задач полуфинала;
- Ефимчику Александру и Адарову Дмитрию за техническое сопровождение чемпионата;
Чемпионат BSUIR Open уже который год проход в стенах БГУИР. Каждый раз организаторы мероприятия вносят что-то новое, уникальное и незабываемое. Благодаря ним BSUIR Open уже который год радует участников дружеской атмосферой, интересными задачами и приятными подарками!
UPD. Разбалловка задач:
Div 2: $$$500 + 1250 + 1500 + 2250 + 2750 + 3250$$$
Div 1: $$$500 + 1000 + 1500 + 2000 + 3000 + 3500$$$
UPD2: Разбор









As a tester, I observe that the problems were prepared by a tsundere and a chuunibyou, which certainly does make a combo for preparing rounds.
P.S. look at their profile pictures :)
Kurisu is the best waifu in the world. I've only met girls like her a few times in my life. But she's truly the type I'd feel comfortable living with, and it's girls like her who inspire my creativity.
You don't love Kurisu, you only love kirill22...
I love Kirill22 as a friend, a brother, and a family member. Though I wrote above about romantic relationships, this is something different.
Shoutout to kirill22 for being the MVP drinking partner. When I’m staring down 30 shots, he doesn’t hesitate to take 30 himself—that’s loyalty.
Yeah.Tsundere is peak.Mid-2th Disease is peak
I wish we could have a
When the score distribution will be updated?
Since there are only 6 problems and 3 full hours to solve them!!, I'm assuming the scores will differ by a big margin with each-other.
It will be one of the breainstorming rounds.
Yeah. Hope to solve ABC. Though C is going to super tough i think.
I assuming score distribution for ABC will be like : 500 — 1000 — 1750.
Maybe is 500 — 1250 — 1750
Please make a note about unusual contest starting time also.
I'm waiting for score distribution too.
Score distribution?
Will round be rated?
Been training myself to wake up at 4:30 am for next 2 rounds. Can't wait to drop back to purple.
It's normal for the challenge to feel tough, especially waking up at 4:30 AM.
Even if you drop back to purple for a while, you'll come back stronger.
Focus on the journey, not just the result — the grind will pay off!
Brother you become pink in just 2 month and you solved almost 500 problems in a month orz!. Any tips do you like to share ☠️
Thank you for your kind words!
I’ve been focusing on consistency and targeted practice—solving problems from various topics and revisiting weak areas regularly.
Virtual contests and upsolving helped a lot with speed and accuracy.
I also try to analyze editorials after contests, and I keep track of mistakes to avoid repeating them.
Staying disciplined and setting daily goals made a huge difference.
Wishing you all the best on your CP journey!
Bro couldnt even resist using an LLM to generate his response.
Just learn OCaml and get free rating.
Sorry to ask, but does the scoring distribution indicate the toughness of the problem? I've never really paid attention to this.
Generally a large score gap between problems indicates the difference in difficulty is also large
rated?
This is the first time I see the starting time of contest is 6 hours earlier than usual contest
ABC would seal the deal for many of us.
6 problems, 3 hours. seems hard contest
The score distribution suggests that this contest will be good for fast solvers. Many users will solve three problems, and the fourth one will be critical, as it has a 2250 score, so those who solve the first three fast will be in a better rank.
Best of luck to all(me included).
just 15k people?
Why no extra registration?
Why no extra registration?
+1 :(
the questions were terribly worded!!
wat the fox with the statement of problem B in div 2? terrible
Can't get to understand B at all.
bro i am not able to understand B. The explanation is really bad...
me too i cost 5min to read and 2min to solve
i want to know if it is allowed to use chatgpt to provide a clear problem meaning during the contest, so that i wont waste so much time reading in B and C
Bro you solved B in 9 min over an hour ago and now you are asking about using chatgpt for "clear explanation" ? sounds sus to me
cause B is easy for me, the hardest point for me is my first language is not English and I cant read problems well
But you pulled it off in 9 min and me here can't get to understand B despite english being my second language T_T
problem b is L
I can't understand the problem statement, it's a terrible experience.
Is it only me or the questions are terribly written?
its terribly written!
I understood B after 60 minute.... Dont know how to solve! :(( after asking them 4 questions too. I am crying
I think my english comprehension skills have gone through the mud.
I think my english comprehension skill have been dragged through the mud today.
RIP people from div. 2
Also post a separate editorial on how to comprehend these questions.
Уничтожить учетную запись DocinhoS is cheater. skipped: https://mirror.codeforces.com/submissions/DocinhoS/contest/2070 Strange submission from edu round: https://mirror.codeforces.com/contest/2043/submission/298277798 and there are more like this. Suspicious submission times today. Ban account.
Even bro's profile picture is AI generated LOL
problem b is cooked... still can't understand what it is trying to say...
It took me an eternity to understand the language of div2 B problem but just a minute to write the code for it : (
Problem B was hell. Took 1 hour to understand and 3 min to code.
LanguageForces
It is so challenging to understand problems B & C. Problem statements are not clear and example explanations are poor. It took me a significant amount of time to comprehend how the samples produce the specified results.
UnderstandingForces ... spent time understand what is happening in B
that also made me overthink and difficult in C to understand
oh no.. I found problem E tempting and wasted all my time there ...and I didn't attempt D
I thought E was some diophantine equation kind of thing, but couldn't fully solve it :P
text-understanding-speed forces
true, this is speed forces .. because so less people solved D so speed forces till C
In problem Div2C, how its possible for Vadim to guarantee success in testcase-3?
5
2 4 3 2 4
B = bus, T = telescoping bridge
First day 2 student: 3 = B, 4 = B Second day 2 student: 3 = T, 4 = B day 3 student: 4 = T, 5 = B First day 4 student: 5 = T, 6 = T Second day 4 student: 5 = T, 6 = B
If day 4 is B, we win (with one of the day 2 students). What if day 4 is T? Then we only need Day 5 = B to win with day 3 student. What if day 5 is T? Then we win no matter what day 6 is (with one of the day 4 students)
what about this case when the actual mode for following days are-
Day3-T
Day4-B
Day5-B
Day6-B
sorry, had an error in my answer. I just edited it, it should be correct now
say the two choices for a day are 0 or 1. on day 2, give two predictions 01, and 11. if any one of these is true, good, else both are false, both being false means, on day 4 it's 0. so on day 3 give prediction 01. if it's true, good, else it means, that it is 0 on day 5. so on day 4, give two predictions 01 and 00. atleast one of them will be true, if all previous predictions were false.
at day 2 give predictions like that:
AB
BB
at day three one of the predictions are true so far, for the day 4, both of the predictions are B. so if at the day 4, B happens you've got at least one right prediction. but B may not happen so you give prediction like that in day 3 ( to predict day 4 and 5 ):
AB
then at day 4 you can specify these predictions:
BA
BB
so 2 affects (3,4) ... 3 affects(4,5) ... 4 affect (5,6)
bet (a,b) -> (x,y) means a takes x-th way and b takes y-th way .. where x,y can be 0 or 1day 2 -> so I can bet (3,4) -> (0,1) and (3,4) -> (1,1) .. note that i bet 4 as 1 in both cases ... so if I win here we are done else I know for sure that 4 can't be 1
day 4 -> same thing I can do for (5,6) as it also has two occurrence .. and I will have a definitive answer for 5 if I loose...
so now I have correct answer for (4,5) which I can bet on day 3
On day 2 bet 00 and 10 if day 3 is a zero he wins
day 3 bet 10 since any 0 is a win the only lose is 11
day 4 bet 10 11 we cover all possible loses thus we win
on day 2 he makes 2 bets say he makes the following bets
2-a bus 2-b bridge
these are for the transportations of day 3 atleast one of them will be correct on day 3 he makes one bet with one person for the happenings of day 4 and 5
lets say he makes a bets saying day 4 has bus transportation with they person of day 3 then he will make a bet of bridge with the 2 people from day 2 for the transportation of day 4.
so atleast one person is sure to clear day 4 bet in the worst case it will be the person from day 3.
now on day 4 he can make 2 bets so lets consider day 5 now we know that the guy from day 3 has made it to day 5(or else someone from day has already cleared the required on day 4)
if he makes a bet of bus on day 5 with the person from day 3 he will make a bet of bridge with the two people from day 4.
so if its a bus on day 5 the bet with person from day 3 was correct and we are done or else in the worst case its a bridge and the two people from day 4 clear day5 and enter day6
now there are 2 people and a single day so he can make two different bets for that day and win
Div 2 problem B was a nightmare. I was using a static version of this website and did not see the post on problem B until I logged on to the main page, costing 1 hour and 30 minutes of contest time to be lost. I hope that next time the authors can put a little more time into making these problems, and clearly explain the ambiguity on the problems before the contest starts, thanks.
how to solve D? I tried making a graph that only included cells belong to at least 1 path, but wasn't able to calculate the answer from the graph
It's DP right? we should be able to track how much flows from the previous known cell to the next known cell, then accumulate the fraction after everything... But I was not fully able to implement it in contest. Very interesting problem!
was thinking about DP but wasn't sure, especially since later cells can actually reduce the answer compared to previous cells. admittedly I am terrible at DP so I didn't think about it too much XD
Add a new tag named Reading.
Bro what did I do in recent 3 hours :(
Wtf is 1C 1D?
My fav for this year for sure.
Is it really
C: crt&implementation
D: matrix rank calculating?(or see if two matrices have the same column spaces)
And 1E
and 1B
if problem doesn't seem hard enough make problem statement harder to understand. simple :)
My solution for failed on 4th pretest..I am storing the frequency of every element and sorting them in ascending order then I am checking the frequencies of consecutive elements.. Am I missing any other cases here?
what about the case 1,1,2,3,4,5,6,7,7?
means the frequency is like 2,1,1,1,1...,2!
this should give yes!
How?
lets say
B -> bus, J-> Jett test case: 1 1 2 3 4 5 5 for the freq 2,1,1,1,2
lets say you pick BJ,JJ for the first two student. lets start the guessing from day 2. now if its wrong, it must mean the remaining possibilities are JB,BB. so the 2nd guess it must be B. so now for the next student where the freq = 1, you pick BJ now if its wrong then you know it was BB!
now for the next student you pick BJ and if you are wrong it again means the last guess was incorrect so it was actually BB. or if pick BB and doesnt match with the student then actually it wasy BJ.
now it goes on and on for the sequence of 1's in the frequency.
now if there is 2 student after some 1's then you know for the last 2 students,
you can choose the guess as BJ or BB if you know the first guess is B. it must match with one of them.
so the solution is a sequence of 2-1-1-1-1...2 or 4 student one a single day. to cover all the 4 possibilities.
Can you tell me what will you exactly guess for 2 1 1 2?
i suppose the testcase for this is
1 1 2 3 4 4
so 6 students.
my guess for
st1 -> BJ
st2 -> JJ
st3 -> BJ
st4 -> BJ
st5 -> BB
st6 -> BJ
so the guess at once seems like: if it dont match with st1 and st2 then for st3 it must match his first day. but his second day there is two possibilities. so i pick one. and if that doesnt match then for st4 the first day must match. again there is Two possibilities. but this time i've two guesses for a single day. say i pick both of them for different students. so there must be one win.
Worst Div2 B,C in recent times
why so negative... B not the most intuitive but can be solved in like 10 lines
can you provide the proof of this?, seeing the code will not help to understand.
My intuition is if you want your house to be central, you destroy the central neighbors...
So the free land is the central/good location for ur house.
Worst contest which I gave till now!
In question C (Div 2) for input — 5 2 2 3 4 4
could some tell me what would be the output ?
"yes"
just sorting it gives us -- 2 2 3 4 4 5
For any 2 elements with frequency >= 2, if all the elements in between have a frequency of 1 then the answer is yes. (There should not be any element with frequency 0 in between)
So 2 2 3 5 5 fails, 2 2 3 4 5 6 6 works
2 2 3 4 4. this is the input, 5 was just for n=5.
the logic I told you remains the same. 2 and 4 have frequencies >= 2 and all the elements between 2 and 4, i.e., 3 has a frequency >= 1 so this case passes.
problem C was way easier than B. but it had many cases to consider, i cant believe i submitted 5 time.
got WA on i'th pretest on i'th submission for 1<=i<=4. and finally AC on 5'th. lmao
after taking my time on C.. I figure two kind of cases
exactly. but at first i thought there is only two possibilities:
i didnt know the second case could be expanded by day count == 1 in between...
I also did something similar and then submitted to see if I am correct but I was wrong ha ha ..
then I figured out correct logic second time
What a bad description
Insanely quick system testing
Also, does anyone think problem A is weird for only having 1 pretest
I think maybe because less people played this round.
This night contest and the last night contest were both so bad. Everytime I do one, I wish I just went back to sleep
Absolute bad problem description for B!! Please do something to fix this in future rounds.
Why does sorting and calculating ranges based off medians if the all windows of size $$$n - k$$$ not work?
I know the contest gone to be shit when I see the contest announcement photo full of pretty faces.
problem statements for both b and c were really vague, on top of all of that, 2d and 2e had a really large gap both difficulty-wise and knowledge-wise. talking to someone who solved 2d, I didn't even know some of the things(e.g. gaussian elimintaion). I had a solution for e using some magic with crt (i don't know if it even works), still geometry&crt for a 2e is too much in my opinion.
.
Do you really like geometry and linear algebra?
please all downvote this contest
Edit:Task achieved
no please don't
how to solve D ?
Separate the squares into connected components, where two squares are in the same component if there is an overlap in possible paths. If x1 != x2 and y1 != y2, you can just connect (x1, y2) and (y1, x2). Otherwise, there is only one possible path (we will call these "lines").
For a connected component, you need to fill in K edges and you will have either K + 1 candidates or K candidates. If you have K + 1 candidates, you multiply res by K + 1 (since any deviation would result in the rest being fixed, and there are K + 1 spots for deviations). If you have K candidates, you multiply the result by 2 unless the component contains a line. If you ever have less candidates than edges, you can just return 0 since it is impossible.
in c div 2 problem I covered cases when
frequency is 4 then yes
or 2 (zero or any number of ones) 2 and all of them should be consecutive
what cases I am missing ?
it is (>=2)(zero or more ones)(>=2)
yes I did it like this
fails on this case .. you should try to debug
the answer is
YESThank you
D2B must be the worst worded statement I've seen.
Without a doubt, yes
How to solve div2 D ?
How to solve Div2 D?
For C, don't use collections.Counter, (it won't pass)
mine passed with Counter
try not sorting before Counter)
I got FST-ed once with Counter, and lesson learned.
Not sure about this contest. But I'd rather use something else just to be safe.
what is wrong with python..
i got FSTed in the last div3 because i used sets apparently
now apparently even counter is no good
recursion dp never works
As a Pythoner:
soo, it's related to how hashmaps work in Python,
interestingly
and this passes
there is something with hash collisions, need to investigate a bit more.
I think Problem B in Div2 is either wrongly translated or was not correct !!! i solved it in a way to -> find maximum Houses he can buy while he can remove atmost k bars having minimum f(x)
I think there was a problem in the problem Baggage Claim in python3, I don't think there was a way to solve it fast enough, If any one nows how, please let me know
Use pypy3.
it worked!!!!! amazing
Hitting Master without knowing about pypy is funny. You should almost always submit with pypy instead of python3.
what is the case where you should submit with python3?
I was being conservative with my statement. I do believe there are some differences with recursion (python3 may go deeper), however in general python or pypy recursion doesn’t work well on CF.
It is possible, my solution works in python3.
I think the Problem statement of B was either Wrongl Translated or was Incorrect !
bCOZ I Solved it in a way -> maximum houses he Can Buy while he can remove at most K bars having minimum f(x)
your method is correct
I tried to solve div 2-D. I used a 2d dp, with 4 columns, storing the possible combination for p1,p3,p5 ...etc for up, down,left,right. I mean p1[0] stores possible combinations of p2 when it is placed on top of p1.
For example, if P3[0] can exist, that mean p4 can be placed on top of p3, then dp[p3][0] = dp[p1][0]+dp[p1][1]+ ... [3] But then to remove the commons, we subtract all previous value of dp, that could be present there. I know it sounds complicated, But for example, we add all dp[p7] to dp[p9][0] that means top of p9, so now we find what other grids share boundry with the top block of p9. Suppose left of that is p3, so we subtract dp[p3][right] from dp[p9][0] and so on. I think my logic is right, but I spent 1 hours writing it's code , but did simple mistakes with x and y coordinates, and I rage quit. Is my logic correct?
Look at these accoutnes they literally solved the problems at the same time and their codes are almost the same and there are hundreds of such people on this contest. I have nothing to say:
this guy looks very happy
Too hard 2D/1B.
Hello all. Will you be able to help me with the reason of TLE for https://mirror.codeforces.com/contest/2098/submission/317312937. Thank you.
you are using unordered map m8 which makes o(n) per query worst case try using simple map
Tried with map it worked. Thank you.
https://mirror.codeforces.com/contest/2098/submission/317379439
Хороший контест, сложный, не обращайте внимания на чужие минусы. Мне понравилось. Я вам влепил плюс :)
Despite popular belief, I think this is a great contest with beatiful questions! Also, I would gain good rating so by definition, it must be a good contest!
Div2 B is the worst statement I have ever seen. We are supposed to guess the solution, not the problem.
agree++
The statement of div2 B is very poorly written and way too ambiguous on what we should take minimum over. I think this is caused by $$$f(x)$$$ implicitly depending on the selection of open bars.
I think the statement should have been written like this:
Let's call the indices of open bars $$$S \subset \{ 1, 2, \ldots, n \}$$$, such that $$$|S| \ge n - k$$$. Then define $$$f(S, x)$$$ as follows:
Find the number of $$$x$$$ 's ($$$1 \le x \le 10^9$$$) that satisfy
for some possible $$$S$$$.
Note: The original statement might mislead people into counting $$$x$$$ 's that satisfy
which is different from what's originally intended.
I think the concept of problem B and C was pretty good. But the author Couldn't make the statement clear and also the worst test case explanations ever. If the explanation were good then it could be better to understand the problems. __
I think this is the first contest announcement to ever have more than 250 downvotes. And the number is still skyrocketing.
I hope people will stop. Without the hard work of problem creators this platform would not exist.
-4617 btw
This is poetic
it's $$$-4618$$$ xD
Hi,Haruhi chan.I wonder why.Is it because Div2B's description is too confusing
is it unrated? if not how much more time it would take to update ratings?
Honestly I don't get it. Why people are downvoting announcement and editorial this much? Is it really just because of div2B statement?
For people like me Div2 B is itself medium to hard difficulty and you guys make it more difficult by making such problem statement which is hard to comprehend. It should be atleast easy to understand what the problem is saying right?
When you realize they have another round next week with same set of authors
But it will be 2 hours only, so the problems will be easier (I hope)
I personally enjoyed the problems even though I could only solve $$$1$$$ and D1B has a really cool solution. I'm unsure with how bad the statements are with D2B because it wasn't in my set. Upvoted!
I love how thought is the main player in 2B & 2C. And knowing from the score distribution that I wouldn't get past C, after the first hour I stopped and went out with my friends. Still the highest rank I've ever got in a Div. 2. So, upvoted =))
I think the statements were really hard to understand. I do hope that the preparation is improved. I comment on Div.1 problems:
A: The story is a bit hard to imagine. The chronological order (bet vs information) is not written. It is not written that Vadim can decide the students' bet.
C: I think two irrelevant paragraphs are too much.
F: I cannot think of a worse choice than lost buggages to represent flows.... The story is too strange to tell "found" means disappear. You should not create a flow problem and then try to hide by writing a random story. Also, in the Input section, "the minimum number of lost pieces of luggage that will be found on the $$$i$$$-th day in each airport." is simply wrong. For future readers: it means there is a edge from $$$(i,j)$$$ to $$$(i+1,j)$$$ with capacity $$$b_{i,j}$$$.
I cannot understand what div2B is asking at all. Glad the round was not combined
The problem's saying.. You can buy a house(let's say house numbered 'm') if you chose any number x, where x <= k, and close x bars, and then calculate the distance from your house to all remaining(opened) bars, will the combined distance be minimum among all the existing houses between 1st and 10^9th house? If it's minimum, then the m'th house is valid. Now we need to count the number of valid houses.
Lets take the 3rd test case for example.. arr = [6,7,9] and k = 1.
(.) Now, if we don't close any bars, then 7'th house is valid.
(.) If we close the 6th bar, then house number 7,8,9 are valid.
(.) If we close the 7th bar, then house number 6,7,8,9 are valid.
(.) If we close the 9th bar, then house number 6 and 7 are valid.
we can't close more than 1 bar at once(since k = 1) Hence, we can say that there are "4" valid houses, house no. 6,7,8 and 9.
So you mean if k = 2 then I'll have to check which houses are valid by deleting all the combinations of 0, 1 and 2 houses?
Yes, you're right.
Thanks for the contest. The problems were really new and educational to me :)
Why their contest of 3rd may got cancelled? Do anyone know?
Why today's round was canceled? I gave up my trip plan for this!