# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424639 | 2021-06-12T08:26:28 Z | Rouge_Hugo | Fibonacci representations (CEOI18_fib) | C++14 | 4000 ms | 460 KB |
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back using namespace std; const int N=15009; int a[N],c[N],b[N]; vector<int>v; void go(int x,int sum) { if(x==v.size()) { if(sum>15000)return; b[sum]++; return; } go(x+1,sum); go(x+1,sum+v[x]); } int main() { a[1]=1;a[2]=2; v.pb(1);v.pb(2); for(int i=3;i<=20;i++) { a[i]=a[i-1]+a[i-2]; v.pb(a[i]); } go(0,0); int n;cin>>n;ll r=0; for(int i=0;i<n;i++)cin>>c[i]; for(int i=0;i<n;i++) { r+=a[c[i]]; if(r>15000)while(1)r++; cout<<b[r]<<endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 352 KB | Output is correct |
2 | Correct | 7 ms | 356 KB | Output is correct |
3 | Correct | 7 ms | 356 KB | Output is correct |
4 | Correct | 7 ms | 360 KB | Output is correct |
5 | Correct | 7 ms | 332 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 352 KB | Output is correct |
2 | Correct | 7 ms | 356 KB | Output is correct |
3 | Correct | 7 ms | 356 KB | Output is correct |
4 | Correct | 7 ms | 360 KB | Output is correct |
5 | Correct | 7 ms | 332 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
7 | Correct | 7 ms | 364 KB | Output is correct |
8 | Execution timed out | 4067 ms | 332 KB | Time limit exceeded |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 352 KB | Output is correct |
2 | Correct | 7 ms | 356 KB | Output is correct |
3 | Correct | 7 ms | 356 KB | Output is correct |
4 | Correct | 7 ms | 360 KB | Output is correct |
5 | Correct | 7 ms | 332 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
7 | Correct | 7 ms | 364 KB | Output is correct |
8 | Execution timed out | 4067 ms | 332 KB | Time limit exceeded |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 460 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 352 KB | Output is correct |
2 | Correct | 7 ms | 356 KB | Output is correct |
3 | Correct | 7 ms | 356 KB | Output is correct |
4 | Correct | 7 ms | 360 KB | Output is correct |
5 | Correct | 7 ms | 332 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
7 | Correct | 7 ms | 364 KB | Output is correct |
8 | Execution timed out | 4067 ms | 332 KB | Time limit exceeded |
9 | Halted | 0 ms | 0 KB | - |