結果

問題 No.486 3 Straight Win(3連勝)
ユーザー 👑 obakyan
提出日時 2019-03-19 09:53:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 625 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 59,684 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-13 12:50:54
合計ジャッジ時間 1,332 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>

int main()
{
    std::string s;
    int o, x;
    o=0;x=0;
    std::cin >> s;
    for(auto i = s.begin(); i != s.end(); i++){
        if(*i == 'O'){
            x = 0;
            o++;
            if(o == 3){
                std::cout << "East" << std::endl;
                return 0;
            }
        } else if(*i == 'X'){
            o = 0;
            x++;
            if(x == 3){
                std::cout << "West" << std::endl;
                return 0;
            }
        }
    }
    std::cout << "NA" << std::endl;  
    return 0;
}
0