#include <bits/stdc++.h>
using namespace std;
int n, ans[] = {0, 0, 0, 1, -1, 1, 2, 4, 2, 3, 2, 3, 4, 3, 4};
int main() {
cin >> n;
if (n<=20) {
int *arr = new int[n*100000];
for (int i=0; i<n*100000; i++) arr[i] = i>2 ? 0 : 1;
int sum = -3;
for (int i=0; i<n*100000; i++) sum += arr[i];
n += sum;
}
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 |
3 ms |
2296 KB |
Output is correct |
2 |
Correct |
2 ms |
2296 KB |
Output is correct |
3 |
Correct |
2 ms |
2296 KB |
Output is correct |
4 |
Correct |
2 ms |
2296 KB |
Output is correct |
5 |
Correct |
5 ms |
2296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
6420 KB |
Output is correct |
2 |
Correct |
6 ms |
3820 KB |
Output is correct |
3 |
Correct |
10 ms |
7676 KB |
Output is correct |
4 |
Correct |
10 ms |
8444 KB |
Output is correct |
5 |
Correct |
8 ms |
4860 KB |
Output is correct |
6 |
Correct |
7 ms |
4532 KB |
Output is correct |
7 |
Correct |
7 ms |
4092 KB |
Output is correct |
8 |
Correct |
6 ms |
3308 KB |
Output is correct |
9 |
Correct |
8 ms |
5244 KB |
Output is correct |
10 |
Correct |
8 ms |
5724 KB |
Output is correct |
11 |
Correct |
8 ms |
6012 KB |
Output is correct |
12 |
Correct |
10 ms |
8060 KB |
Output is correct |
13 |
Correct |
4 ms |
2924 KB |
Output is correct |
14 |
Correct |
4 ms |
2296 KB |
Output is correct |
15 |
Correct |
9 ms |
6780 KB |
Output is correct |
16 |
Correct |
4 ms |
2540 KB |
Output is correct |
17 |
Correct |
5 ms |
2296 KB |
Output is correct |
18 |
Correct |
11 ms |
7168 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
8444 KB |
Output is correct |
2 |
Correct |
3 ms |
8444 KB |
Output is correct |
3 |
Correct |
2 ms |
8444 KB |
Output is correct |
4 |
Correct |
2 ms |
8444 KB |
Output is correct |
5 |
Correct |
3 ms |
8444 KB |
Output is correct |
6 |
Correct |
3 ms |
8444 KB |
Output is correct |
7 |
Correct |
3 ms |
8444 KB |
Output is correct |
8 |
Correct |
2 ms |
8444 KB |
Output is correct |
9 |
Correct |
2 ms |
8444 KB |
Output is correct |
10 |
Correct |
3 ms |
8444 KB |
Output is correct |
11 |
Correct |
3 ms |
8444 KB |
Output is correct |
12 |
Correct |
2 ms |
8444 KB |
Output is correct |