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

Автор chrome, история, 10 лет назад, перевод, По-русски

Привет!

Завтра в 19:00 MSK состоится TCO16 Round 1A.

Прочитать про TCO16 можно здесь.

И еще, количество участников ограничено, только 2500, и максимальное количество участников которые проходят на следующий тур — 750.

Предлагаю обсудить задачи после контеста.

GL && HF!!!

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

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

registration started , register soon since number of people allowed to participate are limited(2500)

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

Is it a rated contest?

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

What is the idea of 1000!!!

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

Is there any way to solve 1000 in O(N3)?

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

    Yep.

    Let's do the following process: suppose we have a function that is able to, given a sequence of already visited vertices (we are staying at the last vertex of that sequence), tell if this sequence can be extended to a correct permutation. Having such function, we can determine the answer in O(n2) calls of it by restoring the elements of the desired permutation one by one.

    Now we need to implement such function. This can be done via pretty easy DP, smth like D[v] =  minimum number of vertices above v we should visit in order to visit all vertices in the subtree of v. It can be calculated in O(n).

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

    If you can check if there exists a sequence starting with a1, a2, ... in O(N) then you can solve the question in O(N^3).

    To do this: we remove all the vertices in the sequence that we already decided to use from the tree: so if we decide to go to 2, then all of 2's children are now children of 2's parents, etc. Now we can perform a tree dp[], taking special consideration of which is the last a_i we decided to use.

    dp is number of times you need to leave the subtree.

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

    Interestingly enough there is even an O(N^2) solution. The main idea is that you can find nodes that are "good to go to" without breaking the traversal of the tree in O(N). If you are interested you can see my code in the practice rooms. As a problem setter I decided to not give it with N <= 1000 xD

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

Not related to problem.

I am getting the above error. I tried reinstalling java, using javaws to run it from command line, downloading the applet again.

There is one solution where I have to add the site as exception list in java. But I don't know the exact site address of topcoder. If someone knows please help.

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

can anybody please explain div-2 500 by binary search and DP ??

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

    Suppose you have another problem, you have an array A and an integer D, what is the maximum number of disjoint pairs you can form where a pair(x, y) can be formed if abs(A[x] — A[y]) <= D, this can be solved by dynamic programming in O(N^2).

    In the original problem we can binary search D.