QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#602676#9370. Gambling on Choosing Regionals_InductionWA 0ms7704kbC++14699b2024-10-01 11:54:162024-10-01 11:54:16

Judging History

你现在查看的是最新测评结果

  • [2024-10-01 11:54:16]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:7704kb
  • [2024-10-01 11:54:16]
  • 提交

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;
}

詳細信息

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'