Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
32931 | 方巾予 | 【S】贾果 | C++ | 通过 | 100 | 207 MS | 5448 KB | 848 | 2024-10-02 15:07:26 |
#include<bits/stdc++.h> using namespace std; const int N=2e5+10,INF=1e9; int n,h,k; int x[N],d[N]; int qx,qd; int cnt; int ans; priority_queue<double> pq; void insert(int x){ if(pq.size()<h) pq.push(x); else if(pq.top()>x){ pq.push(x); pq.pop(); } } double calc(double x){ double ret=x/2.0; return ret; } signed main(){ scanf("%d%d%d",&n,&h,&k); for(int i=1;i<=n;i++) scanf("%d",&x[i]); for(int i=1;i<=n;i++){ scanf("%d",&d[i]); if(d[i]==-1){ cnt++; insert(x[i]); } } while(k--){ scanf("%d%d",&qx,&qd); if(qd==-1){ cnt++; insert(qx); } if(cnt<h) printf("Zombie ate your brain\n"); else printf("%.1f\n",calc(pq.top())); } return 0; }