atcoder_official's blog

By atcoder_official, history, 10 months ago, In English

We will hold OMRON Corporation Programming Contest 2025 #2 (AtCoder Beginner Contest 432).

We are looking forward to your participation!

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
10 months ago, hide # |
 
Vote: I like it -19 Vote: I do not like it

The round must be good.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What happened to the last two contests, why have the results changed? Did everybody get ~ +80 to performance?

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hard D, easy E.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

hope to finish D and E to increase my rate

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Today, this test requires quick answering speed for the first 6 questions.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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?

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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.

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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

»
10 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

was C that easy? so many submissions I felt the question was hard

  • »
    »
    10 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    It was just a weird looking binary search with l, r conditions inside a for loop

    Weird BS
  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it +5 Vote: I do not like it

    Same. E felt much easier than C this time.

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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.

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    basically, some base math

  • »
    »
    10 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    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.)

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Solved 3 problems. Then I knew how to solve E but there was only 10 minutes left.

»
10 months ago, hide # |
Rev. 2  
Vote: I like it +10 Vote: I do not like it

C is absolute trash

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

such rubbish problems especially C.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Toughest C I have seen.

»
10 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Easy generating function for G again, but terrible D again...

»
10 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

Why is D placed 4th? Even though E < D...

»
10 months ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

F is quite interesting! D is too difficult and rubbish.

»
10 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

D was such a long implementation problem for me. I'm glad I solved it during the contest without too much mistakes.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

how to solve C?

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    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 😭

    • »
      »
      »
      10 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Same solution 💀

      Superstitious reason is so true 🥀

    • »
      »
      »
      10 months ago, hide # ^ |
      Rev. 5  
      Vote: I like it +1 Vote: I do not like it

      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).

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    nevermind I solved it just now, using if (D / d == 0) { instead of if (D % d == 0) { f***ed me up :(.

»
10 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

D is so hard

»
10 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Pls don't put a BIG implementation problem in ABC.

»
10 months ago, hide # |
Rev. 2  
Vote: I like it +21 Vote: I do not like it

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.

»
10 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

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

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Anyone please explain E in a easy way

»
10 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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...

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    not a pure math solution but, you get the minimum A[i] and multiply it by Y to get the max possible weight, and just initialize the other Ns to A[i] * Y. Then correct the remaining candies.

    https://atcoder.jp/contests/abc432/submissions/70991682

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I thought of Implementing Binary Search. But it was absolute Math

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    If a child takes k big 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*diff


    When 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 of diff can 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.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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)

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

me likey problem c

can someone share solution for problem D ?

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why the time complexity in user editorial of problem F is $$$O(2^n \cdot n)$$$? Why is it not $$$O(3^n)$$$?

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    10 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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)

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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.

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good Round

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Finally, I AKed ABC! This round must be a good one.