记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 5ms 588.0 KiB
#2 Accepted 4ms 596.0 KiB
#3 Accepted 4ms 588.0 KiB
#4 Accepted 4ms 596.0 KiB
#5 Accepted 5ms 596.0 KiB
#6 Accepted 40ms 2.332 MiB
#7 Accepted 42ms 2.391 MiB
#8 Accepted 39ms 2.336 MiB
#9 Accepted 43ms 2.426 MiB
#10 Accepted 42ms 2.324 MiB
#11 Accepted 644ms 32.426 MiB
#12 Accepted 607ms 32.41 MiB
#13 Accepted 633ms 32.312 MiB
#14 Accepted 642ms 32.309 MiB
#15 Accepted 662ms 32.398 MiB
#16 Accepted 3567ms 128.371 MiB
#17 Accepted 3877ms 128.426 MiB
#18 Accepted 3826ms 128.418 MiB
#19 Accepted 3311ms 128.426 MiB
#20 Accepted 3213ms 128.426 MiB

代码

#include <bits/stdc++.h>
using namespace std;
int seed, n;
int rnd() { return seed = (seed * 19260817ll + 20230853) & INT_MAX; }
priority_queue<int, vector<int>, greater<int> > pq;
int main() {
  cin >> n >> seed;
  int ans = 0;
  for (int i = 1; i <= (n >> 1); ++i) pq.push(rnd());
  for (int i = 1; i <= (n >> 1); ++i) {
    switch (rnd() % 3) {
      case 0:
        pq.push(rnd());
        break;
      case 1:
        pq.pop();
        break;
      default:
        ans ^= pq.top();
    }
  }
  cout << ans << endl;
  return 0;
}

信息

递交者
类型
递交
题目
P1004 Heaptester
语言
C++
递交时间
2020-12-20 08:06:18
评测时间
2021-01-10 10:16:44
评测机
分数
100
总耗时
21219ms
峰值内存
128.426 MiB