[hdu6600]Just Skip The Problem

1. Direct so x = 0, in order to determine this information, for all of the plurality yi containing 1, must be useless, and can not answer containing at least n number of 1 to y
2 so yi = 2 ^ (i- 1), which will be able to find every answer to get x, that answer up to n.
Thus, the number of programs found i.e. when n !, n-$ \ When the answer must ge p $ 0, the time complexity is o (p)

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define mod 1000003
 4 int n,fac[mod]; 
 5 int main(){
 6     fac[0]=1;
 7     for(int i=1;i<mod;i++)fac[i]=1LL*fac[i-1]*i%mod;
 8     while (scanf("%d",&n)!=EOF)
 9         if (n>=mod)printf("0\n");
10         else printf("%d\n",fac[n]);
11 }
View Code

 

Guess you like

Origin www.cnblogs.com/PYWBKTDA/p/11260649.html