|
|
вернуться в форумAre there any suffix spaces in input? My prog gets TLE on test #17. The complexity of my prog is 100*100*log100, so it can't be that it really runs too slow. The only possibility is that it falls into an infinite loop when performing binary search for a food name, because the string inputted contains suffix spaces. Admins please correct this and rejudge the prob if this is true. Edited by author 10.01.2006 03:41 Re: Are there any suffix spaces in input? It can't be solved in 100*100*log100 because input may be as large as 100*100*40. Don't you read the whole input? Re: Are there any suffix spaces in input? It doesn't matter. 100*100*log100*40 is about 3e6, which is still not big enough to lead to TLE. Re: Are there any suffix spaces in input? You made a very tricky mistake. You compare string[40] and string 100*100*log100 times. This comparison works very slow because string[40] is casted to string every time. Re: Are there any suffix spaces in input? Thanks. You're right. When I changed 'string' into 'string[40]' I got AC very fast. |
|
|