#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 |
1 |
Correct |
52 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
440 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |