結果

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

ソースコード

diff #

#include <iostream>
using namespace std;

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