답안 #44956

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
44956 2018-04-10T00:27:39 Z wzy Go, Gopher! (GCJ18Q_gogopher) C++11
30 / 30
81 ms 1332 KB
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define int long long // LEMBRAR DE TROCAR CASO PROBLEMA DE MEMORIA
#define pii pair<int,int>
#define ieps (int) 1e6
#define eps (int) 1e9
#define mp make_pair
#define pb push_back

bool vis[1001][1001];


int32_t main(){
	int t;
	cin>>t;
	while(t--){
		int a;
		cin>>a;
		int currx = 4 , curry = 4;
		for(int i = 0 ; i < 1001 ; i++)
			for(int j = 0 ; j < 1001 ; j++) vis[i][j]  = 0;
		while(true){
			cout<<currx<<" "<<curry<<endl;
			int a , b;
			cin>>a>>b;
			if(a == 0 && b == 0) break;
			else vis[a][b] = true;
			while(vis[currx - 1][curry - 1] && vis[currx][curry-1] && vis[currx + 1][curry - 1]){
				curry++;
			}			
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 1272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 81 ms 1332 KB Output is correct