|
|
I have used the same program which was given in the problem.. By Just using a count and checking the input string.. i got the value.. But still i am getting TLE Is there anyway in which i can optimise it?? Your program works with O(n!) time: of course, it's TL. Find the rule in which the next one is got. Check whether the biggest possible answer does fit into the data type used. Edited by author 01.04.2009 21:58 You should find something interesting in the list of permutations which their program gives to you. ) |
|
|