I've got AC but my run time is 0.765s . I saw that some people got AC with little run time so I think there's another solution better than using Graham k times ( k = maximal possible number of fences ). If it's true , please tell me your solution. Thank you very much. My e-mail : email@example.com
To solve this problem efficiently we have to use Chazelle's algorith which is O(n log n). Sometimes it's called "onion peeling algorithm". But I can't find this algorithm in the net. If someone knows , please tell us links to it.