#include <cstdio>
int a[20]={0,0,0,1,-1,1,2,4,2,3,2,3,4,3,4,3};
int main(){
int N;
scanf("%d",&N);
if(N<16) printf("%d",a[N]);
else{
if(N%5==0) return N/5;
else if(N%5==1 || N%5==3) return N/5+1;
else return N/5+2;
}
}
Compilation message
hourglass.cpp: In function 'int main()':
hourglass.cpp:5:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&N);
~~~~~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
508 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
2 ms |
508 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
1 ms |
356 KB |
Execution failed because the return code was nonzero |
4 |
Correct |
2 ms |
248 KB |
Output is correct |
5 |
Runtime error |
2 ms |
432 KB |
Execution failed because the return code was nonzero |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
2 |
Correct |
2 ms |
508 KB |
Output is correct |
3 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
4 |
Correct |
2 ms |
576 KB |
Output is correct |
5 |
Correct |
3 ms |
508 KB |
Output is correct |
6 |
Runtime error |
3 ms |
628 KB |
Execution failed because the return code was nonzero |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
2 ms |
508 KB |
Output is correct |
9 |
Runtime error |
2 ms |
592 KB |
Execution failed because the return code was nonzero |
10 |
Correct |
2 ms |
508 KB |
Output is correct |
11 |
Correct |
2 ms |
592 KB |
Output is correct |
12 |
Correct |
2 ms |
508 KB |
Output is correct |
13 |
Correct |
2 ms |
508 KB |
Output is correct |
14 |
Correct |
2 ms |
508 KB |
Output is correct |
15 |
Correct |
3 ms |
592 KB |
Output is correct |
16 |
Correct |
2 ms |
544 KB |
Output is correct |
17 |
Correct |
3 ms |
576 KB |
Output is correct |
18 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
3 |
Incorrect |
2 ms |
628 KB |
Output isn't correct |
4 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
5 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
6 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
1 ms |
628 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
10 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
11 |
Runtime error |
2 ms |
628 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
1 ms |
628 KB |
Execution failed because the return code was nonzero |