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

Автор lukasP, 12 лет назад, По-английски

NCPC (Nordic Collegiate Programming Contest) and UKIEPC (UK and Ireland Programming Contest) will be held on Saturday and you will be able to participate in an online contest with the same problem set. The online contest will start at 11:00 and end 16:00 CEST on Saturday, October 4.

The contest will be held at open.kattis.com and you can participate in the warm-up contest in the mean time.

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

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

Will it be possible to upsolve it? This weekend our team will be busy.

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

☺☻☺☻☺☻☺☻☺☻☺☻

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

Everything relevant is published at http://ncpc.idi.ntnu.no/ncpc2014/, even the wrong solutions, input generators and problem statement sources in TeX.

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

NCPC featured really nice problems! Today we had an individual contest based on those task in University of Warsaw, though we didn't have all of them (without few easier tasks). We had Ceremony, Outing, Clocks, Particles, Basin City, Road and Squares. I especially liked Particles and Basin City! (Though I didn't solve Basin City).

By the way I can't help myself from presenting a comparison.
[Task name] — [Teams of three which got that task accepted on NCPC out of >250 teams]:[People on UW which got it accepted out of 43 people]
Particles — 2:8
Basin City — 2:3
Roads — 7:12
Squares — 15:21
:))

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

Problem B, k-Independent Set one, seems we can get rid of the n term in the O(n × 3k) solution and speed up to O(kd × 3k):

While we do DFS searching, to find an uncovered and unused vertex we may loop from 1 to |V| to do so. However, say we found u in the current step, we can pass it to the next iteration which starts finding the vertex from u instead of 1. For each DFS tree leaf the total time in such loop is bounded by O(dk).

This can also be applied to the O(n × 2.31k) solution, yielding a O(dk × 2.31k) solution. Which may even be fast enough for k = 17, 18.

P.S. Anyway it seems you have already done that in your solution :p

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

i am trying to solve problem A but fail to do so . i am trying both 2 sat 2SaT code and graph coloring bi_coloring code method . for idea one i got WA at test case 1 and for 2nd method got WA at test case 2 :( May be my idea was totally wrong . can anyone please describe the process how to solve problem A .

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

    First — we exactly know about color of vertexes, connected with 0-edges or 2-edges. And we know about all vertexes, reachable from these colored vertexes.

    We didn't color only vertexes, connected only by 1-edges. For each connected component of these vertexes, we can color or not color one vertex and check colors other vertexes by dfs/bfs.

    If we have some color conflicts — answer is "-1"

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

      thank you Slamur for your time . i am trying to follow your process , but wrong answer at test case 3 :( code link

      if you have time please kindly check my code where i am missing something or doing something wrong .

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

        When we colored all vertexes, connected with 0- and 2-edges, we had graph with only 1-edges in it.

        So we have 2 types of connected components — which have some already colored vertexes — so we can get colors of all vertexes in it by dfs (or get color conflict) — and connected components, where all vertexes weren't colored.

        For the second type of CC we must choose some vertex from it, color it by 0 and 1, and for each color use dfs to choose best variant.

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

By the way. Regarding problem J — Road works. My solution is essentialy O(n4) with tricky optimization. I used similar dp as in model solution dp[carswest][carseast][irritatednum] which was the smallest time (or INF) to achieve that state, but I propagate informations from those states in O(n) time (adding 1, 2, 3, ..., cars from west, and adding 1, 2, 3, ..., cars from east), so it resulted in O(n4) solution ("we have a state, let's see what we can achieve with it" approach, not "we need info about that state, let's search possible previous states") and it got TLE. But later I added an if that id dp[carswest][carseast][irritatednum] ≤ dp[carswest][carseast][irritatednum + 1] then I don't need processing possible outcomes of the second state. I got a feeling that constructing a testcase such that it won't help should be very hard and indeed, I got AC. Do you know why is it fast? I suspect that it might be O(n3) or O(n3·smallfunction).