Submission #73915857
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 lll;
typedef unsigned __int128 ulll;
void solve() {
int n,q;
cin >> n >> q;
priority_queue<pair<int,int>> b;
for (int i = 0;i < n;i++) {
int x;
cin >> x;
b.push({x,i+1});
if (b.size() >= 7) {
b.pop();
}
}
vector<pair<int,int>> min_6;
while(!b.empty()) {
min_6.push_back(b.top());
b.pop();
}
sort(min_6.begin(),min_6.end());
for (int i = 0;i < q;i++) {
int k;
cin >> k;
vector<int> id(k);
for (auto &x : id) {
cin >> x;
}
for (int j = 0;j < min_6.size();j++) {
bool is_remove = false;
for (int jj = 0;jj < k;jj++) {
if (min_6[j].second == id[jj]) {
is_remove = true;
break;
}
}
if (!is_remove) {
cout << min_6[j].first << '\n';
break;
}
}
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
solve();
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Except and Min |
| User | t154654 |
| Language | C++23 (GCC 15.2.0) |
| Score | 300 |
| Code Size | 1241 Byte |
| Status | AC |
| Exec Time | 35 ms |
| Memory | 3624 KiB |
Compile Error
./Main.cpp: In function 'void solve()':
./Main.cpp:33:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for (int j = 0;j < min_6.size();j++) {
| ~~^~~~~~~~~~~~~~
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 | 3540 KiB |
| 01_random_00.txt | AC | 34 ms | 3552 KiB |
| 01_random_01.txt | AC | 29 ms | 3520 KiB |
| 01_random_02.txt | AC | 34 ms | 3588 KiB |
| 01_random_03.txt | AC | 34 ms | 3552 KiB |
| 01_random_04.txt | AC | 31 ms | 3492 KiB |
| 01_random_05.txt | AC | 31 ms | 3472 KiB |
| 02_random_2_00.txt | AC | 34 ms | 3624 KiB |
| 02_random_2_01.txt | AC | 33 ms | 3584 KiB |
| 02_random_2_02.txt | AC | 31 ms | 3588 KiB |
| 02_random_2_03.txt | AC | 33 ms | 3400 KiB |
| 02_random_2_04.txt | AC | 30 ms | 3624 KiB |
| 02_random_2_05.txt | AC | 29 ms | 3624 KiB |
| 03_random_3_00.txt | AC | 35 ms | 3584 KiB |
| 03_random_3_01.txt | AC | 34 ms | 3492 KiB |
| 03_random_3_02.txt | AC | 35 ms | 3472 KiB |
| 03_random_3_03.txt | AC | 35 ms | 3524 KiB |
| 03_random_3_04.txt | AC | 35 ms | 3476 KiB |
| 03_random_3_05.txt | AC | 34 ms | 3492 KiB |