delete pics to save space
This commit is contained in:
15
history_source/信息学奥赛一本通/2.4.5.cpp
Normal file
15
history_source/信息学奥赛一本通/2.4.5.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include<cstdio>
|
||||
#define maxn 1000010
|
||||
#define mod 32767
|
||||
int answers[maxn];
|
||||
int main()
|
||||
{
|
||||
for(int i=0;i<3;i++) answers[i]=i;
|
||||
for(int i=3;i<maxn;i++) answers[i]=((2*answers[i-1])%mod+answers[i-2])%mod;
|
||||
int n;
|
||||
scanf("%d",&n);
|
||||
int sr[n];
|
||||
for(int i=0;i<n;i++) scanf("%d",sr+i);
|
||||
for(int i=0;i<n;i++) printf("%d\n",answers[sr[i]]);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user