結果

問題 No.486 3 Straight Win(3連勝)
ユーザー severrabaen
提出日時 2019-01-02 16:30:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 767 ms
コンパイル使用メモリ 79,148 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-20 20:54:43
合計ジャッジ時間 1,710 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
using namespace std;
#define Would
#define you

int w, e;
int main() {
	string h, ans;
	cin >> h;
	for (int i = 0; i < h.length(); ++i) {
		if (h[i] == 'O') {
			++e;
			w = 0;
		}
		else {
			++w;
			e = 0;
		}
		if (w == 3) {
			cout << "West" << endl;
			return 0;
		}
		else if (e == 3) {
			cout << "East" << endl;
			return 0;
		}
	}
	cout << "NA" << endl;
}
0