제출 #245116

#제출 시각아이디문제언어결과실행 시간메모리
245116urd05동전 게임 (KOI15_coin)C++14
100 / 100
32 ms1280 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int k,c;
    scanf("%d %d",&k,&c);
    for(int i=0;i<c;i++) {
        int m,n;
        scanf("%d %d",&m,&n);
        if (m==n) {
            printf("1\n");
            continue;
        }
        if (m>n) {
            if (n+k-m+1<m-1) {
                printf("0\n");
            }
            else {
                printf("1\n");
            }
        }
        else {
            if (m+k-n<n-1) {
                printf("0\n");
            }
            else {
                printf("1\n");
            }
        }
    }
}

컴파일 시 표준 에러 (stderr) 메시지

coin.cpp: In function 'int main()':
coin.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&k,&c);
     ~~~~~^~~~~~~~~~~~~~~
coin.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&m,&n);
         ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...