結果

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

ソースコード

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