This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int f[22];
map<int, int> mp;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
f[1] = 1, f[2] = 2;
for (int i = 3;i <= 20;i++) f[i] = f[i - 1] + f[i - 2];
for (int i = 0;i < (1 << 20);i++) {
int res = 0;
for (int j = 1;j <= 20;j++) {
if (i & (1 << (j - 1))) res += f[j];
}
mp[res]++;
}
int n;
cin >> n;
for (int i = 1, sum = 0;i <= n;i++) {
int x;
cin >> x;
sum += f[x];
cout << mp[sum] << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |