結果
| 問題 | No.486 3 Straight Win(3連勝) |
| コンテスト | |
| ユーザー |
f843nmfwisfeuw
|
| 提出日時 | 2020-08-18 17:55:38 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 920 bytes |
| 記録 | |
| コンパイル時間 | 688 ms |
| コンパイル使用メモリ | 107,640 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-28 13:53:46 |
| 合計ジャッジ時間 | 2,334 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>
#include <set>
#include <queue>
#include <bitset>
#include <cassert>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
if (N < 3) {
cout << "NA" << endl;
} else {
assert(N >= 1);
pair<char, int> p;
p.first = S[0];
p.second = 1;
string res = "NA";
for (int i = 1; i < N; ++i) {
if (p.first == S[i]) {
p.second += 1;
} else {
p.first = S[i];
p.second = 1;
}
if (p.second == 3) {
res = p.first == 'O' ? "East" : "West";
break;
}
}
cout << res << endl;
}
return 0;
}
f843nmfwisfeuw