結果
問題 |
No.486 3 Straight Win(3連勝)
|
ユーザー |
![]() |
提出日時 | 2019-04-05 12:00:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 1,673 ms |
コンパイル使用メモリ | 155,680 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-03 02:36:05 |
合計ジャッジ時間 | 2,845 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include "bits/stdc++.h" using namespace std; int main() { string S; int E = 0, W = 0; cin >> S; for (int i = 0; i < S.size(); i++) { if (S[i] == 'O') E++, W = 0; else W++, E = 0; if (E == 3 || W == 3) break; } if (E == 3) cout << "East"; else if (W == 3) cout << "West"; else cout << "NA"; cout << endl; }