|
|
вернуться в форумHint for C++ programmers Послано HELLER 8 апр 2002 19:58 I've solved 1102 using DFA and reading 1 char each cycle with scanf("%c",&c); - and I've got Time Limit then I've tried c=getc(stdin); - and my program worked for 1.1 second. May be it will help. What's DFA , Please discribe it clearly Послано XueMao 20 июл 2002 19:21 Re: Hint for C++ programmers Послано Bonny 15 май 2004 23:30 Thanks!! I've got accepted because of your getc() function. Re: Hint for C++ programmers Yes! I got the same problem - now AC! No subject I also thank you ;) Re: Hint for C++ programmers Me too ... thanks. I got time limit with scanf but with getc(stdin) i got accepted in 0.484 sec. Nice problem :D. Re: Hint for C++ programmers Послано div 4 окт 2006 02:27 Another hint: if you are using '%' operator in your code, use subtraction instead of it (if you can). For example, code x = (x + 1) % MAX; got TLE, whereas x++; if (x >= MAXL) x -= MAXL; got AC 0.5 good luck Re: Hint for C++ programmers I still don't understand,,, is first test so large that I could get TLE? Or it's actually some technical problem?? |
|
|