結果
問題 | No.2564 衝突予測 |
ユーザー |
👑 |
提出日時 | 2023-12-02 15:29:04 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,134 bytes |
コンパイル時間 | 4,214 ms |
コンパイル使用メモリ | 250,472 KB |
最終ジャッジ日時 | 2025-02-18 04:38:38 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 5 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’: main.cpp:36:9: warning: ‘z1’ may be used uninitialized [-Wmaybe-uninitialized] 36 | if(z1 == z2){ | ^~ main.cpp:29:13: note: ‘z1’ was declared here 29 | int z1, z2; | ^~ main.cpp:36:9: warning: ‘z2’ may be used uninitialized [-Wmaybe-uninitialized] 36 | if(z1 == z2){ | ^~ main.cpp:29:17: note: ‘z2’ was declared here 29 | int z1, z2; | ^~
ソースコード
#include<bits/stdc++.h>#include<atcoder/all>#define rep(i,n) for(int i=0;i<n;i++)using namespace std;using namespace atcoder;typedef long long ll;typedef vector<int> vi;typedef vector<long long> vl;typedef vector<vector<int>> vvi;typedef vector<vector<long long>> vvl;typedef long double ld;typedef pair<int, int> P;ostream& operator<<(ostream& os, const modint& a) {os << a.val(); return os;}template <int m> ostream& operator<<(ostream& os, const static_modint<m>& a) {os << a.val(); return os;}template<typename T> istream& operator>>(istream& is, vector<T>& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;}template<typename U, typename T> ostream& operator<<(ostream& os, const pair<U, T>& p){os << p.first << ' ' << p.second; return os;}template<typename T> ostream& operator<<(ostream& os, const vector<T>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); returnos;}template <typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : "");return os;}string t = "RLUD";void solve(){pair<long long, long long> p1, p2;long long x1, y1, x2, y2;char c1, c2;cin >> p1.first >> p1.second >> c1;cin >> p2.first >> p2.second >> c2;int z1, z2;rep(i, 4){if(c1 == t[i]) z1 = i;}rep(i, 4){if(c2 == t[i]) z2 = i;}if(z1 == z2){cout << "No\n";return;}if(z1 + z2 == 1){if(z2 == 0){swap(p1, p2);swap(z1, z2);}if(p1.second == p2.second) cout << "Yes\n";else cout << "No\n";return;}if(z1 + z2 == 5){if(z2 == 2){swap(p1, p2);swap(z1, z2);}if(p1.first == p2.first) cout << "Yes\n";else cout << "No\n";return;}if(z1 == 2 or z1 == 3){swap(p1, p2);swap(z1, z2);}if(z1 == 1){p1.first *= -1;p2.first *= -1;z1 = 0;}if(z2 == 3){p1.second *= -1;p2.second *= -1;z2 = 2;}if(p1.first + p1.second == p2.first + p2.second){if(p1.first < p2.first) cout << "Yes\n";else cout << "No\n";}else cout << "No\n";return;}int main(){int t;cin >> t;rep(_, t) solve();return 0;}