Problem Description
Y_UME has just found a number x x x in his right pocket. The number is a non-negative integer ranging from 00 to 2 n 2^{n} 2n−1 inclusively. You want to know the exact value of this number. Y_UME has super power, and he can answer several questions at the same time. You can ask him as many questions as you want. But you must ask all questions simultaneously. In the i i i-th question, you give him an integer y i y_{i} yi ranging from 00 to 2 n 2^{n} 2n-1 inclusively, and he will answer you if x& y i y_{i} yi equals to y i y_{i} yior not. Note that each question you ask has a index number. Namely, the questions are ordered in certain aspect. Note that Y_UME answer all questions at the same time, which implies that you could not make any decision on the remaining questions you could ask according to some results of some of the questions.
You want to get the exact value of x x x and then minimize the number of questions you will ask. How many different methods may you use with only minimum number of questions to get the exact value of x x x? You should output the number of methods modulo 1 0 6 10^{6} 106+3.
Two methods differ if and only if they have different number of questions or there exsits some i i i satisfying that the i i i-th question of the first method is not equal to the i i i-th of the second one.
Input
There are multiple test cases.
Each case starts with a line containing one positive integer n ( n n(n n(n≤ 1 0 9 ) 10^{9}) 109).
Output
For each test case, output one line containing an integer denoting the answer.
Sample Input
2
Sample Output
2
不想说话,主要了解题意
#include<iostream>
#include<cstdio>
using namespace std;
typedef long long ll;
const int mod =1e6+3;
int n,an[mod+9];
int main()
{
for(int i=an[0]=1; i<mod; i++)
an[i]=ll(i)*an[i-1]%mod;
while(scanf("%d",&n)==1)
{
if(n>=mod)
puts("0");
else
printf("%d\n",an[n]);
}
return 0;
}
实践是检验真理的唯一标准