all of us (maybe) have got TLE in some problem ,, but works perfectly on ideone or on our machines...
i just found a way ..that we can submit our code on SPOJ ..and not get TLE and also know how much the code takes ...
It's 3 Steps:
1-remove any cin's or cout's or any in or out in you code ... instead of getting T and cases then ... make a little function that give you randomly cases...
2-at the end of your code and before return 0; write TEST solution ...
3-make sure that if you run you code it will solve TEST perfectly ... (maybe takes 2 or 3 seconds No problem)
Now submit your code as a TEST solution
the judge should give AC but the Time It take Is for your Own problem...
e.g.
//libraries
//functions
main()
{
//your code solving problem X
//remember no inputs no outputs
//Here put A TEST solution like this
int TEST;cin>>TEST;while(TEST!=42){cout<>TEST;}
//now return 0;
return 0;
}
This is the idea ..i just think that more people may found it useful ,,,
thank you and good by 