結果

問題 No.3598 Queen vs. King
コンテスト
ユーザー tau1235
提出日時 2026-07-24 22:25:20
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 539 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,948 ms
コンパイル使用メモリ 329,632 KB
実行使用メモリ 6,016 KB
平均クエリ数 2.67
最終ジャッジ日時 2026-07-24 22:25:25
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

void solve(){
	auto f=[&](int i1,int j1,int i2,int j2){
		int di=abs(i1-i2),dj=abs(j1-j2);
		if (di==0&&dj==0) return true;
		if (di==0||dj==0||di==dj) return true;
		return false;
	};
	int h,w;
	cin>>h>>w;
	int py=-1;
	int t=0;
	while (true){
		int x,y;
		cin>>x>>y;
		if (x==0) return;
		if (t==0){
			cout<<1<<" "<<y<<endl;
			py=y;
		}
		else if (t==1){
			cout<<x<<" "<<py<<endl;
		}
		else if (t==2){
			assert(0);
		}
		t++;
	}
}

int main(){
	int t=1;
	cin>>t;
	while (t--) solve();
}
0