結果
| 問題 | No.2564 衝突予測 | 
| コンテスト | |
| ユーザー |  yumekawayui | 
| 提出日時 | 2023-12-02 15:21:05 | 
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 56 ms / 2,000 ms | 
| コード長 | 2,472 bytes | 
| コンパイル時間 | 2,837 ms | 
| コンパイル使用メモリ | 189,568 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-26 18:31:11 | 
| 合計ジャッジ時間 | 4,604 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 | 
ソースコード
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/extc++.h>
using namespace std;
using ld = long double; 
const vector<int> dx = {0, 0, 1, -1};
const vector<int> dy = {1, -1, 0, 0};
#define vec vector
#define int long long
#define double long double
//cout<<setprecision(10)<<fixed<<..
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repp(i, x, n) for (int i = x; i < (int)(n); i++)
#define pii pair<int,int>
#define pq priority_queue
#define all(V) begin(V),end(V)
#define printpair(p) cout<<p.first<<" "<<p.second<<"\n"
#define tple tuple<int,int,int>
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }
#define mend(a,b) G[a].push_back(b)
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;cin>>t;
    rep(i,t){
        int a,b;
        char c;
        cin>>a>>b>>c;
        int x,y;
        char z;
        cin>>x>>y>>z;
        if(x==a&&(y>b&&z=='D'&&c=='U')){
            cout<<"Yes\n";continue;
        }
        if(x==a&&(b>y&&c=='D'&&z=='U')){
            cout<<"Yes\n";continue;
        }
        if(y==b&&(x>a&&z=='L'&&c=='R')){
            cout<<"Yes\n";continue;
        }
        if(y==b&&(x<a&&z=='R'&&c=='L')){
            cout<<"Yes\n";continue;
        }
        if(abs(a-x)==abs(b-y)){
            if(a>x&&b>y){
                if(c=='L'&&z=='U'){
                    cout<<"Yes\n";continue;
                }
                if(c=='D'&&z=='R'){
                    cout<<"Yes\n";continue;
                }
            }
            if(a>x&&b<y){
                if(c=='U'&&z=='R'){
                    cout<<"Yes\n";continue;
                }
                if(c=='L'&&z=='D'){
                    cout<<"Yes\n";continue;
                }
            }
            if(a<x&&b<y){
                if(c=='U'&&z=='L'){
                    cout<<"Yes\n";continue;
                }
                if(c=='R'&&z=='D'){
                    cout<<"Yes\n";continue;
                }
            }
            if(a<x&&b>y){
                if(c=='R'&&z=='U'){
                    cout<<"Yes\n";continue;
                }
                if(c=='D'&&z=='L'){
                    cout<<"Yes\n";continue;
                }
            }
        }
        cout<<"No\n";
    }
    
}
            
            
            
        