提出 #73911982


ソースコード 拡げる

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

constexpr int maxn = 3e5 + 3;

int N, Q, K, a[maxn], b[maxn], q[10], res;

int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    cin >> N >> Q;
    for(int i = 1; i <= N; i++) cin >> a[i], b[i] = a[i];
    sort(b + 1, b + N + 1);
    while(Q--) {
        cin >> K;
        for(int i = 1, x; i <= K; i++) cin >> x, q[i] = a[x];
        sort(q + 1, q + K + 1);
        for(res = 1; res <= K; res++)
            if(q[res] != b[res]) break;
        cout << b[res] << '\n';
    }

    return 0;
}

提出情報

提出日時
問題 C - Except and Min
ユーザ acahsteven
言語 C++23 (GCC 15.2.0)
得点 300
コード長 574 Byte
結果 AC
実行時間 53 ms
メモリ 6060 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 3536 KiB
01_random_00.txt AC 53 ms 6020 KiB
01_random_01.txt AC 35 ms 5844 KiB
01_random_02.txt AC 53 ms 5892 KiB
01_random_03.txt AC 53 ms 6004 KiB
01_random_04.txt AC 49 ms 5960 KiB
01_random_05.txt AC 47 ms 6016 KiB
02_random_2_00.txt AC 53 ms 5976 KiB
02_random_2_01.txt AC 50 ms 5988 KiB
02_random_2_02.txt AC 43 ms 6060 KiB
02_random_2_03.txt AC 51 ms 5968 KiB
02_random_2_04.txt AC 40 ms 5976 KiB
02_random_2_05.txt AC 40 ms 5944 KiB
03_random_3_00.txt AC 52 ms 5992 KiB
03_random_3_01.txt AC 51 ms 6036 KiB
03_random_3_02.txt AC 51 ms 5884 KiB
03_random_3_03.txt AC 51 ms 6020 KiB
03_random_3_04.txt AC 51 ms 5892 KiB
03_random_3_05.txt AC 50 ms 6004 KiB