提出 #73917203


ソースコード 拡げる

#include <iostream>
#include <vector>
#include <map>
using namespace std;
int main() {
    int N, Q;
    cin >> N >> Q;
    vector<int> balls(N + 1);
    map<int, int> freq;
    for (int i = 1; i <= N; i++) {
        cin >> balls[i];
        freq[balls[i]]++;
    }
    while (Q--) {
        int K;
        cin >> K;
        vector<int> removed(K);
        for (int i = 0; i < K; i++) {
            int pos;
            cin >> pos;
            int val = balls[pos];
            removed[i] = val;
            freq[val]--;
            if (freq[val] == 0) {
                freq.erase(val);
            }
        }
        cout << freq.begin()->first << endl;
        for (int val : removed) {
            freq[val]++;
        }
    }
    return 0;
}

提出情報

提出日時
問題 C - Except and Min
ユーザ Dfsaot
言語 C++23 (GCC 15.2.0)
得点 300
コード長 780 Byte
結果 AC
実行時間 803 ms
メモリ 18572 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 3436 KiB
01_random_00.txt AC 704 ms 18408 KiB
01_random_01.txt AC 169 ms 4328 KiB
01_random_02.txt AC 762 ms 18336 KiB
01_random_03.txt AC 803 ms 18408 KiB
01_random_04.txt AC 363 ms 6572 KiB
01_random_05.txt AC 300 ms 4968 KiB
02_random_2_00.txt AC 639 ms 18396 KiB
02_random_2_01.txt AC 593 ms 18152 KiB
02_random_2_02.txt AC 229 ms 4436 KiB
02_random_2_03.txt AC 649 ms 18388 KiB
02_random_2_04.txt AC 219 ms 4388 KiB
02_random_2_05.txt AC 216 ms 4504 KiB
03_random_3_00.txt AC 526 ms 18448 KiB
03_random_3_01.txt AC 513 ms 18332 KiB
03_random_3_02.txt AC 536 ms 18464 KiB
03_random_3_03.txt AC 523 ms 18376 KiB
03_random_3_04.txt AC 518 ms 18536 KiB
03_random_3_05.txt AC 521 ms 18572 KiB