NikaraBika's blog

By NikaraBika, history, 9 years ago, In English

Hello :)
This(14612490) is a brute force solution for 506D - Mr. Kitayuta's Colorful Graph and it's time complexity is absolutely O(n^2). (n <= 100 * 1000)
I submitted it and got AC!
Could someone help me? Why did it happen? Weak test data or fast servers?
(That code must get TLE if we give it a path of size 100 * 1000 and all edges with the same color without any query)

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +17 Vote: I do not like it

absolutely weak algorithm analyse ! because your algorithm is O(nsqrtn).

  • »
    »
    9 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Did you even look at my code? If you run it with the given test on your own computer, it gets TLE!

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it -8 Vote: I do not like it

      weak local machine?

      • »
        »
        »
        »
        9 years ago, # ^ |
        Rev. 2   Vote: I like it +14 Vote: I do not like it

        When you have nothing to say, saying nothing is better than saying bull shit :)