提出 #40863765


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    char tmp;
    int ans = -1;
    int L = 0;
    bool flag = false;
     for (int i=0; i<N; i++) {
        cin >> tmp;
        if (tmp == 'o') {
            L++;
        } else if (tmp == '-') {
            if (L > ans) ans = L;
            L = 0;
            flag = true;
        }
     }

     if (flag && L > ans) {
        ans = L;
     }

    if (ans > 0) {
        cout << ans << endl;
    } else {
        cout << -1 << endl;
    }

    return 0;
}

提出情報

提出日時
問題 C - Dango
ユーザ albert1313
言語 C++ (GCC 9.2.1)
得点 300
コード長 574 Byte
結果 AC
実行時間 17 ms
メモリ 3628 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 29
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 01_small_06.txt, 01_small_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 03_handmade_17.txt, 03_handmade_18.txt, 03_handmade_19.txt, 03_handmade_20.txt, 03_handmade_21.txt, 03_handmade_22.txt, 03_handmade_23.txt, 03_handmade_24.txt, 03_handmade_25.txt, 03_handmade_26.txt, 03_handmade_27.txt, 03_handmade_28.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 5 ms 3624 KiB
00_sample_01.txt AC 2 ms 3592 KiB
00_sample_02.txt AC 2 ms 3424 KiB
01_small_03.txt AC 2 ms 3560 KiB
01_small_04.txt AC 2 ms 3428 KiB
01_small_05.txt AC 2 ms 3500 KiB
01_small_06.txt AC 2 ms 3420 KiB
01_small_07.txt AC 3 ms 3560 KiB
02_random_08.txt AC 17 ms 3424 KiB
02_random_09.txt AC 14 ms 3424 KiB
02_random_10.txt AC 13 ms 3428 KiB
02_random_11.txt AC 7 ms 3628 KiB
02_random_12.txt AC 9 ms 3520 KiB
02_random_13.txt AC 5 ms 3620 KiB
02_random_14.txt AC 3 ms 3548 KiB
02_random_15.txt AC 7 ms 3556 KiB
02_random_16.txt AC 11 ms 3504 KiB
03_handmade_17.txt AC 11 ms 3572 KiB
03_handmade_18.txt AC 3 ms 3504 KiB
03_handmade_19.txt AC 13 ms 3428 KiB
03_handmade_20.txt AC 12 ms 3544 KiB
03_handmade_21.txt AC 13 ms 3620 KiB
03_handmade_22.txt AC 12 ms 3552 KiB
03_handmade_23.txt AC 12 ms 3408 KiB
03_handmade_24.txt AC 12 ms 3520 KiB
03_handmade_25.txt AC 10 ms 3404 KiB
03_handmade_26.txt AC 12 ms 3564 KiB
03_handmade_27.txt AC 11 ms 3560 KiB
03_handmade_28.txt AC 8 ms 3516 KiB