QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#343292 | #8243. Contest Advancement | MayaZayn# | WA | 1ms | 3628kb | C++14 | 1.9kb | 2024-03-02 13:32:39 | 2024-03-02 13:32:40 |
Judging History
answer
#include <bits/stdc++.h>
#define MayaZayn ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define all_r(x) (x).rbegin(), (x).rend()
#define mnEl(vec) *min_element(vec.begin(), vec.end())
#define mxEl(vec) *max_element(vec.begin(), vec.end())
#define yes cout << "YES"
#define no cout << "NO"
#define in(v) for (auto & x : v) cin >> x
#define out(v) for (auto & x : v) cout << x << ' '
#define inLL(v) for (ll & x : v) cin >> x
#define openIn(x) freopen(x, "r", stdin);
#define openOut(x) freopen(x, "w", stdout);
#define M 1000000007
#define N 100005
using namespace std;
void solve() {
int n, k, c;
cin >> n >> k >> c;
vector<int> v(N, 0), b, a;
for (int i = 0; i < n; ++i) {
int t, s;
cin >> t >> s;
b.push_back(t);
if (v[s] < c) {
v[s]++;
a.push_back(t);
}
}
if (a.size() < k) {
for (int i = 0; i < k; ++i) {
cout << b[i] << endl;
}
} else {
for (int i = 0; i < k; ++i) {
cout << a[i] << endl;
}
}
}
int main() {
MayaZayn
// int t;
// cin >> t;
// while (t--)
solve();
return 0;
}
// int i = 0, j = 0;
// while (i < a.size() && j < b.size() && k) {
// if (a[i].second > b[j].second) {
// cout << a[i].first << endl;
// i++;
// } else {
// cout << b[j].first << endl;
// j++;
// }
// k--;
// }
//
// while (i < a.size() && k) {
// cout << a[i].first << endl;
// i++;
// k--;
// }
//
// while (j < b.size() && k) {
// cout << b[j].first << endl;
// j++;
// k--;
// }
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3628kb
input:
10 7 3 3 9 1 9 4 9 5 9 9 7 2 7 6 7 7 7 8 5 10 5
output:
3 1 4 9 2 6 8
result:
ok 7 lines
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3584kb
input:
10 5 2 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 2
output:
1 2 3 4 5
result:
wrong answer 5th lines differ - expected: '10', found: '5'