結果

問題 No.692 square1001 and Permutation 1
ユーザー kakira9618kakira9618
提出日時 2018-06-15 23:18:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 64,668 KB
実行使用メモリ 37,848 KB
最終ジャッジ日時 2023-09-13 05:16:35
合計ジャッジ時間 10,712 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0