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 <iostream>
#include <vector>
using namespace std;
void go20() {
for(int i : {2, 3, 4}) {
for(int j : {2, 3}) {
for(int rep = 0; rep < 150; rep++) {
cout << i << " " << j << endl;
int x, y; cin >> x >> y;
if(x == 0 && y == 0) {
return;
}
}
}
}
}
void go200() {
vector< vector<bool> > vec(4, vector<bool>(100));
for(int j = 2; j <= 68; j += 3) {
while(true) {
cout << 2 << " " << j << endl;
int x, y; cin >> x >> y;
if(x == 0 && y == 0) break;
vec[x][y] = true;
int cnt = 0;
for(int dx=-1; dx<=1; dx++) {
for(int dy=-1; dy<=1; dy++) {
if(vec[2+dx][j+dy]) cnt += 1;
}
}
if(cnt == 9) break;
}
}
}
int main() {
int T, A;
cin >> T >> A;
while(T--) {
if(A == 20) go20();
else go200();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |