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.
Hard D, easy E.
How do you know that before the contest???
I wonder how do u predict this???
OMG prophet
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?
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...
binary search not needed
Same. E felt much easier than C this time.
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.)
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
such rubbish problems especially C.
Toughest C I have seen.
Agree
Easy generating function for G again, but terrible D again...
what is it — the easy generating function ? The previous D was just bfs .
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).
D is so hard
Pls don't put a BIG implementation problem in ABC.
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...
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 .
Finally, I AKed ABC! This round must be a good one.