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;
int main(){
int fibonacci[21];
fibonacci[0] = 1;
fibonacci[1] = 1;
for(int i = 2; i <= 20; i++) fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2];
map<int, int> mp;
for(int i = 0; i < (1 << 20); i++){
int sum= 0;
for(int j =0 ; j < 20; j++){
if(i & (1 << j)){
sum += fibonacci[1 + j];
}
}
mp[sum]++;
}
int curSum = 0;
int n;
cin >> n;
for(int i = 0; i < n; i++){
int x;
cin >> x;
curSum += fibonacci[x];
cout << mp[curSum] << " ";
}
cout << "\n";
}
# | 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... |