답안 #51607

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
51607 2018-06-19T05:50:14 Z baneling100 동전 게임 (KOI15_coin) C++17
100 / 100
63 ms 5328 KB
#include <cstdio>

int K, C, M, N;

int main() {

    int i;

    scanf("%d %d", &K, &C);
    for(i = 1; i <= C; i++) {
        scanf("%d %d", &M, &N);
        if(M > N) printf("%d\n", N + K >= 2 * (M - 1));
        else if(M < N) printf("%d\n", M + K >= 2 * N - 1);
        else printf("1\n");
    }

    return 0;
}

Compilation message

coin.cpp: In function 'int main()':
coin.cpp:9: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:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &M, &N);
         ~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 2 ms 360 KB Output is correct
3 Correct 2 ms 600 KB Output is correct
4 Correct 3 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 804 KB Output is correct
2 Correct 3 ms 804 KB Output is correct
3 Correct 3 ms 804 KB Output is correct
4 Correct 3 ms 804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 804 KB Output is correct
2 Correct 3 ms 804 KB Output is correct
3 Correct 6 ms 804 KB Output is correct
4 Correct 49 ms 1300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 1300 KB Output is correct
2 Correct 4 ms 1300 KB Output is correct
3 Correct 19 ms 1828 KB Output is correct
4 Correct 30 ms 2256 KB Output is correct
5 Correct 52 ms 3028 KB Output is correct
6 Correct 63 ms 4016 KB Output is correct
7 Correct 35 ms 4568 KB Output is correct
8 Correct 59 ms 5328 KB Output is correct