結果
問題 | No.2564 衝突予測 |
ユーザー | 沙耶花 |
提出日時 | 2023-12-06 00:42:40 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 358 ms / 2,000 ms |
コード長 | 1,131 bytes |
コンパイル時間 | 4,776 ms |
コンパイル使用メモリ | 261,584 KB |
実行使用メモリ | 6,676 KB |
最終ジャッジ日時 | 2023-12-06 00:42:50 |
合計ジャッジ時間 | 10,297 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,676 KB |
testcase_01 | AC | 2 ms
6,676 KB |
testcase_02 | AC | 2 ms
6,676 KB |
testcase_03 | AC | 358 ms
6,676 KB |
testcase_04 | AC | 322 ms
6,676 KB |
testcase_05 | AC | 319 ms
6,676 KB |
testcase_06 | AC | 345 ms
6,676 KB |
testcase_07 | AC | 326 ms
6,676 KB |
testcase_08 | AC | 321 ms
6,676 KB |
testcase_09 | AC | 319 ms
6,676 KB |
testcase_10 | AC | 345 ms
6,676 KB |
testcase_11 | AC | 319 ms
6,676 KB |
ソースコード
#include <stdio.h> #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int _t; cin>>_t; rep(_,_t){ int a,b,d,e; char c,f; cin>>a>>b>>c>>d>>e>>f; b *= -1; e *= -1; if(c>f){ swap(a,d); swap(b,e); swap(c,f); } if(c==f){ cout<<"No"<<endl; continue; } if(c=='D'){ if(f=='R'){ f = 'L'; d -= 2*(d-a); } if(f=='L'){ if(e-b==d-a && d-a>=0){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; } else if(f=='U'){ if(a==d&&b<=e){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; } } else if(c=='L'){ if(f=='R'){ if(a>=d&&b==e){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; } else if(f=='U'){ if(a-d==e-b && e-b>=0){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; } } else if(c=='R'){ if(f=='U'){ if(d-a==e-b && e-b>=0){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; } } } return 0; }