haleyk100198's blog

By haleyk100198, history, 7 years ago, In English

Recently I am trying to solve 702F — T-shirts based on FatalEagle's approach described here. Somehow the runtime somehow blows up in some seemingly random cases, even after switching between different random priority genreation methods.

Here is my submission. As you can see the runtime of #12 and #16 suddenly blows up while other large cases only has a runtime less than 1second (Not to mention I barely passed #12 after switching from cin to scanf). I wonder if one of my helper functions have a larger time complexity than I anticipated (I think every treap function except pushres() is around O(lgn) ), or am I messing with pointers to much that it takes too much time to allocate space for my treap?

  • Vote: I like it
  • +10
  • Vote: I do not like it