Submission #930934

#TimeUsernameProblemLanguageResultExecution timeMemory
930934rainboy동전 게임 (KOI15_coin)C11
100 / 100
22 ms1372 KiB
#include <stdio.h>

int main() {
	int n, q;

	scanf("%d%d", &n, &q);
	while (q--) {
		int x, y;

		scanf("%d%d", &x, &y);
		if (x > y)
			printf("%d\n", y + (n - x + 1) >= x - 1 ? 1 : 0);
		else if (x < y)
			printf("%d\n", x + (n - y) >= y - 1 ? 1 : 0);
		else
			printf("1\n");
	}
	return 0;
}

Compilation message (stderr)

coin.c: In function 'main':
coin.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d%d", &n, &q);
      |  ^~~~~~~~~~~~~~~~~~~~~
coin.c:10:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   scanf("%d%d", &x, &y);
      |   ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...