啊题解
2025-04-17 18:27:55
发布于:四川
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
while(n--){
int k;
cin >> k;
long long a[1000005] = {};
a[1] = 1, a[2] = 2;
for(int i = 3; i <= k; i++) {
a[i] = (a[i - 1] * 2 + a[i - 2]) % 32767;
}
cout << a[k] << endl;
}
return 0;
}
这里空空如也
有帮助,赞一个