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

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

There will be online version of the ACM ICPC Phukhet Regional 2013 tomorrow 14:00UTC time. It will be 5 hour contest. You are cordially invited to participate in the contest. Hope you will enjoy the set!

Here is the contest link

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

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

Anyone has hints for H? I tried Gaussian Elimination for each query but it was too slow.

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

    The constraint on N was small, so a backtrack or bitset DP of some sort should work.

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

      How do you handle repeating vertices?

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

        That was just a wild guess. Not like I coded anything... (I did the first 1.5 hours of this, then today's CF round and realized that it won't do me any good to train much with no actual competition in sight :D)

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

    We can precompute some special inverse matrix in advance and answer each query in O(n2). This matrix seems to be depend on t but precomputing n matrices still gets TLE. Then I try the same matrix for all t and it passed. I have no idea why :)

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

      I guess, since t is O(n), so generate O(n) matrices each of size O(n^2). And also do the gaussian elimination in O(n^6) per matrix to answer each query O(1). Am I mistaking?