Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
32983 | 林芳菲 | 【S】贾果 | C++ | 解答错误 | 0 | 2953 MS | 4960 KB | 1046 | 2024-10-02 16:43:18 |
#include <cstdio> #include <iostream> #include <algorithm> #include <queue> using namespace std; int n, h, k; struct node { int x, d; bool operator < (const node & b) const { return x < b.x; } }; node p[400010]; priority_queue<int> q; int main() { //freopen("pvz.in", "r", stdin); //freopen("pvz.out", "w", stdout); scanf("%d %d %d", &n, &h, &k); for (int i = 1; i <= n; i++) scanf("%d", &p[i].x); for (int i = 1; i <= n; i++) { scanf("%d", &p[i].d); if (p[i].d == -1) q.push(p[i].x); } while (q.size() > h) q.pop(); while (k--) { n++; scanf("%d %d", &p[n].x, &p[n].d); if (p[n].d == -1) q.push(p[n].x); while (q.size() > h) q.pop(); if (q.size() < h) cout << "Zombie ate your brain" << endl; else printf("%.2lf\n", q.top() / 2.0); } //fclose(stdin); //fclose(stdout); return 0; }