比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
TTTTTTTTTT |
题目名称 |
昆特-冠位指定 |
最终得分 |
0 |
用户昵称 |
_Itachi |
运行时间 |
10.028 s |
代码语言 |
C++ |
内存使用 |
1.81 MiB |
提交时间 |
2016-10-19 21:47:55 |
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<cctype>
#include<algorithm>
using namespace std;
int _read(){int ret,neg;char ch;ret=neg=0;while(!isdigit(ch=getchar())&&ch!='-');if(ch=='-')neg=1,ch=getchar();while(ret=ret*10+ch-'0',isdigit(ch=getchar()));if(neg)ret=-ret;return ret;}
#define maxn 100010<<1
typedef long long LL;
int N,M,K;
LL sum=0;
struct Node
{
int v,x;
Node(){;}
Node(int a,int b){v=a; x=b;}
}_my[maxn];
bool Comp(const Node &a,const Node &b){
if(a.v < b.v) return 1;
if(a.v > b.v) return 0;
if(a.x > b.x) return 1;
return 0;
}
int _work(){
M=_read(); N=_read(); K=_read();
for(int i=1;i<=M;i++){
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
sum += (LL)d;
}
for(int i=1;i<=N;i++){
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
_my[i].v = a; _my[i].x = d;
}
sort(_my+1,_my+1+N,Comp);
LL cnt = 0 ;int ans = _my[K].v;
for(int i=1;i<=K;i++){
cnt += (LL)_my[i].x;
}
if(cnt >= sum){ printf("%d\n",ans); return 0; }
bool ok = 0;
for(int i=K+1;i<=N;i++){
cnt += (LL)_my[i].x;
ans = max(ans , _my[i].v);
if(cnt >= sum){ ok = 1; printf("%d\n",ans); return 0; }
}
if(!ok){
puts("SingleDogMZX"); return 0;
}
return 0;
}
bool _Rabit(),_RABIT=_Rabit();int main(){;}
bool _Rabit(){
#define _Rabit _RABIT
#ifdef _Rabit
freopen("gwent_grandorder.in","r",stdin);
freopen("gwent_grandorder.out","w",stdout);
#endif
_work();
#ifndef _Rabit
getchar(),getchar();
#endif
fclose(stdin);fclose(stdout);
}