Блог пользователя atcoder_official

Автор atcoder_official, история, 6 месяцев назад, По-английски

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

We are looking forward to your participation!

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится -19 Проголосовать: не нравится

The round must be good.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hard D, easy E.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

hope to finish D and E to increase my rate

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

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

  • »
    »
    6 месяцев назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

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

    Weird BS
  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится +5 Проголосовать: не нравится

    Same. E felt much easier than C this time.

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    basically, some base math

  • »
    »
    6 месяцев назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится +10 Проголосовать: не нравится

C is absolute trash

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

such rubbish problems especially C.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Toughest C I have seen.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how to solve C?

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    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 😭

    • »
      »
      »
      6 месяцев назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Same solution 💀

      Superstitious reason is so true 🥀

    • »
      »
      »
      6 месяцев назад, скрыть # ^ |
      Rev. 5  
      Проголосовать: нравится +1 Проголосовать: не нравится

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

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

D is so hard

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится +21 Проголосовать: не нравится

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.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

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

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Anyone please explain E in a easy way

»
6 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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)

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

me likey problem c

can someone share solution for problem D ?

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    6 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

»
6 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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.

  • »
    »
    5 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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)

»
5 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
5 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Good Round

»
2 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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