QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#593238 | #8243. Contest Advancement | enze# | WA | 0ms | 3752kb | C++20 | 1.1kb | 2024-09-27 12:51:18 | 2024-09-27 12:51:19 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
const ld pi = 3.14159265358979323846;
const int mod = (int)1e9 + 7;
const ll INF = 1e18;
template<typename T>
T chmax(T a, T b) {
return a > b ? a : b;
}
template<typename T>
T chmin(T a, T b) {
return a > b ? b : a;
}
const int N = (int)2e5 + 1, M = N * 2;
void solve(){
int n, k, c;
cin >> n >> k >> c;
map<int, int> mp, rec;
vector<vector<int>> a;
for(int i = 0; i < n; i++){
int s, t;
cin >> s >> t;
a.pb({s, t});
if(mp[t] >= c || k <= 0) continue;
rec[i] = 1;
mp[t]++;
k--;
cout << s << endl;
}
for(int i = 0; i < a.size(); i++){
if(rec[i] != 1 && k){
cout << a[i][0] << endl;
k--;
}
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(0);
int t = 1;
// cin >> t;
while(t--){
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
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: 0ms
memory: 3752kb
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 10 3 4
result:
wrong answer 3rd lines differ - expected: '3', found: '10'