結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2023-07-31 23:25:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 649 bytes |
コンパイル時間 | 879 ms |
コンパイル使用メモリ | 104,556 KB |
最終ジャッジ日時 | 2025-02-15 21:12:11 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include<iostream> #include<string> #include<algorithm> #include<cctype> #include<set> #include<bitset> #include<math.h> #include<map> #include<queue> #include<iomanip> using namespace std; int main(){ int e = 0, w = 0; string s; cin >> s; for (int i = 0; i < s.size(); i++){ if (s[i] == 'O'){ e++; w = 0; } if (s[i] == 'X'){ w++; e = 0; } if (e == 3){ cout << "East" << endl; return 0; } if (w == 3){ cout << "West" << endl; return 0; } } cout << "NA" << endl; }