結果

問題 No.486 3 Straight Win(3連勝)
ユーザー zaichuzaichu
提出日時 2017-03-07 03:22:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 883 bytes
コンパイル時間 942 ms
コンパイル使用メモリ 94,016 KB
実行使用メモリ 5,064 KB
最終ジャッジ日時 2023-09-05 20:39:11
合計ジャッジ時間 2,562 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,504 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,380 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,380 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,384 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:34:21: 警告: 複数文字からなる文字定数 [-Wmultichar]
   34 |         if (s[i] == '◯') {
      |                     ^~~

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    
    string s;
    cin >> s;
    int west = 0;
    int east = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '◯') {
            east++;
            west = 0;
        } else {
            east = 0;
            west++;
        }
        if (west == 3) {
            cout << "West" << endl;
            break;
        }
        if (east == 3) {
            cout << "East" << endl;
            break;
        }
    }
    return 0;
}
0