Submission #73916457


Source Code Expand

/*Sin_qwq's code
We can be heros , just for one day .*/
#include <bits/stdc++.h>
#define LD long double
#define i7 __int128
#define re return
#define con continue
#define ci const int
#define all(x) x.begin(), x.end()
#define All(x) x.begin() + 1, x.end()
using namespace std;
typedef long long i64;
template <class T>
inline bool ckmin(T &a, T b) { re b < a ? a = b, 1 : 0; }
template <class T>
inline bool ckmax(T &a, T b) { re a < b ? a = b, 1 : 0; }

void work()
{
    int n, q;
    cin >> n >> q;
    vector<int> a(n + 1);
    set<pair<int, int>> ball;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        ball.insert({a[i], i});
    }
    while (q--)
    {
        int k;
        cin >> k;
        vector<pair<int, int>> removed_ball;
        for (int i = 1; i <= k; i++)
        {
            int x;
            cin >> x;
            pair<int, int> t = {a[x], x};
            auto it = ball.find(t);
            if (it != ball.end())
            {
                removed_ball.push_back(*it);
                ball.erase(it);
            }
        }
        cout << ball.begin()->first << "\n";
        for (auto &t : removed_ball)
            ball.insert(t);
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    // cin>>T;
    while (T--)
    {
        work();
    }
    re 0;
}
/*
 */

Submission Info

Submission Time
Task C - Except and Min
User Sin_qwq
Language C++23 (GCC 15.2.0)
Score 300
Code Size 1416 Byte
Status AC
Exec Time 430 ms
Memory 18616 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 1
AC × 19
Set Name Test Cases
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
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3424 KiB
01_random_00.txt AC 425 ms 18496 KiB
01_random_01.txt AC 340 ms 18496 KiB
01_random_02.txt AC 411 ms 18556 KiB
01_random_03.txt AC 417 ms 18432 KiB
01_random_04.txt AC 430 ms 18444 KiB
01_random_05.txt AC 416 ms 18556 KiB
02_random_2_00.txt AC 351 ms 18616 KiB
02_random_2_01.txt AC 353 ms 18560 KiB
02_random_2_02.txt AC 338 ms 18432 KiB
02_random_2_03.txt AC 345 ms 18376 KiB
02_random_2_04.txt AC 328 ms 18376 KiB
02_random_2_05.txt AC 323 ms 18432 KiB
03_random_3_00.txt AC 268 ms 18432 KiB
03_random_3_01.txt AC 286 ms 18492 KiB
03_random_3_02.txt AC 262 ms 18496 KiB
03_random_3_03.txt AC 264 ms 18556 KiB
03_random_3_04.txt AC 294 ms 18376 KiB
03_random_3_05.txt AC 287 ms 18432 KiB