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

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

The USACO US Open contest for the 2016-2017 season is going to run from 3/10 to 3/13. Let's discuss the contest and the problems here after the contest :)

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

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

Participation link please?

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

The contests is running.

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

The input/output file name of problem Switch Grass in Platinum division is incorrect. It should be "grass.in/.out".

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

Is the second test case of problem 1 pelatinum correct?!

UPD: it's correct

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

So hard contest... How to solve SWITCH GRASS from platinum?

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

You can still start the contest on the website, so discussion should probably not happen yet.

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

How to solve Platinum 2?

I wrote an solution which passed just 3 test (the same as the stupid one with checking the all adjacent vertices). The basic idea is to divide the updates in sqrtM equal parts .Did someone do that and if so

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

    Notice that in any cycle of the graph, if there are at least two types of grass, then there are at least two edges that connect different types of grass. Therefore, the largest edge in any cycle will never be used as the answer, so it can be removed. This is equivalent to reducing the graph to its minimum spanning tree. The rest is just lazy propagation to update the children of the node changed in each update.

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

      How does the lazy propagation work?

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

        Let each node store the distance to its parent. Order these values such that for each node, all its children (and only its children) exist as a subarray, and that all children with the same grass type are also consecutive. Build a segment tree on this array. Now when we update node I from A to B, we make invalid all its children with type B (add infinity to all these nodes), and similarly make valid all children with type A (subtract infinity from these nodes). This is a range update, so we use lazy propagation. We should change the validity of node I as well, depending on the grass type of its parent. To get the answer, just query for the minimum value in the entire range. There are some annoying details to take care of, such as how changing the grass types of the nodes changes their ordering, but it can be done.

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

      Cool! thanks :)

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

    Are you sure about your complexity? My (~ 10^9 operations) passed 7 cases out of 10.

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

      Oh actually its something like but I still don't think it should have TLEd on everything. Probably it TLEd because of a big constant. Thanks for the response. At least now I know that I probably got the idea for the solution.

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

        It can actually be solved in , but the solution has many little complications to avoid the log factor. One of the cooler things I to avoid using set is buckets to create a structure which provides insertion and deletion of elements in O(1) and minimum query in which is fine since you have only Q queries for minimum. However, I haven't submitted it, does anyone know when will the problems be available for upsolving?

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

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

Anyone have something faster than O(100 ^ 4 * lg(100000)) in platinum P3? Such solution should pass (as it's hard to make constant factor large. I think it will go down as low as /16 ~ /50) but I wonder if there is any solution with better asymptotics.

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

Is there faster solution for P2? Faster than ?

UPD: Oh! I find solution! :)

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

I only got 9/16 test cases on platinum #3 because I forgot to run the variable-mapping procedure parallely at one place :((( Couldve gotten a full score on that and a nonzero chance at camp with a simple 2 line fix :(((

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

Does anyone have any idea when the results will be released?

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

usaco gold problem 2:" we unfortunately had to revoke this problem since an algorithmic flaw was identified that invalidates the solution approach we had in mind -- making the problem far harder than intended" But Why? isnt it far harder? why not giving its score for those who solved it and spend a lot of time on it ?

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

    By "far harder", we mean NP-complete. So it would be extraordinary if you did actually solve it.

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

      I did solve this problem and got all 10 test cases. Actually this took up the bulk of my time, as I didn't have enough time to do the last problem. So I got 633. My argument is that the problem shouldn't be thrown out if it is indeed solvable, and if it had been factored in, then the cutoffs would have been far lower, and I would have possibly qualified.

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

        The problem, as it was stated, was impossible to solve with the given constraints (unless P=NP). The judge solution was incorrect because it was finding a longest path in a DAG, whereas the nature of the graph meant it could have had cycles, in which finding longest path is NP complete.