結果
| 問題 | 
                            No.486 3 Straight Win(3連勝)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-09-12 01:00:47 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 553 bytes | 
| コンパイル時間 | 1,599 ms | 
| コンパイル使用メモリ | 166,164 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-26 04:32:23 | 
| 合計ジャッジ時間 | 2,511 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 28 | 
ソースコード
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define SZ(n) (int)(n).size()
#define ALL(n) (n).begin(), (n).end()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
int main() {
	string s;
	cin >> s;
	int w, e;
	e = (int)s.find("OOO");
	w = (int)s.find("XXX");
	if (w == e) {
		cout << "NA" << endl;
		return 0;
	}
	if (w == -1) {
		cout << "East" << endl;
	}
	else if (e == -1){
		cout << "West" << endl;
	}
	else {
		cout << ((w > e) ? "East" : "West") << endl;
	}
	return 0;
}