# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70672 | 2018-08-23T08:23:51 Z | 김세빈(#2186) | Fibonacci representations (CEOI18_fib) | C++11 | 3142 ms | 1428 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef __int128 lll; const ll mod = 1e9 + 7; lll F[1010]; vector <ll> A; ll P[10101]; ll n; ll calc(vector <ll> &V) { ll i, k; P[0] = 1; P[1] = (V[1] + 1) / 2; for(i=2; i<V.size(); i++){ k = V[i] - V[i - 1]; P[i] = ((k / 2 + 1) * P[i - 1] + (k % 2 - 1) * P[i - 2] + mod) % mod; } return P[i - 1]; } int main() { ll i, j, a; lll s; F[0] = F[1] = 1; for(i=2; i<=120; i++){ F[i] = F[i - 1] + F[i - 2]; } scanf("%lld", &n); A.push_back(0); for(i=1; i<=n; i++){ scanf("%lld", &a); A.push_back(a); sort(A.begin(), A.end()); printf("%lld\n", calc(A)); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 488 KB | Output is correct |
2 | Correct | 3 ms | 488 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 628 KB | Output is correct |
2 | Runtime error | 3142 ms | 1428 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |