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

Автор arsijo, 5 лет назад, По-английски
Tutorial is loading...

Author: arsijo

Developer: stanislav.bezkorovainyi

Tutorial is loading...

Author: arsijo

Developer: stanislav.bezkorovainyi

Tutorial is loading...

Author: stanislav.bezkorovainyi

Developer: stanislav.bezkorovainyi

Tutorial is loading...

Author: Lewin

Developer: Lewin

Tutorial is loading...

Author: Noam527

Developer: Noam527

Tutorial is loading...

Author: Noam527

Developer: Noam527

Tutorial is loading...

Author: Lewin

Developer: Lewin

Tutorial is loading...

Author: _h_

Developers: _h_ and majk

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

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

Div2 C. Why my solution failed on test no. 17 I used Difference array and Binary search.? http://codeforces.com/contest/1075/submission/45302142

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

    Not sure if this is your case, but I also used the same technique and got WA on test no.17 Maybe this test case might help you?

    2 3
    3
    5
    1 4 1
    2 100000 2
    1 4 3
    

    My code outputs 2 but now I see that it should be 1...T_T

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

Overall complexity of Div.2C should be O(nlog(n)) because of sorting.

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

Anyone know the tag for problem C Div 2? Solution presented above is greedy?

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

    Binary Search/Two Pointers. But I think it is more helpful to view it as adhoc where you have to make observations. In this case main observation based on vertical lines span the whole grid, and no horiztonal touching.

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

Div2C: I did everything right, but forgot to write sort()... I am feeling so bad about this alexa play despacito

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

Nice !

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

Div1D is not original.

Here is the same problem in one of the Indian Regionals — https://www.codechef.com/KGP17ROL/problems/XORQUERY

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

    E and F aren't great either. My understanding is that CF wants to encourage problem writers and the bar for problem quality isn't set too high, so unless contest organizers want high quality original problems (which wasn't the case this time but in the past for this reason some companies had problems set by their own engineers and not outsourced) you should not have high expectations.

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

    Hey,

    I did not intend to copy/steal a problem by any means. Neither me nor the testers knew of this problem (and also no other task that is similar to div1D), otherwise it would be brought up. I'm sure you understand that we want to have tasks with as high quality as we can, and also being original. Still, I'll try to look deeper for tasks similar to mine, but honestly, I think it's impossible to assure my problems are original.

    Anyway, I hope you still managed to enjoy some other tasks from the round :).

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

Hi, Can someone tell me whats wrong with Code??

Interactive Problem

Thanks in Advance

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

    The problemis that you need to run a bfs to find the closest vertex instead of finding any vertex like you do with your dfs.

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

задача С div.2 неполный комплект тестов решение: https://ideone.com/f5QqGH тест : 0 1 1 999999999 1 решение выдает 1, а правильный ответ 0

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

    Добавил такой тест, будет использоваться в дорешке/вирт контестах.

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

Isn't W(3,5)⊕W(5,2) equal W(2,2), not W(3,2)?

Because [3⊕4⊕5]⊕[2⊕3⊕4⊕5] is equal to 2.

And that would mean that W(a,b)⊕W(b,c)=W(a,c)⊕b.

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

Can anyone help me out with Div. 2 F? I'm getting WA on test 14. I'm using dsu and merge small-to-large, and but I cannot tell what my error is and this problem is quite hard to debug.

45341296

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

    update: I fixed my error, a pretty big one, actually. I was updating the subtrees with p[l]^p[r] instead of x^p[l]^p[r].

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

Thanks a lot for detailed explanations!

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

Can anyone explain the dp part of Div1-C, Also what are c1,c2..,c6 wrt this question?

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

    We need to find 3 points, such that |x1 — x2| + |y1 — y2| + |x2 — x3| + |y2 — y3| + |x3 — x1| + |y3 — y1| is maximal. We are going to try all possibilities of assigning + or — to each of these pairs. For example if we have +--+-+, we are going to have (x1 — x2) — (y1 — y2) — (x2 — x3) + (y2 — y3) — (x3 — x1) + (y3 — y1), which evaluates to 2*x1 — 2*y1 — 2*x2 + 2*y2 + 0*x3 + 0*y3. c1 here is the coefficient next to x1, c2 is the coefficient next to y1...c6 is the coefficient next to y3. So we calculate arrays P, Q, R as in the editorial and then do dp to get the maximum for such combination. The dp state is [current point][taken points]. You can also check out my implementation 45365331.

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

      Thanks a lot :) , I got majorly confused on how taking all possible combinations wont give wrong answer because we are taking the cases are not possible too, For those who are confused on this part -> max value of the expression can be |x1 — x2| + |y1 — y2| + |x2 — x3| + |y2 — y3| + |x3 — x1| + |y3 — y1|, any other case will be less than or equal to this, Hence this wont affect our maximum. With similar reason we can prove why this wont work for minimum.

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

Thanks, stanislav.bezkorovainyi for writing a descriptive and well explained tutorial for problem 1074A.