#include <bits/stdc++.h>
using namespace std;
int n, ans[] = {0, 0, 0, 1, -1, 1, 2, 3, 2, 3, 2, 3, 4, 3, 4};
int main() {
cin >> n;
if (n<15) cout << ans[n];
else {
if (n%5==0) cout << n/5;
if (n%5==1) cout << n/5+1;
if (n%5==2) cout << n/5+2;
if (n%5==3) cout << n/5+1;
if (n%5==4) cout << n/5+2;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
580 KB |
Output is correct |
2 |
Correct |
3 ms |
504 KB |
Output is correct |
3 |
Correct |
2 ms |
504 KB |
Output is correct |
4 |
Correct |
2 ms |
504 KB |
Output is correct |
5 |
Correct |
3 ms |
580 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
580 KB |
Output is correct |
2 |
Correct |
3 ms |
592 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
580 KB |
Output is correct |
5 |
Correct |
3 ms |
592 KB |
Output is correct |
6 |
Correct |
2 ms |
580 KB |
Output is correct |
7 |
Correct |
3 ms |
592 KB |
Output is correct |
8 |
Correct |
3 ms |
592 KB |
Output is correct |
9 |
Correct |
2 ms |
592 KB |
Output is correct |
10 |
Correct |
3 ms |
592 KB |
Output is correct |
11 |
Incorrect |
2 ms |
580 KB |
Output isn't correct |
12 |
Correct |
3 ms |
580 KB |
Output is correct |
13 |
Correct |
2 ms |
580 KB |
Output is correct |
14 |
Correct |
3 ms |
580 KB |
Output is correct |
15 |
Correct |
2 ms |
592 KB |
Output is correct |
16 |
Correct |
2 ms |
580 KB |
Output is correct |
17 |
Correct |
3 ms |
592 KB |
Output is correct |
18 |
Correct |
2 ms |
580 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
592 KB |
Output is correct |
2 |
Correct |
3 ms |
592 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
592 KB |
Output is correct |
5 |
Correct |
2 ms |
592 KB |
Output is correct |
6 |
Correct |
3 ms |
592 KB |
Output is correct |
7 |
Correct |
3 ms |
592 KB |
Output is correct |
8 |
Correct |
3 ms |
592 KB |
Output is correct |
9 |
Correct |
2 ms |
592 KB |
Output is correct |
10 |
Correct |
2 ms |
592 KB |
Output is correct |
11 |
Correct |
3 ms |
592 KB |
Output is correct |
12 |
Correct |
3 ms |
592 KB |
Output is correct |