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<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int f[25];
int n, a[25];
// f[15] = 1e3, f[15] * 15 = 15e3
int X[15'000];
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
f[1] = 1, f[2] = 2;
for (int i = 3; i <= 20; ++i) f[i] = f[i - 1] + f[i - 2];
for (int mask = 1, sum; mask < (1 << 20); ++mask) {
sum = 0;
for (int i = 0; i < 20; ++i)
if ((1 << i) & mask) sum += f[i + 1];
if (sum < 15'000) ++X[sum];
}
cin >> n;
for (int i = 1, prf(0); i <= n; ++i) {
cin >> a[i];
prf += f[a[i]];
cout << X[prf] << '\n';
}
}
/** /\_/\
* (= ._.)
* / >0 \>1
**/
# | 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... |