Hello, Codeforces!
The TG channel team @KogutIvanTutoring is pleased to invite you to participate in Codeforces Round 1043 (Div. 3) on Aug/21/2025 17:35 (Moscow time) — another Codeforces round for the third division. This round will feature 6-8 problems selected in difficulty to create an interesting competition for participants with ratings up to 1600. However, anyone with a rating of 1600 or higher can register for the round out of competition.
The round will follow the rules of educational rounds. Thus, during the round, the problems will be tested on preliminary tests, and after the round, there will be a 12-hour phase of open hacking. After this phase, all successful attempts will be retested on successful hacks. We have tried to create decent tests — just like you, we will be disappointed if many solutions fail after the contest ends.
You will be offered 6-8 problems and 2 hours 15 minutes to solve them.
The penalty for an incorrect attempt in this round will be 10 minutes.
We remind you that only reliable participants of the third division will be included in the official results table. As stated in the link — this is a necessary measure to combat unsportsmanlike behavior. To qualify as a reliable participant of the third division, you must:
- participate in at least five rated rounds (and solve at least one problem in each of them)
- not have a rating point of 1900 or higher.
Regardless of whether you are a reliable participant of the third division or not, if your rating is below 1600, the round will be rated for you.
The problems were conceived and prepared by part of our team: fstilus, EzikBro, KotlechkovEgor, Wileyne, Friendiks, Boodoochai, pskobx
Also, a big thank you to:
MikeMirzayanov for the Polygon and Codeforces systems.
Vladosiya for coordinating the round.
a.stepanov281005, AC_sahER, Proof_by_QED, cry, fangcy for orange testing of the round.
_IVON_, Gmacem, Escapisst, macaquedev, ego_death for purple testing of the round.
EnigmaEon, margothequeen, semwin2008, Yassia, Pistol_Engineer, EduardoBrito, radodododo, Onomui for blue testing of the round.
Art10em, MrYhatoh, dragoonSlayer for cyan testing of the round.
mlovbnee for gray testing of the round.
Good luck to everyone!
UPD. Editorial is out!








Good luck to everyone, there's no FSTs in this contest!
yo guys, can you help me back to positive contribution?
for sure, mister. it is a pleasure to help u with my 5 codeforces accounts.
good contest :)
Ronaldo goat!
:)
Well,I have a flight tomorrow morning.So I am thinking about should I have this compitition.
my streak for positive delta would end after i reach specialist for sure or even higher!!!
hope this is the last div.3 i officially participate in
I just want +ve delta 🥲
edit: why am i getting downvoted???
why do people downvote your comment??
why do people downvote my comment...
Because, you are dumb
Hello, I participate for the first time in a competition , I didn't even know codeforces existed before today and I look forward to compete. Thanks, good luck to all.
[DELETE]
Yes, as I said I am new to codeforces so I didn't know how to use the submitter. How can you deduce that I used AI based on trivial lines of code to solve basic problems?
If your newbie in codeforces and new in python so how you can write these advance python codes
I didn't say I am new in Python
There will officialy be Silksong news 5 minutes before the round. That'll either give me the boost straight for specialist, or make me want to kill myself. Let's hope it's the former.
i wish for the boost.
I am looking forward to this game very much
I hope it'll be good contest for everyone and I'll get a huge + delta.
This is my first ever time participating in a CF contest, hopefully goes well :)
I will compete for being expert, I hope I do well and enjoy this round.
Hoping to leave pupil this time
Clashes with Silksong special announcement
This can change my life , what is life all about , the world must evolve back to caves , best of luck everyone
long time no Contest
Vladosiya, cry, Proof_by_QED here?
I have to participate!
Finally , CF is back to ruin my day again :)
Will I be pupil?
What a great contest!! Thanks to authours!!
Wishing high ratings to everyone!!
19k solves in B? CF is cooked.
this is div3 dummy there always are that many submissions
MathForces
Was hard as Div2
agreed
I'm agree with you.
C2 was tough, but such an amazing problem!
can u help in that.
my approach was kind of greedy. I used my c1 approach first where i find the min cost with min deals. Then:
Here cnt[i] means the number of deals I have for x = i
You basically have to split n into more smaller powers of 3 than larger powers. now, observe n in base3 format, you can see how it is split into powers of 3. in order to use more smaller powers more, try transferring powers from msb to lsb. when we are using smaller powers, it requires more deals. so keep track of how many are used.
334931987 this is my submission, i used binary search just because i was lazy to think the math.
C2 almost killed me..........
I actually solved it from bottom to top after failing to get the straightforward solution to work. Starting from $$$n$$$ deals for only one watermelon, I merged them into greater ones with regard to maximum possible merges for a given digit.
How did it went guys?
For me since I am a newbie I wasted all the time on 1st two problems.
same, except I made a retarded mistake in secound problem.
I forgot to print how many x are here. idk why I took me hour to figure out
Shit it must've been frustrating.
oh it was really frustrating.
I forgot to respond
Hahaa it's okiee :)
WHY DOES MY SOLUTION FOR C2 WA ON TEST 5...AAAAAAAAHHHHH
digitforces
true bro
How to solve D?
Can anyone please explain the approach??
dp
Are you referring to digit DP??
nope something similar to decomposition
Yeah, but what about using prefix sums tto compute till the kth digit, that we can easily find out using basic maths? run a while loop and keep multiplying 9*10 power number to identify the location oif the digit?
same idea but rather than looping i thought to decompose using recursion kinda dp'ish approach with precalc range result and all
ya fair enough, even i thought that, the intuition came from a 1200 codeforces problem i still remember, it was basically to calculate the sum of all digits from 1 to n, today i actually realised that codeforces is mmore about finding out the patterns in the problem, c2 also was similar to one i did before
Very very great contest! Just a little bit harder than its name
Also I was ranked 800 until 25 minutes before the end and now I see I'm 1900! How is that possible?
ChatGPT gives D's answer in seconds
Same..
Try to uncheck "show unofficial" in the right top corner
so bad contest as Div3 contest. i show that it was should be rated as Div2.
no way div2 is way harder for ABCs
I'm training these days on Div3 contests and Usually solve 4 or 5 problems. but this contest i only could solve 1 problem. that made me so frustrated since i was hoping to up to Pupil again.
Worst problemset >>>
True. The main part of problem D can be found on Google, and people who copied from there won't be skipped. The statement of problem A describes the algorithm itself, quite contrary to codeforces problem statements. I didn't enjoy this round like previous contests.
Does this code solves C2? i couldn't submit it because of debugging:
Maybe you can submit this code to the Online Judge after hack time,and get the score.
please tell me where to hack others code?I hadn't use this function before.Thanks
I don’t like pD It’s so annoying
ikr
Guys!! I have attended in a math olympiad for the first time in my life. Thanks for the Contest !!
F and G are entirely cobbled together by forcing multiple different templates. It's really extremely boring to set such questions.
I got negative delta on this contest because while doing one of the problems, I saw a picture of the newly revealed mega victreebel (pic below) and could not properly debug my code while laughing for 45 minutes.
d is way too standard and solvable with the following 2 links with very little modification
https://www.geeksforgeeks.org/competitive-programming/cses-solutions-digit-queries/
https://stackoverflow.com/questions/73821319/number-of-occurrences-of-digit-in-numbers-from-0-to-n
count this in
Something like digit DP seems to be too complicate for a problem D. Do you have any simple solution?
My god, problem $$$D$$$ is implementation hell. I got the idea quickly of binary search and we can use Digit DP to find sum of digits of numbers in a range, but was not able to complete the implementation in time :(
problem D is awful
I'm trying to solve D and going as far as:
But to figured what is the exact sum with k is some number is still doesn't quite there yet, can someone teach me how to approach similar problem more efficiently?
You first need to see how many numbers this sequence has For example, you can start by subtracting 9 from k, then 90*2=180, then 900*3=2700, etc., and finally, with a little attention to detail, you get the number of numbers After that, you can easily solve it (you can search for the sum of the digits of numbers 1 to n on Google) Also, the last number, which only needs to be calculated for some of its digits, must be calculated separately
ah right I forgot with what I have is the number digit of n, so at that point I can figured the digit = number of cycles count...
I just suck at digit DP stuff
This contest really humbled me
div3 or div2 + div3?
2.5
What?
Damn ABC were instant solves, I'm really slow at reading problems though and this was the first time I could actually read through all the problems in the contest within the duration. Definitely getting some elo on this one!
Cheers to ChatGPT!!
MathForces
Does anyone know more problems like D (ignoring cses)
1177A - Digits Sequence (Easy Edition)
1177B - Digits Sequence (Hard Edition)
1216E1 - Numerical Sequence (easy version)
1216E2 - Numerical Sequence (hard version)
1373E - Sum of Digits
Hope you find them useful.
C1 was easier than B. C2 was a really good problem.
I think most of the downvotes on this blog are because of the math heavy problems from B to D.
YAY
MY PRAYER HAS BEEEEN A/C
I understand that we shouldn't make problems and then only take the ones that are not solvable by AI, that takes all the fun out of it.
But this cheating situation is getting worse day by day, so I suggest authors do that to prevent cheating to at least some extent.
Please do not organise any contest again! here is not math class!
Almost every newbie, pupil, specialist of top 100-200 have one or more than one AI code. Why CF are not banning them, why only skip their solution. If a person cheat this time, and you only skip his solution, next time he will make sure that his code looks like more human written.
And I do not understand the mindset of these Indian college students. Every where I see most of them are Indian engineering students. Bro, you might get a job by cheating, but you won't survive in the culture. Every day companies are laying off people, you might get one job easily by cheating, but for other job you will struggle a lot. Even some companies are moving to in-person interviews because of cheating. Stop doing cheating, and start studying.
Practice is allowed only for finished and unfrozen contests. Why is this being shown while submitting?
hi i am newbie at coding. For C2 i cant observe that i should greedily take form big deal to small deal or small deal to big deal. Also i dont understand how to make a condition skip the necessary deal greedily, and is it possible that only see N and K then can figure it out is -1 or not. For D i dont have any idea about how to find the sum, is that have a general equation for that or just exhuastion. i am trying improve my coding skill :(
I read the comment section, many people are complaining about it being hard, but it was the easiest contest i have so far,this is the first time i was able to solve 3 Problem(A,B,C1) for the first time
Actually that was my first contect and i accepted a qouestion in a contest , maybe i'm so excited maybe beacuze i'm nob in CP but i had fun yesterday. Thank you.
Why are the ranks shown in friend and common standings different ?
when will rating be applied?
Dudes were too lazy to make a contest, so they just gave us a math exam instead.
In C1
why this code is calculating the cost for each 3^x correctly? The formula was
3^(x+1) + x * 3^(x-1)but we aren't using this. For more please see editorial.Let
f(x)denote the formula. Expand the expression off(x + 1). It can be proven thatf(x + 1) = 3 * f(x) + 3^xif you replace x with x + 1 in f(x).Let $$$C(x)$$$ be the cost of $$$3^x$$$ watermelons, then
is the required recurrence relation
Here is the proof, hope it help (you have to do tricks such as add 0 and multiply by 1)
How does the standing system work? It shows that my official common standing is 3372 yet in the contest section in my profile, my rank is displayed to be 4517.
The official standings only contain trusted participants (who participated in 5+ rated rounds). For rating calculation, every participant whose rating is below 1600 is considered, regardless of trusted or not. The rank shown in your profile page is the position among the latter set of people.
Understood, Arigato!
How to become specialist? I am practicing a lot here and much more in other platforms....Can anyone guide? And also please guide me for dynamic programming.
def wasn't a div 3.
hey, can you guys upvote me for the first time?
This was one of the most math based contest I've ever participated in. A total math marathon..
B was interesting and fun, idk how but I just figured it out!! D was not very hard, pretty smooth solve C2 almost killed me
E submission
my solution is based on counts of a and b . and after seeing others submission i feel i think too question oriented not in a general way.
how to improve that???
E submission
my solution is based on counts of a and b . and after seeing others submission i feel i think too question oriented not in a general way.
how to improve that???
Actually this message to the system that was a coincidence of code.No problem sometimes misunderstanding make it to suspect.Thank you codeforces.
Dear Codeforces Team,
I am writing to respond to the notice about my solution (ID: 334878052) being similar to others. I want to clearly say that I did not cheat and did not share my code with anyone.
I created the solution by myself. I first thought through the main ideas on paper and made sure they were correct before writing any code. For testing, I used an online compiler (GeeksforGeeks compiler and some time other online IDE also), which I have done before in past contests. Now I understand that using such websites might make my code visible to others, which could explain the similarities. I feel really sorry about this mistake.
I want to make it clear that I never meant to break the rules. From now on, I will only use my local computer for writing and testing code to avoid any such issues in the future.
I apologize if this situation has worried anyone, and I hope you can consider my explanation. I care a lot about the fairness of competitive programming and the Codeforces community. I am committed to following the rules and maintaining the standards of this platform.
Respectfully, abhi00100 2132E - Arithmetics Competition Codeforces Round 519 by Botan Investments
Hello codeforces the page in which I have solved problem C is losted . If I have that page then I can give you evidence but now I don't have.I am pretty sure about that this was a coincidence.
Hello, I want to respectfully clarify my situation regarding my solution (submission: 334934057) for problem 2132E.
The solution I submitted is completely my own work, The approach is quite standard for this type of problem:
Sort both arrays in descending order.
Precompute prefix sums for both arrays.
For each query, determine the valid range of elements to take from array A vs. B.
Use a ternary search over that range to maximize the sum.
This is a very natural and common method to solve such problems. since the logic is straightforward and competitive programmers are often trained to use prefix sums + search (binary or ternary) in optimization problems, it is not surprising that multiple participants may arrive at very similar code.
I did not share my solution with anyone, nor did I copy it. Any similarity must be coincidental, caused by the fact that the standard solution path for this problem is quite constrained and leads to almost identical implementations.
I kindly request that you reconsider penalizing my submission. I value the integrity of Codeforces competitions and would never intentionally break the rules. I will also take extra care in the future to avoid even the appearance of similarity.
Thank you for your time and understanding.
Hello, I received multiple plagiarism warnings for Codeforces Round 1043 (Div. 3), for problems C1, C2, D, and E.
I want to sincerely apologize for violating the contest rules. I did share my solutions during the contest, and I now fully realize that this was a serious mistake that affected the fairness of the competition.
This was my first time making such a mistake, and I take full responsibility. I deeply regret it and assure the community and the Codeforces team that I will never repeat this behavior.
I value the Codeforces platform and contests, and I hope to be allowed to continue participating while strictly following the rules going forward.
— Harilaxman
I sincerely apologize for my grave error in participating in contest 2132 using two of my accounts, Shreya_02 and Sleepybear9. I now fully understand that this was a serious violation of the rules, and I take complete responsibility for my actions.
This was a deeply regrettable oversight on my part, and I assure you it was not done with any malicious intent to gain an unfair advantage. I recognize that maintaining the integrity and fairness of the competition is paramount, and my actions have compromised that.
I have learned a valuable lesson from this experience. I am committed to adhering strictly to all contest rules going forward, and I will be much more vigilant to avoid any potential for a similar situation.
I kindly request that you consider my heartfelt apology and reconsider the penalty on my submission. I genuinely value the Codeforces platform and its community and am dedicated to being a respectful and rule-abiding participant.
Hello @thetwoface this side, i participated in Codeforces Round 1043 (Div. 3), and now it was showing that my answer matches with someone whom i don't have any clue. Infact i don't even know him/her. Please do not skip my all problems of this round. I maintained the dignity and solved with the my intuition. There could be a chance of coincidence as well and for that i am not solely responsible for. My submbission ID 334922375 has been skipped along with all other submission please keep it back. Hope that makes a difference. Thankyou Peace!
Hello Codeforces team,
I recently received a notification regarding a rules violation due to a significant similarity between two submissions: one from my account Tukabbir and another from Sailor. I want to clarify that both accounts belong to me. I was unaware that participating in the same contest using multiple accounts is strictly against the rules. This was not an attempt to gain an unfair advantage, but rather a misunderstanding of the platform’s policies.
I sincerely apologize for this oversight and take full responsibility. I’ve read the rules more carefully now and understand the seriousness of the issue. I will ensure that I only use one account (Sailor) for all future contests and interactions on Codeforces.
Thank you for your time and understanding.
— Tukabbir
Dear Codeforces team, I received a warning for suspected similarity on problem 2132C2. I want to clarify that I wrote this solution completely on my own without sharing or copying. It was a coincidence that imansh and siddhu007 submitted a similar approach. I think the problem is with the edge case which is same but in this question I think it would be prevalent that's why it happened . I sincerely respect Codeforces rules and would never intentionally break them. I kindly request you to please review this warning again and consider removing it from my account. It affects my profile integrity, and I assure you that I always code honestly.
Thank you very much for your understanding and for maintaining a fair competitive environment. --VSS103056_MAyyanNB12
plz dont cheat r8848_ 4th plag already!!! , codeforces administrators please see this account.
Got a TLE on the 4th problem with only 7 minutes left. Replaced a nested while loop with an O(1) arithmetic trick and got #Accepted just 3 minutes before the final whistle. Siuuu... #Codeforces