Submission #232152

# Submission time Handle Problem Language Result Execution time Memory
232152 2020-05-16T09:50:28 Z palpatinezw Go, Gopher! (GCJ18Q_gogopher) C++14
10 / 30
10000 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

int T;

int main() {
	cin >> T;
	while (T--) {
		int A;
		cin >> A;
		assert(A==20||A==200);
		if (A==20) {
			int ii, ij;
			while (true) {
				for (int i = 2; i < 3; i++) {
					for (int j = 2; j < 7; j++) {
						cout << i << ' ' << j << '\n';
						cout << flush;
						cin >> ii >> ij;
						if (ii == -1) return 0;
						if (ii==0) break;
					}
					if (ii==0) break;
				}
				if (ii==0) break;
			}
		} else {
			int ii, ij;
			bool jb[4][68];
			memset(jb, 0, sizeof jb);
			while (true) {
				
				for (int i = 2; i < 3; i++) {
					for (int j = 2; j < 67; j++) {
						if ( (jb[1][j-1] && jb[2][j-1] && jb[3][j-1]) || (jb[1][j+1] && jb[2][j+1] && jb[3][j+1]) ) continue;
						cout << i << ' ' << j << '\n';
						cout << flush;
						cin >> ii >> ij;
						jb[ii][ij] = 1;
						if(ii == -1) return 0;
						if (ii==0) break;
					}
					if (ii==0) break;
				}
				if (ii==0) break;
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 23 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 10076 ms 384 KB Time limit exceeded