Submission #1072788

#TimeUsernameProblemLanguageResultExecution timeMemory
1072788thinknoexitFibonacci representations (CEOI18_fib)C++17
5 / 100
105 ms3252 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...