이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |