QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#602676 | #9370. Gambling on Choosing Regionals | _Induction | WA | 0ms | 7704kb | C++14 | 699b | 2024-10-01 11:54:16 | 2024-10-01 11:54:16 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,k;
int c[100005];
struct node{
int va,num;
string name;
}t[100005];
bool cmp(node a,node b){
return a.va>b.va;
}
int rak[100005];
map<string,int> cnt;
int c0;
int main(){
scanf("%d%d",&n,&k);
scanf("%d",&c0);
for(int i=2;i<=k;i++){
scanf("%d",&c[i]);
c0=min(c[i],c0);
}
for(int i=1;i<=n;i++){
scanf("%d%d",&t[i].va,&t[i].name);
t[i].num=i;
}
sort(t+1,t+1+n,cmp);
for(int i=1;i<=n;i++){
if((++cnt[t[i].name])<=c0) rak[t[i].num]=rak[t[i-1].num]+1;
}
for(int i=1;i<=n;i++){
printf("%d\n",rak[i]);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 7704kb
input:
5 3 1 2 3 100 THU 110 PKU 95 PKU 105 THU 115 PKU
output:
1 0 0 0 0
result:
wrong answer 1st lines differ - expected: '2', found: '1'