This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int T, A;
int main() {
ios_base::sync_with_stdio(0);
cin >> T;
for (int q = 0; q < T; q++) {
cin >> A;
int x = 2;
int b = 0;
bool done[3][3];
memset(done, 0, sizeof done);
while (true) {
cout << x << " 2" << endl;
int i, j;
cin >> i >> j;
if (i == 0 && j == 0) break;
if (i == -1 && j == -1) return 0;
if (!done[i-x+1][j-1]) {
done[i-x+1][j-1] = 1;
b++;
}
if (b == 9) {
x += 3;
b = 0;
memset(done, 0, sizeof done);
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |