Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
32984 林芳菲 【S】贾果 C++ 解答错误 10 223 MS 5204 KB 1040 2024-10-02 16:44:42

Tests(2/20):


#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) printf("Zombie ate your brain\n"); else printf("%.2lf\n", q.top() / 2.0); } //fclose(stdin); //fclose(stdout); return 0; }


测评信息: