結果

問題 No.486 3 Straight Win(3連勝)
ユーザー r2en_
提出日時 2017-02-27 11:07:36
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 53,636 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 04:10:45
合計ジャッジ時間 1,192 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(void){
    int i = 0;
    int flag = 0;
    char s;
    char *str;
    str = new char[100];

    while(cin.get(s)){
        str[i] = s;
        if(str[i-2] == 'O' && str[i-1] == 'O' && str[i] == 'O'){cout << "East\n";flag = 1;break;}
        else if(str[i-2] == 'X' && str[i-1] == 'X' && str[i] == 'X'){cout << "West\n";flag = 1;break;}
        if(s == '\n')break;
        i++;
    }
    if(flag == 0){
        cout << "NA\n";
    }
    return (0);
}
0