結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2018-09-05 22:23:03 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 646 bytes |
コンパイル時間 | 554 ms |
コンパイル使用メモリ | 64,368 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 17:22:50 |
合計ジャッジ時間 | 1,628 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
//inlclude前用define#define _USE_MATH_DEFINES//include#include<iostream>#include<string>#include<algorithm>#include<vector>#include<cmath>using namespace std;//typedeftypedef vector<int> VI;typedef vector<string> VS;typedef vector<char> VC;int main() {string s;cin >> s;int east = 0;int west = 0;int size = s.size();for (int i = 0; i < size; i++) {if (s[i] == 'O') {east++;west = 0;} else if (s[i] == 'X') {west++;east = 0;}if (west == 3) {cout << "West" << endl;return 0;} else if(east==3){cout << "East" << endl;return 0;}}cout << "NA" << endl;return 0;}