#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
#define mp make_pair
int main(){
int tc;
cin >> tc;
int gridx[6] = {2, 5, 8, 11, 14, 17};
int gridy[4] = {2, 5, 8, 11};
while (tc--){
int a;
cin >> a;
bool found=0;
for (int i=0; i<6; i++){
for(int j=0; j<4; j++){
set<ii> s;
while (s.size() != 9){
cout << gridx[i] << " " << gridy[j] << '\n';
cout.flush();
int x, y;
cin >> x >> y;
if (x==0 && y==0){
found=1;
break;
} else s.insert(mp(x,y));
}
if (found) break;
}
if (found) break;
}
if (found) continue;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
111 ms |
256 KB |
Output is correct |