結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2018-01-15 21:39:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 808 bytes |
コンパイル時間 | 554 ms |
コンパイル使用メモリ | 56,920 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 03:29:37 |
合計ジャッジ時間 | 1,171 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 14 |
ソースコード
#include<iostream>#include<vector>#include<string>#include<cstdio>using namespace std;int main(){string s;int count=1,flag=0,i;cin >> s;for(i=1;s[i]!='\0';i++){if(s[i]==s[i-1]){count++;if(count==3){if(s[i]=='O'){cout << "East";return 0;}else{cout << "West";return 0;}}}else{count=0;}}count++;if(count==3){if(s[i]=='O'){cout << "East";return 0;}else{cout << "West";return 0;}}cout << "NA\n";return 0;}