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

Автор maroonrk, история, 5 лет назад, По-английски

We will hold AtCoder Regular Contest 113.

The point values will be 300-400-500-600-800-1000.

We are looking forward to your participation!

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

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

Clashes with open cup. Can it be pushed an hour?

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

This contest will be hold on the old rating system, right?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +24 Проголосовать: не нравится
was C easy than B ?? or its only for me ?
»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +135 Проголосовать: не нравится

New difficulty staircases with a wall

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +12 Проголосовать: не нравится

If you're having trouble working out the edge cases, B can be solved with Berlekamp-Massey: https://atcoder.jp/contests/arc113/submissions/20391652

code

Edit: I solved it the traditional way first.

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

Problem B was already available on Stackoverflow (*_*).

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

how to solve D

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

    Let $$$n \gt 2,m \gt 2$$$. Then observe that the only constraints on $$$A$$$ and $$$B$$$ are that $$$\forall i, B_i \gt max(A)$$$. So, we can find for a given maximum $$$x \in [1,k]$$$ the number of different sequences $$$A$$$ such that $$$max(A) = x$$$, which is $$$x^{n} - (x-1)^{n}$$$. Then, the number of sequences $$$B$$$ such that $$$B_i \geq x$$$ will be $$$(k-x+1)^m$$$. Multiply these values and add them for all $$$x$$$, and you have your answer.

    Handle $$$n=1$$$ and $$$m=1$$$ separately.

    Complexity is $$$O(k(\log m + \log n))$$$.

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

    The answer turns out to be the number of monotone $$$k-$$$weightings of a complete bipartite digraph with $$$n$$$ vertices on the left and $$$m$$$ on the right for $$$n, m \gt 1$$$. For $$$\min(n, m) = 1$$$ the answer is $$$k^{\max(n, m)}$$$.

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

Why problem E is sooooooooo much harder than D (

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

My somewhat readable solutions for anyone interested:

A
B
C
D
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +43 Проголосовать: не нравится

I believe I have missed one out of 12321 cases in E.

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

Problem D was similar to this but with weaker constraints.

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

why is this wrong for D

Spoiler


https://math.stackexchange.com/questions/3260717/how-to-count-the-number-of-different-sequences-possible?noredirect=1

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

So I printed (max(n,m)+k-1 choose k-1) instead of k^max(n, m) in D and failed to see this bug for 10 mins. Cost me over 1100 places :thonkms:

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

B can be solved without period observation.
let's define f(a,b,c) = a^b^c = {a^b^(c/2)}^b^(c/2)
then f(a,b,c)=f(f(a,b,c/2),b,c/2) so we can do DP.
https://atcoder.jp/contests/arc113/submissions/20381459

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

So lucky to have E accepted at the last 3 minutes. I was wondering if F is easier than E when I was reading the problems and tried to work F out for tens of minutes, fortunately I did not continue doing that...

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

Sad.Problem E always wrong on test 1,2. AC another 44 tests.

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

So, how to solve E?

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

    There are so many situations to consider: note that we can almost keep all b's except some special cases, and cancel all the a's to 0 or 1 if we want, the problem becomes "how to arrange the rest of a's" and "how many a's we can keep at the end of the final string".

    1. All the a's are at the beginning: we cannot do anything to make b at the beginning, so we should keep 0 or 1 a at the beginning(depending on the parity of number of a's) and keep all the b's.

    2. There are some a's at the end: we should move the continuous a's to the end by an operation, and by one operation with $$$k$$$ continuous a's we can increase the length of suffix with all a's by $$$k - 2$$$, so we only move those larger than 2 to the end.

    3. No a's at the end: if the parity of total number of a's is even, we just cancel all the a's, otherwise, we must keep some a's between b's, or we need to remove (at most 2) b's to make a's at the end. When the suffix of b's is no longer than 2, we can keep the last a and remove any other a's, otherwise, try to keep the longest suffix of a's by removing 2 b's.

    I haven't found a "clean" solution yet...

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

This is the second time I participants in ARC, and it's difficult for me as usual.

I tried my best and solve the first four problems, after this, I'm almost exhaust and didn't have too much time thinking about the rest.

I can't understand why all the people around me are saying:"The first four problems are very simple!", maybe it just because I'm too weak to join ARC:(

All in all, I hope all of you can enjoy the contest, just like I did!

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

Can anyone tell me what is the difference between these 2 codes for B, and why doing +4 is important? I also checked 'b' is never -ve when I submit it.

AC code: void solve(){ ll a, b, c; cin >> a >> b >> c; b = power(b, c, 4)+4; a = power(a, b, 10); cout <<a << endl; return; }

WA Code: void solve(){ ll a, b, c; cin >> a >> b >> c; b = power(b, c, 4); a = power(a, b, 10); cout <<a << endl; return; }

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

So, how to solve F?Could anybody tell me the expanation of dp[i][j][k] -> dp[i + 1][j][k + 1]'s "weight" is 1/(k+1)

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

While the problems are different, D is awfully similar to this Codechef Long problem from 2019, the same idea works to get the formula in both too.

Edit: Just noticed that it was pointed out above too.