提出 #65652316


ソースコード 拡げる

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

const int MAXN = 105;
int a[MAXN];
bool b[MAXN];

int main() {
    bool f = 1;
    int N, M, i;
    cin >> N >> M;
    for (i = 1; i <= N && f; i ++) {
        f = 0;
        cin >> a[i];
        b[a[i]] = 1;
        for (int j = 1; j <= M; j ++) {
            if (!b[j]) {
                f = 1;
                break;
            }
        }
    }
    f = 0;
    for (int j = 1; j <= M; j ++) {
        if (!b[j]) {
            f = 1;
            break;
        }
    }
    cout << (f ? 0 : N - i + 2);
    return 0;
}

提出情報

提出日時
問題 B - Not All
ユーザ FlowerAccepted
言語 C++ 17 (gcc 12.2)
得点 200
コード長 656 Byte
結果 AC
実行時間 1 ms
メモリ 3664 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 20
セット名 テストケース
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_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3532 KiB
00_sample_01.txt AC 1 ms 3468 KiB
00_sample_02.txt AC 1 ms 3532 KiB
01_random_00.txt AC 1 ms 3408 KiB
01_random_01.txt AC 1 ms 3572 KiB
01_random_02.txt AC 1 ms 3524 KiB
01_random_03.txt AC 1 ms 3408 KiB
02_random2_00.txt AC 1 ms 3444 KiB
02_random2_01.txt AC 1 ms 3596 KiB
02_random2_02.txt AC 1 ms 3476 KiB
02_random2_03.txt AC 1 ms 3520 KiB
02_random2_04.txt AC 1 ms 3596 KiB
02_random2_05.txt AC 1 ms 3528 KiB
02_random2_06.txt AC 1 ms 3476 KiB
02_random2_07.txt AC 1 ms 3664 KiB
03_handmade_00.txt AC 1 ms 3468 KiB
03_handmade_01.txt AC 1 ms 3476 KiB
03_handmade_02.txt AC 1 ms 3412 KiB
03_handmade_03.txt AC 1 ms 3484 KiB
03_handmade_04.txt AC 1 ms 3476 KiB