結果

問題 No.486 3 Straight Win(3連勝)
ユーザー Gamer13
提出日時 2017-08-30 13:12:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 1,326 ms
コンパイル使用メモリ 159,556 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 04:32:07
合計ジャッジ時間 2,196 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define FORR(i,l,n) for(int (i)=l;(i)<(int)(n);++(i))
void solve() {
	std::string S;
	cin >> S;
	int east = S.find("OOO");
	int west = S.find("XXX");
	if (east == string::npos && west == string::npos) {
		std::cout << "NA" << std::endl;
	}
	else if (string::npos != east &&  east < west || west == string::npos) {
		std::cout << "East" << std::endl;
	}
	else if (string::npos != west && west < east || east == string::npos) {
		std::cout << "West" << std::endl;
	}
}
int main() {
	ios::sync_with_stdio(false);
	solve();
	return 0;
}
0