Submission #73902515


Source Code Expand

#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
using ll = long long;
using pii = pair<ll,ll>;
using db = long double;

int main(){
	fastio;
	int n,q;cin >> n >> q;
	vector<int> arr(n+1);
	priority_queue<pii,vector<pii>,greater<pii>> pq;
	for (int i=1;i<=n;i++){
		cin >> arr[i];
		pq.push({arr[i],i});
	}

	for (int i=0;i<q;i++){
		int k;cin >> k;
		unordered_set<int> no;
		vector<pii> res;
		for (int j=0;j<k;j++){
			int a;cin >> a;
			no.insert(a);
		}
		while (true){
			pii t = pq.top();
			if (no.count(t.second)){
				pq.pop();res.push_back(t);
			}else{
				cout << t.first << "\n";break;
			}
		}
		for (pii j:res){
			pq.push(j);
		}
	}
	return 0;
}

Submission Info

Submission Time
Task C - Except and Min
User Axteln
Language C++23 (GCC 15.2.0)
Score 300
Code Size 743 Byte
Status AC
Exec Time 76 ms
Memory 12876 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 3540 KiB
01_random_00.txt AC 58 ms 12740 KiB
01_random_01.txt AC 52 ms 12816 KiB
01_random_02.txt AC 58 ms 12876 KiB
01_random_03.txt AC 59 ms 12820 KiB
01_random_04.txt AC 56 ms 12840 KiB
01_random_05.txt AC 55 ms 12804 KiB
02_random_2_00.txt AC 67 ms 12748 KiB
02_random_2_01.txt AC 64 ms 12788 KiB
02_random_2_02.txt AC 64 ms 12736 KiB
02_random_2_03.txt AC 66 ms 12872 KiB
02_random_2_04.txt AC 62 ms 12812 KiB
02_random_2_05.txt AC 63 ms 12844 KiB
03_random_3_00.txt AC 75 ms 12804 KiB
03_random_3_01.txt AC 75 ms 12716 KiB
03_random_3_02.txt AC 74 ms 12812 KiB
03_random_3_03.txt AC 75 ms 12740 KiB
03_random_3_04.txt AC 76 ms 12728 KiB
03_random_3_05.txt AC 75 ms 12852 KiB