結果

問題 No.486 3 Straight Win(3連勝)
ユーザー はまやんはまやん
提出日時 2017-02-24 22:23:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 1,632 ms
コンパイル使用メモリ 166,716 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 03:52:10
合計ジャッジ時間 2,474 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)





string S;
//-----------------------------------------------------------------
string sol() {
	char pre = 0;
	int cnt = 0;
	rep(i, 0, S.length()) {
		if (pre != S[i]) {
			pre = S[i];
			cnt = 1;
		}
		else {
			cnt++;
			if (3 <= cnt) {
				if (pre == 'O') return "East";
				else return "West";
			}
		}
	}
	return "NA";
}
//-----------------------------------------------------------------
int main() {
	cin >> S;
	cout << sol() << endl;
}
0