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

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

We will hold AtCoder Beginner Contest 207.

The point values will be 100-200-300-400-500-600.

We are looking forward to your participation!

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

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

hmm

Something looks not right..

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

How to solve E?

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

How to solve D? Is it related to 1017E - The Supersonic Rocket, in some way?

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

why d my solution got wrong???? is it possible to rotate degree that isn't 0, 90, 180, 270?

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

Tutorial E I did not understood the trick to go from O(n^3) to O(n^2). Can somebody explain with more words?

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

    The naive DP is dp[i][k] := # collections of k subsequences with i being the last element of the kth subseq. To calculate it, you iterate over the interval of the kth subseq. [i-x, i], and if a_{i-x}+...+a_i is divisible by k, then you add dp[i-x-1][k-1] to dp[i][k].

    However, we only need to care about x such that a_1+...a_{i-x-1} == a_1+...+a_i mod k. So let's just compute the sum of all dp[i][k]s such that [the prefix sum up to i] == M mod k+1 as sum[k][M] after each iteration of i. Then our transition is just dp[i][k] = sum[k-1][(a_1+...+a_i)%k]. We can make this O(1) if we change our dp[i][k] to dp[k], representing the sum of all dp[i][k] computed so far.

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

Thanks for the good contest. Was able to solve till D and got that E was dp but could not optimize it from O(n^3) to O(n^2). Here are the ideas for C,D,E :

C:

Idea
Code

D :

Idea
Code

E:

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

used too much time on D... wasnt able to do E which i think is easier

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

my screencast with solutions for a-e

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

maroonrk chokudai

Please implement feature that allow see solution by clicking user solution in standing as codeforces. Currently it's not comfortable, user should click user submissions and find solution.

UPD : This functionality implemented in clist.by , for example last contest result