結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-09-19 01:48:18 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 409 ms |
コンパイル使用メモリ | 55,756 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-26 04:32:38 |
合計ジャッジ時間 | 1,353 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <iostream>#include <stdio.h>using namespace std;int main(void){string s;cin >> s;int e = 0;int w = 0;for (int i = 0; i < s.length(); i++){if (s[i] == 'O'){e++;w = 0;}else{w++;e = 0;}if (e == 3 || w == 3)break;}if (e == 3)printf("East\n");else if (w == 3)printf("West\n");elseprintf("NA\n");return 0;}