結果

問題 No.486 3 Straight Win(3連勝)
ユーザー momoyuu
提出日時 2024-09-30 00:16:20
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 928 ms
コンパイル使用メモリ 91,604 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-09-30 00:16:22
合計ジャッジ時間 2,083 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    string s;
    cin>>s;
    int n = s.size();
    for(int i = 1;i+1<n;i++){
        if(s[i]==s[i-1]&&s[i]==s[i+1]){
            if(s[i]=='O'){
                cout<<"East\n";
                return 0;
            }else{
                cout<<"West\n";
                return 0;
            }
        }
    }
    cout<<"NA\n";
}

0