結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2017-03-01 18:48:40 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 843 bytes |
コンパイル時間 | 672 ms |
コンパイル使用メモリ | 73,944 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 04:11:55 |
合計ジャッジ時間 | 1,565 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <algorithm>#include <cstdio>#include <iostream>#include <map>#include <math.h>#include <queue>#include <set>#include <sstream>#include <stack>#include <string>#include <string.h>#include <vector>using namespace std;#define ll long long#define INF (1 << 30)#define INFLL (1LL << 60)#define FOR(i,a,b) for(ll i = (a);i<(b);i++)#define REP(i,a) FOR(i,0,(a))#define MP make_pairint main() {string str;cin >> str;bool answered = false;int west = 0, east = 0;for(int i = 0;i < str.size();i++){if(str[i] == 'O'){east++;west = 0;}else{west++;east = 0;}if(answered == false && east == 3){answered = true;cout << "East" << endl;}else if(answered == false && west == 3){answered = true;cout << "West" << endl;}}if(!answered) cout << "NA" << endl;return 0;}