We will hold UNIQUE VISION Programming Contest 2024 Autumn (AtCoder Beginner Contest 425).
- Contest URL: https://atcoder.jp/contests/abc425
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20250927T2100&p1=248
- Duration: 100 minutes
- Writer: sounansya, toam
- Tester: cn449, MMNMM
- Rated range: ~ 1999
- The point values: 100-200-350-425-450-500-575
We are looking forward to your participation!








Good Luck & Have Fun~!
ABC is so cute awa.
Hope can AC E
:D
GLHF everyone!
GOOD LUCK TO EVERYONE!!
qp
Good contest. My last participation in ABC is about 1.5 years ago. Hope I'll get to 1000 rating.
G is a good problem but I can't solve it :(
Good luck for every one!
Is O((2^n)*n) supposed to be TLE in F?
My $$$\mathcal O(n2^n)$$$ solution passed easily.
One of my classmate wrote a O(n*(2^n)) code and got TLE. Actually I think the contest meant to ban some codes with to much constant.
It is related to your constant. Since I'm using C# I have to handle the constant very carefully. My submission.
How to solve $$$E$$$?
yeah I did just that along with the fact that there're like 669 prime under 5000 then doing some stupid optimization like using gp_hash table in stead of map to eliminate log factor, adding superstitious pragma 👀 then pray it to AC since it keeps failing the last(51th) case, then finally got it in the 3rd submission after precaling some function I need in 2-dimentional array 😭
You can implement a handwritten 'prime factorization' class, and that way you can easily pass problem E
Actually python will get TLE because of this. (I try to use this during the contest but failed all the time)
You need to use alternative way if you are using python, if frequency is f1, f2, f3, f4... fn, then answer = comb(f1,f1) * comb(f1+f2, f2) * comb(f1+f2+f3, f3) ..... * comb(f1+..+fn, fn), and you can precompute the comb using the formula comb(i,j) = comb(i-1,j) + comb(i-1,j-1).
How long will rating get updated?thx
Thanks for the nice problems.
Screencast of me solving the problems. Solved A-F. Very close to solving G (submitted a TLE solution just before the contest ended — had to do memoization and it got AC). https://www.youtube.com/watch?v=Pv3beKRAGhY
Bad E.
Bad (appl)E!!!
(some music starts)
Bad E. Why can't you give us a prime $$$M$$$?
Then this problem will only worth 350 points.
Whether $$$M$$$ is a prime number or not doesn’t really matter much.
But $$$\sum C_i$$$ is only 5000.
And I think maybe E is too easy.
$$$\dbinom{n}{m}=\dbinom{n-1}{m}+\dbinom{n-1}{m-1}$$$
You can use it to avoid division.
Fail to upgrate to 1 Dan again :(
I think E had a bad quality where it doesnt implicitly tell you that you have to precalc binomials. I told myself that multitest times 5k factorizations should be enough and got 50/51 ac 1/51 tle. My idea was to say that answer is $$$\frac{sum!}{c_1! \cdot c_2! \cdot \ldots}$$$ do two pointers and keep track of how many factorials contain each number from 1 to $$$sum$$$, so i know how much it contributes to the answer. Limits are tight enough so this doesn't pass and not tight enough to convince me the approach shouldn't work and I should do something else instead.
F's intended solution is nice. I just AC'ed hashset to keep track which transitions I already used.
Solved all problems in this round, but I hadn’t done that before.
I hope my account won’t be banned.
It’s absolutely not the case that I cheated in contests. Why I’m asking here is just because I’ve seen previous incidents when the commenter did nothing wrong and was inadvertently banned
Don't laugh.If u laugh,you will get TLE on this kind of ***t problems.
let me guess 🤔 it was that evil 51th test case.
Can we please get editorial for G ?
My solution:
Consider solving for a fixed $$$x$$$ first.
We can build a trie of $$$A$$$ then traverse it to find the $$$A_j$$$ that minimize $$$x \oplus A_j$$$. Which can be found it the following manner:
Start from the root, and assume the current bit we are consider is $$$i$$$-th bit.
Then to deal with all $$$x \in [0, M)$$$, notice that all $$$x$$$'s go to a child would still be consecutive under $$$\pmod {2^i}$$$, so to maintain all $$$x$$$'s go to a child, we store (first term of the consecutive $$$x$$$'s, the number of $$$x$$$'s) then everything can be dealt easily. (ex. $$$(2, 7)$$$ under $$$\pmod {2^2}$$$ represent $$$[2, 3, 0, 1, 2, 3, 0]$$$)
More specifically, we start from root with $$$(0, M)$$$ and traverse the trie with a BFS. Assume we have $$$(s, len)$$$ currently.
Thank you for sharing.
My solution of this G is a simple divide and conquer algorithm.
In the below,we extend every a to 30 digits.
Consider this greedy algorithm:There is a fixed x,you want to find the minimum value of $$$x\oplus a[i](l\le i\le r)$$$ which is guaranteed that the first t-1 digits of $$$a[i](l\le i\le r)$$$ are the same
Let the answer be $$$x\oplus a[i_0]$$$
if the t-th digit is same among $$$a[i](l\le i\le r)$$$:add 1 from t
otherwise:$$$a[i_0]$$$ must have the same t-th digit with x
Sort a in increasing order,let $$$f(m,l,r,t)=\sum\limits_{x=0}^{m-1}\min\limits_{l\le i\le r}((x\oplus a_i)\bmod 2^t)$$$.The transition is easy.
my code
You are so powerful orzorzorz
Who knows how to solve G?