We will hold OMRON Corporation Programming Contest 2025 #2 (AtCoder Beginner Contest 432).
- Contest URL: https://atcoder.jp/contests/abc432
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20251115T2100&p1=248
- Duration: 100 minutes
- Writer: sheyasutaka, yuto1115
- Tester: math957963, physics0523
- Rated range: ~ 1999
- The point values: 100-200-350-425-450-525-575
We are looking forward to your participation!









The round must be good.
I hope so.
What happened to the last two contests, why have the results changed? Did everybody get ~ +80 to performance?
1145 -> 1331 (+186) idk what :)
Hard D, easy E.
How do you know that before the contest???
I wonder how do u predict this???
OMG prophet
hope to finish D and E to increase my rate
Today, this test requires quick answering speed for the first 6 questions.
???
Why can't I register for Rated after the competition? The consequences of whether I register for Rated or not are ultimately my own doing, so why can't I do what I want?
That's because you might know the answer of the questions after the end of contest. So, if you want to increase your rating, please registered for rated before the contest is started.
before the competiton, the difficulty is unknown.
if you view problems first and decide whether to reated by its difficulty, it's not in line with the spirit of competition
was C that easy? so many submissions I felt the question was hard
It was just a weird looking binary search with l, r conditions inside a for loop
Your code please...
Attached in comment above
can you explain your idea?
binary search not needed
same i was trying but couldn't come up with a bs , but solved without it
Same. E felt much easier than C this time.
Actually easy is subjective here, a lot of people do participate on multiple platforms, and the idea of C is pretty much common in these days rounds(across platforms) and even in past contests. Had it been a new problem, the number of submissions would have been proportionate to it's difficulty.
basically, some base math
I don't think it was necessarily hard, but it required the right observation(s) through math. For example, I made a silly mistake at one point which led to me wasting time implementing the wrong thing. (I had derived the required formula/equation really early in my math but kept going without noticing for some reason.)
Solved 3 problems. Then I knew how to solve E but there was only 10 minutes left.
Solve 4,and had something about D, them the contest ends
C is absolute trash
Do you mean easy ?
nah pure math just trash
E << C << D. Difficulty level according to me (T_T)
its not like that,i guess difficulty is sorted in increasing (mb F>G) but C is pure math thats why you think like that
I agree
C is not very hard.It is only use "gcd" and "thinking deep".Although I don't passed in Contest.And it is only 30 lines in C++. https://atcoder.jp/contests/abc432/submissions/70993232
such rubbish problems especially C.
Toughest C I have seen.
you solved it? C?
Agree
Easy generating function for G again, but terrible D again...
what is it — the easy generating function ? The previous D was just bfs .
Why is D placed 4th? Even though E < D...
F is quite interesting! D is too difficult and rubbish.
D was such a long implementation problem for me. I'm glad I solved it during the contest without too much mistakes.
how to solve C?
bruhh bro you won't belive this 😭 I'm guessing that weight might be Y*A[0] when A is sorted for superstitious reason then pray it would AC or either disprove my guess and then solving X( + k ) + Y(A[i] — k) = W (W = Y*A[0] and finding minimum k) then boom it AC I don't even know how does it work but mannn math is prolly magic I do not comprehend it of what it does or I do understand why it even true that W = Y*A[0] 👍 well it might not I don't know I'm just dumb it may be the test that weak or I just guess the right shit this time but anyway 😭
Same solution 💀
Superstitious reason is so true 🥀
Not so superstitious. At the end you can imagine the final weight for ith child as $$$X\cdot a[i]$$$ + contribution of large candies (which will be $$$(Y-X)$$$ * count of large candies for ith child).
Hence, the difference between each $$$a[i]\cdot X$$$ and $$$a[0]\cdot X$$$ should be divisible by ($$$Y-X$$$) and it should be no larger than $$$a[0]\cdot (Y-X)$$$, i.e., $$$\dfrac{(a[i]-a[0])\cdot X}{Y-X} \leq a[0]$$$. If 1st condition is violated, you cannot make both weights equal, and if 2nd condition is violation, you cannot make a[0]'s weight equivalent to a[i]'s weight even if a[0] is all large and a[i] is all small.
Finally, you can make all a[0]'s candies large, and for every other a[i] give them as much large candies as needed to be equivalent to a[0]'s weight (will be possible due to the conditions satisfied as per the previous paragraph).
nevermind I solved it just now, using
if (D / d == 0) {instead ofif (D % d == 0) {f***ed me up :(.feel you bro 😭
D is so hard
Pls don't put a BIG implementation problem in ABC.
but it was D today. after spending 20 minutes on it, I skipped it and went to E, which was also too hard for me
Problem G is a poly (FPS) template. Problem E is segtree or fenwick template. And problem D is easy to think but very hard to implement.
Problem C, F are good: they require a certain amount of thinking.
I solved G with NTT convolution: if we define a polynomial that looks like this:
(a1! x^a1 + a2! x^a2 + a3! x^a3 + ...) * (1/b1! x^-b1 + 1/b2! x^-b2 + 1/b3! x^-b3 + ...)then notice that the coefficients of $$$x^d$$$ will represent the missing difference needed to 'complete' the binomial coefficient (since the only thing we're missing is the $$$(n-k)!$$$ term). We can compute this product using NTT and then iterate over all differences and multiply by $$$1/d!$$$ for each one, and sum up all contributions.
Code (scroll to line 220): https://atcoder.jp/contests/abc432/submissions/70982129
Anyone please explain E in a easy way
cnt(x) will gives count of how many elements in A <= x and val(x) will gives sum of all elements of A that <= x, I implement this using segment tree to handle update of type 1, for answering of type 2 I look at number line and using logic to solve it using information from cnt(x) and val(x)
if ai < l it becomes l and if it is > r , it becomes r .. using fenwick u can compute the sum of numbers which are in [l,r] and you can maintain how many < l and > r no.s in another fenwick .
for sum[l,r] + (cnt[0,l]*l)+(cnt[r,5e5+1]*r)??
yep
Refer image
Can someone explain C?? Preferably the pure mathematical solution??
I was thinking it might include some linear diophantine, just had no clue how to get max possible candies...
not a pure math solution but, you get the minimum
A[i]and multiply it byYto get the max possible weight, and just initialize the other Ns toA[i] * Y. Then correct the remaining candies.https://atcoder.jp/contests/abc432/submissions/70991682
I thought of Implementing Binary Search. But it was absolute Math
I made two arrays — mins and maxs. If Max of mins is greater than Min of maxs, then -1. Otherwise, Max of mins is the max possible weight. Each child gets it. bigCount += (MaxOfMins — mins[i]) / (big — small) ok, and all mins[i] % (big — small) should be equal, otherwise -1
If a child takes
kbig candies, we can rewrite his total candy weight as: k*Y + (a[i] — k)*X This simplifies to: a[i]*X + k*(Y — X) = a[i]*X + k*diffWhen is equalization impossible?
1) If for any pair (i, j), the difference cannot be fixed using steps of
diff: (a[i] — a[j]) * X % diff != 0 because adding multiples ofdiffcan never make them equal.2) If even the maximum big-candy child cannot be brought down to the minimum: max(a[i]) * X > min(a[i]) * Y
How many big candies to keep?
Binary search on how many big candies the maximum child can take. Check if for a mid = number of big candies: min(a[i]) * Y >= max(a[i]) * X + mid * diff If true → possible, otherwise adjust the search.
Codeforce round.Many many code to type.
We can even see ABCE-solvers' performance can be in $$$[1222,1630]$$$, highly depends on their codespeed(and time wastes on D)
me likey problem c
can someone share solution for problem D ?
You need to just implement it lol, unfortunately there's nothing better :(. Basically what really helps is splitting up the rectangles and then moving them. My friend unforgettablepl has coded up a solution which is actually really clean if you ignore the diabolical variable names:
His code: https://atcoder.jp/contests/abc432/submissions/70996579
EDIT: If you want a saner version of the same idea, my code: https://atcoder.jp/contests/abc432/submissions/70997552
Yes , I forgot to see constraints
Why the time complexity in user editorial of problem F is $$$O(2^n \cdot n)$$$? Why is it not $$$O(3^n)$$$?
You don’t need to do a 3^n because you can simply remove 1 bit from your mask at a time and count how many masks with correct sum you reach on the way to 0. This works because if you have some group that has the correct sum, its complement must necessarily also be a correct sum, as otherwise it would be impossible to do.
For C I just randomly sorted the array and gave the first element all Ys, then got the weight and tried to make all the others have the same weight. I have no idea how this passed.
this is just my 2cent so don't take it seriously, for each i we know that X*0 + Y*A[i] = Wi-max and after this we could adjust it down(decrease it) one time like to X(0 + 1) + Y(A[i] — 1) = Wi-max — (Y — x) or 2 time like X(0 + 2) + Y(A[i] — 2) = wi-max — 2*(Y — x), so after knowing Wi-max for each instance i we could adjust it down by (Y — X) repeatedly ! that means assuming all instance starting with maximum weight it can be solve if we can all adjust it down by (Y — X) for each of them till they meet at some common value since each time we adjust weight by decrease it with (Y — x) that means they(all Wi-max) must all share common residue modulo (Y — X) to be able to all drop their value to meet at the same common point in the first place, and we did just that by setting the common point to be highest possible which is Y*A[0] (after sorted A of course) anddd then all other Wi-max(Y*A[i]) can just drop them self down by (Y — X) repeatedly to meet at this common point ! since they all start further (when i > 0 , Wi-max >= Y*A[0] hold)
https://atcoder.jp/contests/abc432/submissions/71005530 can anyone help me why my c logic is wrong .
Understood, really helpful. Thanks
Rubbish round, and bad B,C,D. I am sure that this one will own lots of downvotes, but I am still going to post this one because I only solved 2 problems. I usually solve 4 or 5.
Good Round
Finally, I AKed ABC! This round must be a good one.