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

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

We will hold AtCoder Beginner Contest 134.

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

We are looking forward to your participation!

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

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

What's the approach for E . I gave it an hour but still not able to figure out

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

When will the answer to the D problem be -1. i.e when will we not have a good set of choices?

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

What's the solution for F?

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

ABC like 15 minutes...then no idea at all. Gap from C to D much to big.

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

How to solve problem F?

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

F anyone? ?

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

How to solve D please :)

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

    For D, you can start from N and go backwards till 1, at each stage check the parity of all multiples of the current number which are <=N, and accordingly set or don't set the bit for the current number depending on Ai.

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

      You mean check all the divisors of the current number...then I guess its complexity must be O(n*sqrt(n)) Please correct me if I am wrong

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

        Actually it's O (N log N), since the amount of iterations you have to do is $$$\sum_{i = 1}^{N} N / i = N \cdot \sum_{i = 1}^{N} 1 / i$$$, which is just N * Harmonic Sequence, which is O (N log N).

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

          Not sure if this is an amateur question, but how is the harmonic series = log N?

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

            I'm not sure if I'll be able to explain this clearly but I'll try.

            The Summation of elements of the Harmonic Sequence is: $$$S_1 = 1 / 1 + 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 + 1 / 6 + 1 / 7 + 1 / 8 \dots + 1 / n$$$

            Suppose we generate another sequence bigger than the Harmonic Sequence by rounding the denominators down to their nearest power of 2. The summation of this sequence will be: $$$S_2 = 1 / 1 + 1 / 2 + 1 / 2 + 1 / 4 + 1 / 4 + 1 / 4 + 1 / 4 + 1 / 8 \dots + 1 / n$$$

            The value of $$$S_2$$$ is close to $$$\log_2 N$$$ since the amount of elements required to get to the next integer value doubles for every integer. Since $$$S_1 \leq S_2$$$, we conclude that $$$S_1$$$ is also close to $$$\log_2 N$$$.

            EDIT: I believe this is explained better on an Algorithms Live! video, but I can't recall which one.

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

              Understood, in fact that's a fairly standard proof, it's just that it's been a while since I've dealt with this kind of math so I had to jog my memory.

              Thank you!

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

How to look at other's solutions at AtCoder?

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

I tried to solve F using DP but it only passed 30 test cases out of 50 other 20 gave TLE. Is there a solution to the problem which does not involve dp or what were the states of the dp which passed all the test cases?

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

Here's everything about Problem F: https://arxiv.org/pdf/1202.4765.pdf

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

My code for problem C returns TLE for the second half of the test cases (probably longer inputs?), any advice to make it more efficient?

I only know the basics of C++, I have looked at a few of others' submissions, but they used vector lists. I know what they are but I haven't learnt how to use them in code yet, so I prefer something I could code & understand.

Thanks.

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

https://pastebin.com/NLHwAzXC for problem d i did the same as the nomral solution but instead of looping trough all the multiples of i it loops through primes i and sum up prime * i and decide to put 1 or no but it givs wa

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

Firstly, I taught that F can be solved using dp[i][j] — number of permutations using numbers from 1 to i having the permutation's depth j, but I figured out that is not enough. Can anybody explain the dynamic with 3 states?

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

I tried problem E by applying LIS twice. But I keep getting wa. Any idea what's the problem?

Submission-wa

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

Can anybody please explain the state of DP used to solve problem F.

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

chokudai please write an editorial explaining F

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

chokudai Editorial please.

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

Can someone please translate editorial for problem F in English?

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

If you find official editorial and AC submissions for F is so damn painful to look at, you can try to find out the idea in this editorial. Although it's in Japanese but it has an really intuitive example picture and you can use Google Translate to get the idea.

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

Could you tell me what the problem D actually ask to do? I couldn't understand the requirement. Thanks!