結果
| 問題 | No.2564 衝突予測 | 
| コンテスト | |
| ユーザー |  ID 21712 | 
| 提出日時 | 2024-11-11 22:53:00 | 
| 言語 | Go (1.23.4) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 471 ms / 2,000 ms | 
| コード長 | 717 bytes | 
| コンパイル時間 | 12,983 ms | 
| コンパイル使用メモリ | 223,728 KB | 
| 実行使用メモリ | 6,272 KB | 
| 最終ジャッジ日時 | 2024-11-11 22:53:20 | 
| 合計ジャッジ時間 | 20,466 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 | 
ソースコード
package main
import . "fmt"
import . "os"
import bf "bufio"
func main() {
	rd:=bf.NewReader(Stdin)
	var t int
	Fscan(rd,&t)
	for ;t>0;t-- {
		var x1,y1,x2,y2 int
		var d1,d2 string
		Fscan(rd,&x1,&y1,&d1,&x2,&y2,&d2)
		d:=d1+d2
		var ans bool
		switch {
			case x1==x2&&y1<y2:
			ans=d=="UD"
			case x1==x2&&y1>y2:
			ans=d=="DU"
			case y1==y2&&x1<x2:
			ans=d=="RL"
			case y1==y2&&x1>x2:
			ans=d=="LR"
			case x1<x2&&y1<y2&&x2-x1==y2-y1:
			ans=d=="RD"||d=="UL"
			case x1<x2&&y1>y2&&x2-x1==y1-y2:
			ans=d=="RU"||d=="DL"
			case x1>x2&&y1<y2&&x1-x2==y2-y1:
			ans=d=="UR"||d=="LD"
			case x1>x2&&y1>y2&&x1-x2==y1-y2:
			ans=d=="LU"||d=="DR"
		}
		if ans {
			Println("Yes")
		} else {
			Println("No")
		}
	}
}
            
            
            
        