Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:easy code

Posted by qylsw at 2010-07-09 19:17:54 on Problem 1604
In Reply To:easy code Posted by:bobchennan at 2010-04-28 14:23:33
> int work()
> {
>     if(n==1)return 1;    
>     int two=B(2)-B(5);
>     int three=0,seven=0,nine=0;
>     int nn=n;
>     while(nn)
>     {
>         int n1=nn;
>         while(n1)
>         {
>             int d=n1/10;
>             three=(three+d)&3;
>             seven=(seven+d)&3;
>             nine=(nine+d)&3;
>             d=n1%10;
>             if(d>=3)three++;
>             if(d>=7)seven++;
>             if(d>=9)nine++;
>             n1/=2;
>         }
>         nn/=5;
>     }
>     two%=4;
>     three%=4;
>     seven%=4;
>     nine%=4;
>     return m2[two]*m3[three]*m7[seven]*m9[nine]%10;
> }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator