QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#584800 | #9370. Gambling on Choosing Regionals | Chief_Ning | WA | 0ms | 3608kb | C++14 | 533b | 2024-09-23 16:48:54 | 2024-09-23 16:48:54 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
int c=1e9;
for(int i=0;i<k;i++){
int x;
cin>>x;
c=min(x,c);
}
vector<int> w(n+1),id(n+1);
vector<string> s(n+1);
for(int i=1;i<=n;i++){
cin>>w[i]>>s[i];
id[i]=i;
}
sort(id.begin()+1,id.end(),[&](int x,int y){
return w[x]>w[y];
});
map<string,int>p;
int tot=0;
for(int i=1;i<=n;i++){
int x=id[i];
w[x]=tot+1-(p[s[x]]==c);
if(p[s[x]]<c)p[s[x]]++,tot++;
}
for(int i=1;i<=n;i++)cout<<w[i]<<" ";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
5 3 1 2 3 100 THU 110 PKU 95 PKU 105 THU 115 PKU
output:
2 1 2 2 1
result:
wrong answer 1st lines differ - expected: '2', found: '2 1 2 2 1 '