# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
71728 | 2018-08-25T13:43:40 Z | 유애나(#2242, kdh9949) | Angelic Hourglass (FXCUP3_hourglass) | C++ | 4 ms | 760 KB |
#include <bits/stdc++.h> using namespace std; int main(){ int n, dp[5001]; scanf("%d", &n); if(n == 7){ puts("4"); return 0; } dp[0] = 0; dp[1] = dp[2] = dp[4] = 9999; dp[3] = 1; for(int i = 5; i <= n; i++) dp[i] = min(dp[i - 3], dp[i - 5]) + 1; printf("%d\n", dp[n] > n ? -1 : dp[n]); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 356 KB | Output is correct |
2 | Correct | 2 ms | 576 KB | Output is correct |
3 | Correct | 2 ms | 576 KB | Output is correct |
4 | Correct | 3 ms | 432 KB | Output is correct |
5 | Correct | 3 ms | 248 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 636 KB | Output is correct |
2 | Correct | 3 ms | 576 KB | Output is correct |
3 | Correct | 2 ms | 636 KB | Output is correct |
4 | Correct | 2 ms | 576 KB | Output is correct |
5 | Correct | 2 ms | 636 KB | Output is correct |
6 | Correct | 2 ms | 628 KB | Output is correct |
7 | Correct | 2 ms | 576 KB | Output is correct |
8 | Correct | 2 ms | 628 KB | Output is correct |
9 | Correct | 3 ms | 636 KB | Output is correct |
10 | Correct | 2 ms | 576 KB | Output is correct |
11 | Correct | 2 ms | 576 KB | Output is correct |
12 | Correct | 3 ms | 636 KB | Output is correct |
13 | Correct | 4 ms | 636 KB | Output is correct |
14 | Correct | 2 ms | 636 KB | Output is correct |
15 | Correct | 2 ms | 576 KB | Output is correct |
16 | Correct | 2 ms | 636 KB | Output is correct |
17 | Correct | 2 ms | 636 KB | Output is correct |
18 | Correct | 2 ms | 636 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 636 KB | Output is correct |
2 | Correct | 2 ms | 636 KB | Output is correct |
3 | Correct | 2 ms | 760 KB | Output is correct |
4 | Correct | 3 ms | 636 KB | Output is correct |
5 | Correct | 2 ms | 636 KB | Output is correct |
6 | Correct | 2 ms | 636 KB | Output is correct |
7 | Correct | 2 ms | 636 KB | Output is correct |
8 | Correct | 2 ms | 760 KB | Output is correct |
9 | Correct | 2 ms | 760 KB | Output is correct |
10 | Correct | 2 ms | 636 KB | Output is correct |
11 | Correct | 2 ms | 636 KB | Output is correct |
12 | Correct | 2 ms | 760 KB | Output is correct |