# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
267155 | peuch | Fibonacci representations (CEOI18_fib) | C++17 | 3 ms | 512 KiB |
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;
const int MAXN = 20;
int n;
int f[MAXN];
int sum;
int ans[2000000];
int main(){
f[1] = 1;
f[2] = 2;
for(int i = 3; i <= 15; i++)
f[i] = f[i - 1] + f[i - 2];
for(int i = 0; i < (1<<15); i++){
int aux = 0;
for(int k = 0; k < 15; k++)
if(i & (1<<k)) aux += f[k + 1];
ans[aux]++;
}
scanf("%d", &n);
for(int i = 1; i <= n; i++){
int aux;
scanf("%d", &aux);
sum += f[aux];
printf("%d\n", ans[sum]);
}
}
Compilation message (stderr)
# | 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... |