题意:给出罚时现场赛的题数和罚时,问是否有在金牌线下取整被卡出,四舍五入卡入的队伍
n<=1e5
思路:
1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 typedef unsigned int uint; 5 typedef unsigned long long ull; 6 typedef pair<int,int> PII; 7 typedef pair<ll,ll> Pll; 8 typedef vector<int> VI; 9 typedef vector<PII> VII; 10 #define N 110000 11 #define M 4100000 12 #define fi first 13 #define se second 14 #define MP make_pair 15 #define pi acos(-1) 16 #define mem(a,b) memset(a,b,sizeof(a)) 17 #define rep(i,a,b) for(int i=(int)a;i<=(int)b;i++) 18 #define per(i,a,b) for(int i=(int)a;i>=(int)b;i--) 19 #define lowbit(x) x&(-x) 20 #define Rand (rand()*(1<<16)+rand()) 21 #define id(x) ((x)<=B?(x):m-n/(x)+1) 22 #define ls p<<1 23 #define rs p<<1|1 24 25 const ll MOD=1e9+7,inv2=(MOD+1)/2; 26 double eps=1e-6; 27 int INF=1e9; 28 29 30 int read() 31 { 32 int v=0,f=1; 33 char c=getchar(); 34 while(c<48||57<c) {if(c=='-') f=-1; c=getchar();} 35 while(48<=c&&c<=57) v=(v<<3)+v+v+c-48,c=getchar(); 36 return v*f; 37 } 38 39 struct arr 40 { 41 char x[15]; 42 int y,z; 43 }a[N]; 44 45 bool cmp(arr a,arr b) 46 { 47 if(a.y==b.y) return a.z<b.z; 48 return a.y>b.y; 49 } 50 51 int main() 52 { 53 //freopen("1.in","r",stdin); 54 int cas; 55 scanf("%d",&cas); 56 while(cas--) 57 { 58 int n=read(),d=read(); 59 rep(i,1,n) 60 { 61 scanf("%s",a[i].x+1); 62 a[i].y=read(); 63 a[i].z=read(); 64 } 65 sort(a+1,a+n+1,cmp); 66 int x1=1.0*n*d/10.0; 67 int x2=x1; 68 if(n*d%10==5) x2++; 69 int flag=0; 70 //printf("x1=%d x2=%d ",x1,x2); 71 rep(i,1,n) 72 if(i>x1&&i<=x2) 73 { 74 flag=1; 75 printf("%s ",a[i].x+1); 76 } 77 if(!flag) printf("Quailty is very great "); 78 79 80 81 82 } 83 84 return 0; 85 }