답안 #71656

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
71656 2018-08-25T10:10:05 Z team(#2232, comfile) 천사의 모래시계 (FXCUP3_hourglass) C++
0 / 100
3 ms 868 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;scanf("%d",&n);
    int ans=1e9;
    for(int i=1;i<=n/3; i++){
        if(!((n-3*i)%5)){
            ans=min(ans,i+(n-3*i)/5);
        }
    }
    if(ans>=1e9) ans=-1;
    printf("%d\n",ans);
    return 0;
}

Compilation message

hourglass.cpp: In function 'int main()':
hourglass.cpp:4:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int n;scanf("%d",&n);
           ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 3 ms 444 KB Output isn't correct
3 Incorrect 2 ms 440 KB Output isn't correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 692 KB Output is correct
2 Incorrect 3 ms 612 KB Output isn't correct
3 Correct 2 ms 692 KB Output is correct
4 Incorrect 3 ms 776 KB Output isn't correct
5 Correct 2 ms 692 KB Output is correct
6 Correct 3 ms 692 KB Output is correct
7 Correct 2 ms 776 KB Output is correct
8 Correct 2 ms 692 KB Output is correct
9 Correct 3 ms 444 KB Output is correct
10 Correct 3 ms 612 KB Output is correct
11 Correct 3 ms 692 KB Output is correct
12 Correct 2 ms 776 KB Output is correct
13 Correct 2 ms 776 KB Output is correct
14 Incorrect 3 ms 692 KB Output isn't correct
15 Incorrect 2 ms 692 KB Output isn't correct
16 Correct 2 ms 612 KB Output is correct
17 Correct 3 ms 776 KB Output is correct
18 Incorrect 3 ms 692 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 776 KB Output is correct
2 Correct 2 ms 776 KB Output is correct
3 Correct 2 ms 868 KB Output is correct
4 Incorrect 2 ms 868 KB Output isn't correct
5 Correct 2 ms 776 KB Output is correct
6 Incorrect 3 ms 868 KB Output isn't correct
7 Correct 2 ms 776 KB Output is correct
8 Correct 2 ms 776 KB Output is correct
9 Correct 2 ms 776 KB Output is correct
10 Correct 2 ms 776 KB Output is correct
11 Correct 2 ms 776 KB Output is correct
12 Correct 2 ms 868 KB Output is correct