ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1521. War Games 2

How to output fast?
Posted by Victor Barinov (TNU) 10 Jan 2007 04:29
Especially to Burunduk1 :-)

How your output method is organized?
I tried different ideas. My best time is 0.078.
My algo is O( n log n ).

Maybe anyone have any ideas?

Thanks. Bye.
Re: How to output fast?
Posted by Burunduk1 10 Jan 2007 17:22
Mine one is also O(nlogn)
But its constant is very small.

About output:

/* printf("%d\n", mi); */

char s[9];
int l = 0;
while (mi)
  s[l++] = mi % 10, mi /= 10;
while (l--)
  putc('0' + s[l], stdout);
putc('\n', stdout);
Re: How to output fast?
Posted by Victor Barinov (TNU) 11 Jan 2007 00:23
Thanks. I improved my algo, now 0.062
Does your structure use binary operations intensively?