提出 #73891951


ソースコード 拡げる

#include <bits/stdc++.h>
#define endl '\n'

using namespace std;
using i64 = long long;

int main() {
    ios::sync_with_stdio(false);
	cin.tie(0);
    
    int n, q;
    cin >> n >> q;

    vector<int> a(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    auto c = a;

    sort(a.begin() + 1, a.end());

    while (q--) {
        int k;
        cin >> k;

        vector<int> b(k + 1);
        for (int i = 1; i <= k; i++) {
            int x;
            cin >> x;
            b[i] = c[x];
        }
        sort(b.begin() + 1, b.end());

        int p = 1;
        for (int i = 1; i <= k; i++) {
            if (b[i] == a[p]) {
                p++;
                continue;
            } else {
                assert(a[p] < b[i]);
                break;
            }
        }
        cout << a[p] << endl;
    }

    return 0;
}

提出情報

提出日時
問題 C - Except and Min
ユーザ NoobDidi
言語 C++23 (GCC 15.2.0)
得点 300
コード長 906 Byte
結果 AC
実行時間 54 ms
メモリ 5832 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 1
AC × 19
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_random_2_00.txt, 02_random_2_01.txt, 02_random_2_02.txt, 02_random_2_03.txt, 02_random_2_04.txt, 02_random_2_05.txt, 03_random_3_00.txt, 03_random_3_01.txt, 03_random_3_02.txt, 03_random_3_03.txt, 03_random_3_04.txt, 03_random_3_05.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3584 KiB
01_random_00.txt AC 54 ms 5660 KiB
01_random_01.txt AC 36 ms 5668 KiB
01_random_02.txt AC 54 ms 5632 KiB
01_random_03.txt AC 53 ms 5748 KiB
01_random_04.txt AC 50 ms 5680 KiB
01_random_05.txt AC 49 ms 5612 KiB
02_random_2_00.txt AC 54 ms 5832 KiB
02_random_2_01.txt AC 52 ms 5668 KiB
02_random_2_02.txt AC 44 ms 5680 KiB
02_random_2_03.txt AC 52 ms 5752 KiB
02_random_2_04.txt AC 42 ms 5832 KiB
02_random_2_05.txt AC 41 ms 5704 KiB
03_random_3_00.txt AC 53 ms 5668 KiB
03_random_3_01.txt AC 52 ms 5832 KiB
03_random_3_02.txt AC 53 ms 5752 KiB
03_random_3_03.txt AC 53 ms 5660 KiB
03_random_3_04.txt AC 54 ms 5632 KiB
03_random_3_05.txt AC 52 ms 5748 KiB