# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70540 | 2018-08-23T05:42:32 Z | 조승현(#2190) | Fibonacci representations (CEOI18_fib) | C++11 | 3 ms | 544 KB |
#include<cstdio> #include<algorithm> #include<vector> using namespace std; vector<int>T; void Calc(int a, int b, int s) { if (a == 1) { T.push_back(s); return; } if (1ll*b*b <= a) { for (int i = b; i >= 2; i--) { if (a%i == 0) { Calc(a / i, i, s+i-1); } } } else { for (int i = 1; i*i <= a; i++) { if (a%i == 0 && a/i<=b) { Calc(i, a / i, s + a / i - 1); } } for (int i = 1; i*i < a; i++) { if (a%i == 0) { Calc(a / i, i, s + i - 1); } } } } int main() { freopen("output.txt", "w", stdout); int n; scanf("%d", &n); if (n == 1) { printf("1\n0\n"); return 0; } Calc(n,n,0); sort(T.begin(), T.end()); T.resize(unique(T.begin(), T.end()) - T.begin()); printf("%d\n", T.size()); for (auto &x : T)printf("%d ", x); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 544 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 544 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |