# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
45037 | TAMREF | 무제 (GCJ18Q_gogopher) | C++17 | 86 ms | 1816 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
bool q[21][1005][1005];
inline bool full(int f, int r, int c){
return q[f][r-1][c-1] & q[f][r-1][c] & q[f][r-1][c+1] & q[f][r][c-1] & q[f][r][c] & q[f][r][c+1] & q[f][r+1][c-1] & q[f][r+1][c] & q[f][r+1][c+1];
}
int main(){
int T, A; scanf("%d",&T);
for(int f = 1; f <= T; f++){
scanf("%d",&A);
int cx = 1, cy = 1, xtr = 2, ytr = 2;
for(int loop = 1;;++loop){
if(cx == 0 && cy == 0) break;
if(cx == -1 && cy == -1){
//fprintf(stderr,"We're doomed\n");
exit(0);
}
//fprintf(stderr,"%d\n",loop);
printf("%d %d\n",xtr,ytr);
fflush(stdout);
scanf("%d %d",&cx,&cy);
q[f][cx][cy] = 1;
if(full(f,xtr,ytr)){
xtr += 3;
if(xtr > 999){
xtr = 2;
ytr += 3;
}
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |