結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
	string str;
	cin >> str;
	string w = "XXX";
	string e = "OOO";
	
	for(int i = 0; i < str.length() - 2; i++){
		if(str.length() < 3) break;
		string s = str.substr(i, 3);
		if(s == w){
			cout << "West" << endl;
			return 0;
		}else if(s == e){
			cout << "East" << endl;
			return 0;
		}
	}
	
	cout << "NA" << endl;
}
0