結果

問題 No.486 3 Straight Win(3連勝)
ユーザー mMqrMruYrNII4TdmMqrMruYrNII4Td
提出日時 2017-03-10 21:32:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 59,428 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 10:58:24
合計ジャッジ時間 1,533 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

int main(){
	char str[101];
	
	scanf("%s", str);
	
	int len;
	
	len = strlen(str);
	
	if (len < 3) cout << "NA" << endl;
	
	FOR(i,2,len){
		if (str[i] == str[i-1] && str[i] == str[i-2]){
			if (str[i] == 'O') cout << "East" << endl;
			else cout << "West" << endl;
			
			break;
		}
		if (i == len-1) cout << "NA" << endl;
	}
	
	return 0;
}
0