当前位置: 代码迷 >> C语言 >> 关于第十八期比赛
  详细解决方案

关于第十八期比赛

热度:306   发布时间:2007-09-16 20:47:34.0
The above algorithm should be one of the best:

O(n) time + O(1) space.


----------------解决方案--------------------------------------------------------
以下是引用HJin在2007-9-16 13:03:19的发言:
I think the algorithm for solving the invesion prolbem is O(n^2) --- you have two for loops and I would think in the worst case scenario, you will have O(n^2).

I submitted a O(n lgn) algorithm at yzfy.org, which uses a STL set (the set brings me TLE always).

Where are you come from?


----------------解决方案--------------------------------------------------------
china ! i think
----------------解决方案--------------------------------------------------------
  相关解决方案