QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#584813 | #9370. Gambling on Choosing Regionals | Loxilante | WA | 120ms | 15864kb | C++14 | 1.2kb | 2024-09-23 16:52:33 | 2024-09-23 16:52:34 |
Judging History
answer
#define F_C
#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define int ll
using namespace std;
typedef long long ll;
template<typename tn = int> tn next(void) { tn k; cin>>k; return k; }
#ifndef LOCAL
#define D(...) 0
#endif
const int U = 2e5;
struct team
{
int id, st;
string univ;
} w[U];
int c[U], ans[U];
map<string, int> mp;
signed main(void)
{
#ifdef LOCAL
// freopen("C:\\Users\\Loxil\\Desktop\\IN.txt", "r", stdin);
// freopen("C:\\Users\\Loxil\\Desktop\\OUT.txt", "w", stdout);
#endif
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin>>n>>m;
rep(i, 0, m) cin>>c[i];
rep(i, 0, n) w[i] = {i, next(), next<string>()};
sort(w, w+n, [=](team a, team b)
{
return a.st > b.st;
});
int cnt = 0;
rep(i, 0, n)
{
ans[w[i].id] = cnt-min(c[0], mp[w[i].univ])+min(c[0]-1, mp[w[i].univ])+1;
mp[w[i].univ]++;
if (mp[w[i].univ] <= c[0]) cnt++;
}
rep(i, 0, n) cout<<ans[i]<<endl;
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 15008kb
input:
5 3 1 2 3 100 THU 110 PKU 95 PKU 105 THU 115 PKU
output:
2 1 2 2 1
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 3ms
memory: 15004kb
input:
5 2 2 3 100 THU 110 PKU 95 PKU 105 THU 115 PKU
output:
4 2 4 3 1
result:
ok 5 lines
Test #3:
score: -100
Wrong Answer
time: 120ms
memory: 15864kb
input:
100000 100000 57148 51001 13357 71125 98369 67226 49388 90852 66291 39573 38165 97007 15545 51437 89611 41523 27799 15529 16434 44291 47134 90227 26873 52252 41605 21269 9135 55784 70744 17563 79061 73981 70529 35681 91073 52031 23811 79501 1607 46365 76868 72137 71041 29217 96749 46417 40199 55907 ...
output:
94907 15938 51981 98470 83677 32345 52328 31696 44705 3240 40243 6189 77801 72454 67601 44666 14040 74317 35039 65000 35508 19143 56593 9110 54778 64546 18367 1344 25930 75155 39938 5884 87260 86787 23307 65666 19346 38658 1131 26532 93599 99215 23152 92308 46948 75923 66463 91436 44056 54275 24935 ...
result:
wrong answer 1st lines differ - expected: '1000', found: '94907'