結果

問題 No.486 3 Straight Win(3連勝)
ユーザー fumi6328
提出日時 2018-08-25 12:26:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 593 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 55,156 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 12:18:31
合計ジャッジ時間 1,898 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s;
    cin >> s;

    int east = 0,west = 0;
    for(int i = 0; i < s.length(); i++){
        if(s[i]=='O'){
            east++;
            west = 0;
            if(east == 3){
                cout << "East\n" << endl;
                return 0; 
            }
        }else{
            west++;
            east = 0;
            if(west == 3){
                cout << "West\n" << endl;
                return 0;
            }
        }
    }
    cout << "NA\n";

    return 0;
}
0