結果
問題 |
No.197 手品
|
ユーザー |
![]() |
提出日時 | 2023-11-05 19:13:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,052 bytes |
コンパイル時間 | 2,064 ms |
コンパイル使用メモリ | 193,776 KB |
最終ジャッジ日時 | 2025-02-17 19:26:59 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 31 WA * 12 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<iomanip> #include<string> #include<algorithm> #include<vector> #include<set> #include<list> #include<queue> #include<math.h> #include<bitset> using ll = long long; using namespace std; int main(){ string a, b, f = "FAILURE", s = "SUCCESS"; int n, an = 0, bn = 0; cin >> b >> n >> a; bool yes = false; for (int i = 0; i < 3; i++){ if (b[i] == 'o') bn++; if (a[i] == 'o') an++; } if (an != bn) cout << s << endl; else if (n >= 2) cout << f << endl; else { if (bn == 1){ if (b[0] == 'o' && a[2] == 'o') cout << s << endl; else if (b[2] == 'o' && a[0] == 'o') cout << s << endl; else if (b[1] == 'o' && a[1] == 'x') cout << s << endl; } else if (bn == 2){ if (b[0] == 'x' && a[2] == 'x') cout << s << endl; else if (b[2] == 'x' && a[0] == 'x') cout << s << endl; else if (b[1] == 'x' && a[1] == 'o') cout << s << endl; } else cout << f << endl; } }