Submission #894008

# Submission time Handle Problem Language Result Execution time Memory
894008 2023-12-27T19:10:15 Z rainboy Go, Gopher! (GCJ18Q_gogopher) C
30 / 30
52 ms 344 KB
#include <stdio.h>

#define N	69

int main() {
	int t;

	scanf("%d", &t);
	while (t--) {
		int x, x_, y_, b;

		scanf("%*d");
		for (x = 2; x <= N; x += 3) {
			b = 0;
			while (b != (1 << 9) - 1) {
				printf("%d 2\n", x), fflush(stdout);
				scanf("%d%d", &x_, &y_);
				if (x_ == 0 && y_ == 0)
					goto out;
				b |= 1 << (x_ - x + 1) * 3 + (y_ - 1);
			}
		}
out:;
	}
	return 0;
}

Compilation message

gogopher.c: In function 'main':
gogopher.c:20:32: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   20 |     b |= 1 << (x_ - x + 1) * 3 + (y_ - 1);
      |               ~~~~~~~~~~~~~~~~~^~~~~~~~~~
gogopher.c:8:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  scanf("%d", &t);
      |  ^~~~~~~~~~~~~~~
gogopher.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%*d");
      |   ^~~~~~~~~~~~
gogopher.c:17:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     scanf("%d%d", &x_, &y_);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 7 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 344 KB Output is correct