結果

問題 No.1588 Connection
ユーザー inksamuraiinksamurai
提出日時 2021-07-09 18:38:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
QLE  
(最初)
実行時間 -
コード長 1,981 bytes
コンパイル時間 1,297 ms
コンパイル使用メモリ 132,584 KB
実行使用メモリ 24,324 KB
平均クエリ数 1.00
最終ジャッジ日時 2023-09-24 12:03:06
合計ジャッジ時間 4,057 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,352 KB
testcase_01 WA -
testcase_02 AC 26 ms
24,168 KB
testcase_03 AC 26 ms
24,252 KB
testcase_04 AC 26 ms
23,652 KB
testcase_05 AC 26 ms
23,316 KB
testcase_06 AC 27 ms
24,168 KB
testcase_07 AC 27 ms
23,868 KB
testcase_08 AC 26 ms
23,064 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 26 ms
23,472 KB
testcase_15 AC 28 ms
23,508 KB
testcase_16 AC 27 ms
23,460 KB
testcase_17 AC 26 ms
23,244 KB
testcase_18 AC 27 ms
23,844 KB
testcase_19 AC 27 ms
23,568 KB
testcase_20 AC 29 ms
24,096 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 29 ms
24,324 KB
testcase_26 AC 29 ms
23,484 KB
testcase_27 AC 28 ms
23,328 KB
testcase_28 AC 27 ms
23,316 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <tuple>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <functional>
#include <numeric>
#include <iomanip> 
#include <stdio.h>
#include <assert.h>
//eolibraries
#define lnf 3999999999999999999
#define inf 999999999
#define fi first
#define se second
#define pb push_back
#define ll long long
#define ld long double
#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define pii pair <int,int>
#define rep(i,n) for(int i = 0 ; i < n ; i++) 
#define drep(i,n) for(int i = n-1 ; i >= 0 ; i--)
#define crep(i,x,n) for(int i = x ; i < n ; i++)
#define vi vector <int> 
#define vec(...) vector<__VA_ARGS__>
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
//eodefine
using namespace std;

const int max_n = 103002;
const int di[]={1,-1,0,0};
const int dj[]={0,0,1,-1};

int main(){
fcin;
	int n,m;
	cin>>n>>m;

	vec(vi) a(n,vi(n,-1));
	a[0][0]=a[n-1][n-1]=1;
	queue<pii> que;
	que.push({0,0});
	function<void(int,int)> ask = [&](int x,int y){
		cout<<x+1<<" "<<y+1<<"\n";
		string s;
		cin>>s;
		if(s=="Black") a[x][y]=1;
		else a[x][y]=0;
		return;
	};
	auto ok = [&](int x,int y){
		bool pok=0;
		if(min(x,y)<0) return pok;
		if(max(x,y)>=n) return pok;
		return pok=1;
	};
	// while(sz(que)){
	// 	pii p = que.front();
	// 	que.pop();
	// 	if(p.fi==n-1 and p.se==n-1){
	// 		cout<<"Yes\n";
	// 		exit(0);
	// 	}
	// 	rep(i,4){
	// 		int nex=p.fi+di[i],ney=p.se+dj[i];
	// 		if(!ok(nex,ney)) continue;
	// 		if(a[nex][ney]==0) continue;
	// 		if(a[nex][ney]==-1) ask(nex,ney);
	// 		if(a[nex][ney]==1){
	// 			que.push({nex,ney});
	// 			// cout<<sz(que)<<"here\n";
	// 		}
	// 	}
	// }
	ok(0,0);
	cout<<"No\n";
/*
*/
	return 0;
}
0