|
|
back to boardNope, just your algorithm is slow......... Too many interations are made.. Consider this : Your program does 10^9*10^3=10^12 . Time Limit-> 1 sec. With 10^12 you need much more........ There is a solution There is a simple method of encoding/decoding of permutations on N elements that is O(N).It is based on the removal of used elements. |
|
|