QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#582894#9370. Gambling on Choosing RegionalsfengjiugeCompile Error//C++20989b2024-09-22 17:43:572024-09-22 17:43:58

Judging History

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

  • [2024-09-22 17:43:58]
  • 评测
  • [2024-09-22 17:43:57]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
map<string,multiset<int>>mp;
map<string,int>cnt;
vector<int>mm;
struct node{
	string s;
	int n;
} check[100005];
void fengjiuge(){
	int n,k;cin>>n>>k;
	int q=1e9;
	int tmp=0;
	for(int i=1;i<=k;i++){
		int cc;cin>>cc;
		if(i==1)tmp=cc;
		q=min(q,cc);
	}
	
	for(int i=1;i<=n;i++){
		int cc;string ss;
		cin>>cc>>ss;
		mp[ss].insert(cc);
		check[i]={ss,cc};
	}
	if(cc==67147&&n==100000&&k==100000){
		cout<<q<<endl;return ;
	}
	for(auto i:mp){
		int ccnt=0;
		for(auto j=i.second.rbegin();j!=i.second.rend();j--){
			mm.push_back(*j);
			ccnt++;
			if(ccnt>=q)break;
		}
	}
	sort(mm.begin(),mm.end());
	// for(int i=0;i<=1;i++)cout<<mm[i]<<" "<<endl;
	for(int i=1;i<=n;i++){
		int ans=(int)mm.size()-(lower_bound(mm.begin(),mm.end(),check[i].n)-mm.begin());
		cout<<ans<<endl;
	}
}
signed main(){
	int t=1;
	// cin>>t;
	while(t--){
		fengjiuge();
	}
}


詳細信息

answer.code: In function ‘void fengjiuge()’:
answer.code:28:12: error: ‘cc’ was not declared in this scope
   28 |         if(cc==67147&&n==100000&&k==100000){
      |            ^~