Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
32923 | 武云帆 | 【S】贾果 | C++ | 通过 | 100 | 183 MS | 7024 KB | 656 | 2024-10-02 14:51:09 |
#include<bits/stdc++.h> using namespace std; const int N=200100; int n,h,k; struct node{ long long x,d; }a[N]; long long b[N]; int idx=0; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>h>>k; priority_queue<long long> q; for(int i=1;i<=n;i++) cin>>a[i].x; for(int i=1;i<=n;i++){ cin>>a[i].d; if(a[i].d==-1) q.push(a[i].x); } while(q.size()>h) q.pop(); while(k--){ long long x,d; cin>>x>>d; if(d==-1&&x<q.top()&&q.size()==h) q.push(x),q.pop(); else if(d==-1&&q.size()<h) q.push(x); if(h==q.size()) printf("%.1f\n",q.top()*1.0/2); else printf("Zombie ate your brain\n"); } }