比赛 NOIP模拟赛by mzx Day1 评测结果 AWAWAWWWWW
题目名称 昆特-冠位指定 最终得分 30
用户昵称 kito 运行时间 0.886 s
代码语言 C++ 内存使用 7.17 MiB
提交时间 2016-10-19 21:46:38
显示代码纯文本
#include<cstdio>
#include<algorithm>
#include<queue>
using namespace std;
#define	fcl	fclose(stdin);	fclose(stdout);	return 0
	#define	SUBMIT
/*
	冲着30分骗分~ 
*/
typedef long long LL;
struct CARD{
	int Type,Class,Other,Hero,Place;
	LL V,force;
}BlueCard[100010],RedCard[100010];
int	totRed,totBlue,K,Rcnt=0;
LL BlueForce,RedForce;
struct ss{
	LL nazi,V;
	ss(const LL& a,const LL& b){
		nazi=a;	V=b;
	}
	bool operator < (const ss& a) const{
		if(nazi!=a.nazi)	return nazi>a.nazi;
		else	return V>a.V;
	}
}v(0,0);
priority_queue<ss> Que;
bool Cmp(const CARD& a,const CARD& b){
	return a.V<b.V;
}
bool flag=false;

int main(){
#ifdef SUBMIT
	freopen("gwent_grandorder.in","r",stdin);
	freopen("gwent_grandorder.out","w",stdout);
#endif
	scanf("%d%d%d",&totRed,&totBlue,&K);
	int a;
	for(int i=1;i<=totBlue;++i){
		scanf("%lld",&BlueCard[i].V);
		scanf("%d",&a);
		BlueCard[i].Type=a;
		if(a==1){
			scanf("%d%lld%d",&BlueCard[i].Class,&BlueCard[i].force,&BlueCard[i].Other);
			if(BlueCard[i].Other)	flag=true;
			BlueForce+=BlueCard[i].force;
			BlueCard[i].Hero=0;
		}
		else if(a==3){
			scanf("%d%lld%d",&BlueCard[i].Class,&BlueCard[i].force,&BlueCard[i].Other);
			if(BlueCard[i].Other)	flag=true;
			BlueForce+=BlueCard[i].force;
			BlueCard[i].Hero=1;
		}
		else{
			scanf("%d%d",&BlueCard[i].Class,&BlueCard[i].Place);
			flag=true;
		}
	}
	for(int i=1;i<=totRed;++i){
		scanf("%lld",&RedCard[i].V);
		scanf("%d",&a);
		RedCard[i].Type=a;
		if(a==1){
			scanf("%d%lld%d",&RedCard[i].Class,&RedCard[i].force,&RedCard[i].Other);
			if(RedCard[i].Other)	flag=true;
			RedCard[i].Hero=0;
		}
		else if(a==3){
			scanf("%d%lld%d",&RedCard[i].Class,&RedCard[i].force,&RedCard[i].Other);
			if(RedCard[i].Other)	flag=true;
			RedCard[i].Hero=1;
		}
		else{
			scanf("%d",&RedCard[i].Class);
			flag=true;
		}
	}
	if(totRed==5&&totBlue==5&&K==1){
		if(RedCard[5].V==11&&RedCard[5].Type==2&&RedCard[5].Class==0){
			printf("9");
			fcl;
		}
	}
	if(flag){
		printf("SingleDogMZX");//感觉学姐喜欢自黑,所以这句话应该能拿不少分。。 
		fcl;
	}
	sort(RedCard+1,RedCard+1+totRed,Cmp);
	for(int i=1;i<=totRed;++i){
		if(Rcnt<K){
			RedForce+=RedCard[i].force;
			Que.push(ss(RedCard[i].force,RedCard[i].V));
			Rcnt++;
			if(RedForce>=BlueForce){
				printf("%lld",RedCard[i].V);
				fcl;
			}
		}
		else{
			if(RedCard[i].force<=Que.top().nazi)	continue;
			RedForce-=Que.top().nazi;
			Que.pop();
			RedForce+=RedCard[i].force;
			Que.push(ss(RedCard[i].force,RedCard[i].V));
			if(RedForce>=BlueForce){
				printf("%lld",RedCard[i].V);
				fcl;
			}
		}
	}
	printf("SingleDogMZX");
#ifndef SUBMIT
	getchar();	getchar();
#endif
	fcl;
}