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

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

We will hold AtCoder Regular Contest 110(Sponsored by KAJIMA CORPORATION).

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

We are looking forward to your participation!

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

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

I thought for a second that KOJIMA PRODUCTIONS is sponsoring this round. XD

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

So finally kazama from Shinchan became an Industrialist and sponsoring this . Nice to see his dream come true.

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

I am desperate to destroy this round ᕙ༼=ݓ益ݓ=༽ᕗ

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

Bump, how do you solve F?

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

How to do C ?

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

    First, priority is to get '1' on the first position. So suppose if '1' is at fourth position, we will have to bring '1' to 1st pos by swapping it 3 times. Now also keep an array to remember if you have swaped a certain position Pn and P(n-1) [you can't swap twice]. Now keep doing tis for every index [if indexis 'i' bring the number 'i+1' to that pos by swapping] and store the order of swaps in some array.

    Now, if you came to an indice where the swap has already been done and the value on index isn't equal to (index)+1 , you print "-1" and return bcoz you can't fix that index by swapping.

    Atlast, iterate thru the "visited" array you used, to keep check of what index has been swaped and confirm that each of the indices have been swaped.[We need to swap it EXACTLY one time]. If some index hasnt been swapped, return. Otherwise just print the order array

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

      can you share your code ?

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

Any idea how to solve D?

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

E as the hardest problem again? I admit the solution is similar idea-wise to some AGC E, except without some ugly special casing that made that problem much harder.

We can see that each character in the resulting string is formed from a substring. When does a substring $$$I$$$ form 'A'? The key is that in each operation, the number of occurrences of each character switches parity. At the end, we have 'A' once and 'B', 'C' zero times, so in the starting string, the number of occurrences of 'A' must also have a different parity than for 'B', 'C'.

Is this sufficient? We can always perform operations till we end up with a constant string. This can't be all 'B' or all 'C' because they don't satisfy this necessary condition, but it could be an odd number of 'A'. The last operation, however, gave us 'A...A' from w.l.o.g. 'A...ABCA...A'; we can simplify 'CAA' or 'AAC' to 'C' and 'BAA' or 'AAB' to 'B', which gives us at most one 'A' on each side; we know that we're getting an odd number of 'A', so it couldn't be 'ABC' or 'BCA'. Now 'BC' is ok and 'ABCA' can be transformed into 'CCA' and that into 'A'. The condition is sufficient.

If you were reading carefully, you noticed a special case: a constant substring can't be changed. If the initial string is constant, the answer is $$$1$$$. Otherwise, let's look at the string we want as the result. If it's non-constant, even if we perform some operations and end up with some extra 'AA', 'BB' and 'CC', we can always remove substrings 'AA', 'BB' and 'CC'. If it's constant, we look at the last operation and apply the same reasoning as above to see that if we can get 'A...AAA', we can also get 'A...A'.

For each resulting string, we can now associate its characters greedily with consecutive substrings of $$$S$$$. If the shortest prefix from which the first $$$p$$$ characters can be obtained is $$$S_1, \ldots, S_l$$$, then we find the smallest $$$r$$$ such that $$$S_{l+1}, \ldots, S_r$$$ gives the $$$p+1$$$-th character. We wouldn't gain anything by choosing a larger prefix than $$$S_1, \ldots, S_r$$$; this is obvious if we rewrite the condition for "we can create character from substring" to "are these prefix sums different?".

If we reverse that, we get a DP solution: for each prefix of $$$S$$$, find the number of prefixes of the resulting substring that are associated with it. State transitions are "add character" and can be processed in $$$O(1)$$$ with the above mentioned prefix sums. At the end, we can only use strings associated with some prefix if the remaining suffix has the same parities of the number of occurrences of each character, but that's easy to check. $$$O(N)$$$.

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

can we calculate coefficient of $$$x ^ M$$$ in the below equation ,just curious, if yes then how ?? i thought it for long time but couldn't think anything after reducing to this for D .

$$$(\prod_{i=1}^{N} ( \sum_{j=a_i}^{\infty}\binom{j}{a_i}x^j)) * (\frac{1}{1-x})$$$

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

B Can someone help me with this code? I am getting 2 test cases wrong!! Thanks in advance.

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

How to solve B ?

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

    for B what i did was convert it into classic question of given a string $$$S$$$ and $$$T$$$ we can append $$$S$$$ total $$$x$$$ times and find the occurences of $$$T$$$ using some linear function as we know the delta or difference we get of $$$ K * S $$$ and $$$ ( K + 1) * S$$$ is constant, where $$$ \vert S \vert \geq \vert T \vert $$$, so to satisfy this condition i appended $$$110$$$ total $$$10^6$$$ times, like $$$110110....$$$ let it be $$$S^\prime$$$

    then i used prefix function on $$$S^\prime$$$ and $$$T$$$, where $$$T$$$ is the pattern we have to find number of occurrences of,let that val be $$$V_1$$$ and then again do same thing for $$$ S^\prime + S^\prime $$$ and $$$T$$$ ,let that val be $$$ V_2$$$,

    So my answer will be $$$V_1 + (V_2 - V_1) * 9999 $$$

    multiplied by $$$9999$$$ because we already chose $$$10^6$$$ so remaining factor will be $$$10^4$$$ as $$$10^4 * 10^6 = 10^{10}$$$

    My submission link

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

This ARC is missing the "Discuss" link that points here. (So was ARC 109, but it's there now.)

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

Hi, I have alternative (bad) solution for F

(1) Do random operation (2) Announce 0 until 0 comes into P_0 (3) if sorted, done. else, go back to (1)

I think this works with around 1/N probability each iteration and this in contest passed with time around 700ms with python.

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

anyone can help me for task D solution? https://atcoder.jp/contests/arc110/tasks/arc110_d

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

so……no ediorial in English?