結果

問題 No.486 3 Straight Win(3連勝)
ユーザー Kurichan0806Kurichan0806
提出日時 2017-10-31 19:29:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 66,988 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 01:45:14
合計ジャッジ時間 1,518 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
using namespace std;

int main(void) {
	string str;
	int west = 0, east = 0;
	cin >> str;
	for (int i = 0; i < str.size(); i++) {
		if (str[i] == 'O')		west++;
		else if (str[i] == 'X')	east++;
		if (west >= 3) {
			cout << "West" << endl;
			return 0;
		}
		else if(east >= 3) {
			cout << "East" << endl;
			return 0;
		}
	}
	cout << "NA" << endl;
	return 0;
}
0