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

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

Dear friends,

Come and show your skills on the 5th round of this year's COCI!

Click here to see when the coding begins in your timezone.

Pro tip for the contest: make clever use of the biggest monster in the current programming scene -> bitset. It is almost so good that it should be banned from competitions.

Thank you

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

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

Solution for problem 160: Simply use bitset.

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

Lol. The last problem is a simpler version of my own. https://www.codechef.com/problems/HAMILG

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

    Do you mind elaborating on your solution? Also I'm wondering how the graph being bipartite helps the computation, but I wouldn't mind if you'll just explain the solution to your own problem.

    Thanks :).

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

      The solution is basically: find a maximum matching, then find vertices at the end of an alternating path from some unmatched vertex (in the first partition). In this case, the first part is maxflow and the second part one BFS from the source, since all alternating paths from unmatched vertices can be extended to start in the source.

      In my problem, maximum matching is much harder to compute; the second part is O(N) times BFS, but otherwise the same.

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

    Hi , so to me seems like a notorious coincidence.

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

How to solve 140?

P.S. No bitset allowed.

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

    First, note that we only need to add edges between city pairs (a, ba) where a and b are integers. There are only such edges. Then, we can efficiently simulate the process using a disjoint set data structure. Finally, I used parallel binary search to process the queries (there are also other ways).

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

      A much simpler way to process queries is to build a spanning tree with depth during the DSU algorithm, where we add edges from the root of a smaller subtree to the root of a larger one, and edge weights correspond to the time when they're created. Processing queries online with this is just brute force.

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

How to solve Spiral and Birokracija ? I know only 50% solutions for this problems .

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

I've written an analysis for all the problems on my blog: http://blog.brucemerry.org.za/2018/01/coci-20172018-r5-analysis.html

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

To those problem with special judge,where should I go to download it?

@ipaljak