結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2017-08-05 06:31:26 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 487 ms |
コンパイル使用メモリ | 61,388 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-26 04:31:33 |
合計ジャッジ時間 | 1,433 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <iostream>#include <fstream>#include <string>#include <vector>int main(void) {//std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf());unsigned int e = 0, w = 0;std::string S;std::cin >> S;for (unsigned int i = 0; i < S.length(); i++) {if (S[i] == 'O') {e++;w = 0;if (e == 3) {std::cout << "East" << std::endl;return 0;}}else {w++;e = 0;if (w == 3) {std::cout << "West" << std::endl;return 0;}}}std::cout << "NA" << std::endl;return 0;}