Please sign in first.
Submission #73910732
Source Code Expand
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using vi = vector<int>;
using pii = pair<int, int>;
// N.size = 1,..N
// Ball i = A[i]
// Q operations
// Q = 0, Q < N, Q++
// K.size = sum(B_1, B_2,..B_k)
// For each Q,
int main() {
int n, q;
if (!(cin >> n >> q)) return 0;
//vector of pairs to keep value and the original ball ID together
vector<pii> balls(n);
for (int i = 0; i < n; i++) {
int val;
cin >> val;
balls[i] = {val, i + 1};
}
sort(balls.begin(), balls.end());
for (int i = 0; i < q; i++) {
int k;
cin >> k;
vi removed(k);
for (int j = 0; j < k; j++) {
cin >> removed[j];
}
for (int j = 0; j < n; j++) {
bool is_removed = false;
for (int r = 0; r < k; r++) {
if (balls[j].second == removed[r]) {
is_removed = true;
break;
}
}
if (!is_removed) {
cout << balls[j].first << "\n";
break;
}
}
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Except and Min |
| User | Monaco37 |
| Language | C++23 (GCC 15.2.0) |
| Score | 300 |
| Code Size | 1223 Byte |
| Status | AC |
| Exec Time | 245 ms |
| Memory | 5820 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| 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 | 3420 KiB |
| 01_random_00.txt | AC | 242 ms | 5708 KiB |
| 01_random_01.txt | AC | 192 ms | 5704 KiB |
| 01_random_02.txt | AC | 239 ms | 5616 KiB |
| 01_random_03.txt | AC | 245 ms | 5768 KiB |
| 01_random_04.txt | AC | 217 ms | 5772 KiB |
| 01_random_05.txt | AC | 213 ms | 5696 KiB |
| 02_random_2_00.txt | AC | 241 ms | 5544 KiB |
| 02_random_2_01.txt | AC | 228 ms | 5696 KiB |
| 02_random_2_02.txt | AC | 212 ms | 5704 KiB |
| 02_random_2_03.txt | AC | 240 ms | 5688 KiB |
| 02_random_2_04.txt | AC | 203 ms | 5688 KiB |
| 02_random_2_05.txt | AC | 199 ms | 5704 KiB |
| 03_random_3_00.txt | AC | 239 ms | 5616 KiB |
| 03_random_3_01.txt | AC | 239 ms | 5772 KiB |
| 03_random_3_02.txt | AC | 242 ms | 5704 KiB |
| 03_random_3_03.txt | AC | 231 ms | 5820 KiB |
| 03_random_3_04.txt | AC | 242 ms | 5712 KiB |
| 03_random_3_05.txt | AC | 237 ms | 5616 KiB |