結果

問題 No.2564 衝突予測
ユーザー
提出日時 2024-07-24 11:30:18
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 744 bytes
コンパイル時間 13,082 ms
コンパイル使用メモリ 387,792 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-24 11:30:43
合計ジャッジ時間 16,982 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

fn g() -> (i64, i64, (i64, i64)) {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	let mut w = s.split_whitespace();
	(
		w.next().unwrap().parse().unwrap(),
		w.next().unwrap().parse().unwrap(),
		match w.next().unwrap() {
			"R" => (1, 0),
			"L" => (-1, 0),
			"U" => (0, 1),
			_ => (0, -1),
		},
	)
}
fn main() {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	for _ in 0..s.trim().parse::<u64>().unwrap() {
		let (a, b, (c, d)) = g();
		let (mut x, mut y, (mut u, mut v)) = g();
		x -= a;
		y -= b;
		u -= c;
		v -= d;
		println!(
			"{}",
			if u == 0 && v == 0
				|| x * u > 0 || y * v > 0
				|| x != 0 && u == 0
				|| y != 0 && v == 0
			{
				"No"
			} else {
				"Yes"
			}
		);
	}
}
0