結果
| 問題 |
No.692 square1001 and Permutation 1
|
| コンテスト | |
| ユーザー |
kakira9618
|
| 提出日時 | 2018-06-15 23:18:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 589 bytes |
| コンパイル時間 | 840 ms |
| コンパイル使用メモリ | 64,472 KB |
| 実行使用メモリ | 37,740 KB |
| 最終ジャッジ日時 | 2024-06-30 15:26:50 |
| 合計ジャッジ時間 | 11,303 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 5 |
ソースコード
#include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
uint32_t x = 0, y = 1, z = 2, w = 3;
uint32_t generate() {
uint32_t t = (x^(x<<11));
x = y;
y = z;
z = w;
w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
return w;
}
int main(void) {
ll seed; cin >> seed;
x = seed;
int n = 10000001;
priority_queue<uint32_t> Q;
for (int i = 0; i < n; i++) {
uint32_t a = generate();
Q.push(a);
if (Q.size() > (n - 1) / 2 + 1) {
Q.pop();
}
}
cout << Q.top() << endl;
return 0;
}
kakira9618