Submission #73897368


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vec vector
#define endl '\n'
#define fir first
#define sec second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ppc __builtin_popcount
#define ctz __builtin_ctzll // 去掉define int long long记得修改这里喵
#define clz __builtin_clzll // 还有这里喵
#define pcs(n) cout << fixed << setprecision(n)
#define rvs std::views::reverse
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> tiii;
typedef tuple<int, int, int, int> t4i;
typedef tuple<int, int, int, int, int> t5i;
typedef tuple<int, int, int, int, int, int> t6i;
typedef array<int, 2> aii;
typedef array<int, 3> aiii;
typedef array<int, 4> a4i;
typedef array<int, 5> a5i;
typedef array<int, 6> a6i;
typedef unsigned long long ull;
typedef long double ld;
typedef __int128_t lll;
const int mod = 998244353; // 1000000000039ll
const int N = 1000005;
const ll inf = 0x3f3f3f3f3f3f3f3f;
const vec<aii> dir = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const double eps = 1e-6;

void cold_beans()
{
    int n, q;
    cin >> n >> q;
    vec<int> a(n + 1);
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    vec<aii> b(n);
    for (int i = 1; i <= n; i++)
        b[i - 1] = {a[i], i};
    ranges::sort(b);
    while (q--)
    {
        int k;
        cin >> k;
        int mn = inf;
        set<int> st;
        for (int i = 1; i <= k; i++)
        {
            int idx;
            cin >> idx;
            st.insert(idx);
        }
        for (int i = 0; i <= 5; i++)
        {
            if (st.find(b[i][1]) == st.end())
            {
                cout << b[i][0] << endl;
                break;
            }
        }
    }
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    // cin >> _; // 单测记得注释这里喵
    while (_--)
        cold_beans();
    return 0;
}

/*
騒がしい日々に笑えない君に
思い付く限り眩しい明日を
*/

Submission Info

Submission Time
Task C - Except and Min
User Thirstarfish
Language C++23 (GCC 15.2.0)
Score 300
Code Size 2142 Byte
Status AC
Exec Time 61 ms
Memory 10400 KiB

Compile Error

./Main.cpp: In function 'void cold_beans()':
./Main.cpp:53:13: warning: unused variable 'mn' [-Wunused-variable]
   53 |         int mn = inf;
      |             ^~

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 3548 KiB
01_random_00.txt AC 59 ms 10324 KiB
01_random_01.txt AC 56 ms 10328 KiB
01_random_02.txt AC 60 ms 10336 KiB
01_random_03.txt AC 59 ms 10340 KiB
01_random_04.txt AC 60 ms 10340 KiB
01_random_05.txt AC 61 ms 10332 KiB
02_random_2_00.txt AC 59 ms 10316 KiB
02_random_2_01.txt AC 58 ms 10264 KiB
02_random_2_02.txt AC 60 ms 10380 KiB
02_random_2_03.txt AC 59 ms 10332 KiB
02_random_2_04.txt AC 58 ms 10320 KiB
02_random_2_05.txt AC 58 ms 10328 KiB
03_random_3_00.txt AC 60 ms 10316 KiB
03_random_3_01.txt AC 59 ms 10332 KiB
03_random_3_02.txt AC 60 ms 10400 KiB
03_random_3_03.txt AC 60 ms 10328 KiB
03_random_3_04.txt AC 59 ms 10340 KiB
03_random_3_05.txt AC 59 ms 10332 KiB