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 1150. Page Numbers

Some hints about "Digits" problem ;))
Posted by nullman 10 Jan 2002 01:35
I have been accepted with time result 0.13 sec. so I do not show off
but this is good result. I have written it in C++, but my idea is to
jump with 9999 pages with these functions:
void calc9999(void)
{ pArr[0]+=1104+2889+3;// ???
  pArr[1]+=4000;pArr[2]+=4000;pArr[3]+=4000;
  pArr[4]+=4000;pArr[5]+=4000;pArr[6]+=4000;
  pArr[7]+=4000;pArr[8]+=4000;pArr[9]+=4000;
}
// the second is only at start!!!
void calc1to9999(void)
{ pArr[0]+=2889;
  pArr[1]+=4000;pArr[2]+=4000;pArr[3]+=4000;
  pArr[4]+=4000;pArr[5]+=4000;pArr[6]+=4000;
  pArr[7]+=4000;pArr[8]+=4000;pArr[9]+=4000;
}
:))
I jump up to all pages if possible otherwise i use one by one page
calculation. If pages are less than 10000 I use the same method.

If some one got it type some thanks!!!

Zahari
Are you kidding??? Almost everybody who solved this problem got AC in less than 0.03 sec! Did you check out the problem statistics?
Posted by shitty.Mishka 10 Jan 2002 02:22
Re: Some hints about "Digits" problem ;))
Posted by tiancaihb 4 Sep 2009 18:37
very cute idea!