結果
問題 |
No.702 中央値を求めよ LIMITED
|
ユーザー |
![]() |
提出日時 | 2025-07-02 03:49:11 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 880 bytes |
コンパイル時間 | 3,342 ms |
コンパイル使用メモリ | 281,464 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-07-02 03:49:18 |
合計ジャッジ時間 | 6,744 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 WA * 8 |
ソースコード
#include <bits/stdc++.h> #include <time.h> #include <sys/time.h> using namespace std; 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) { int64_t seed; cin >> seed; x = seed; std::vector<uint32_t> data; int S=0; for (int i = 0; i < 10000001; i++) { uint32_t a = generate(); //cout<< a << endl; if (a<2146000000){ S-=1; } else if (a>2149000000){ S+=1; } else{ data.push_back(a); } } std::sort(data.begin(), data.end()); //cout << S <<endl; if (data.size()%2==0){ cout << data[data.size()/2+S/2-1] << endl; } else{ cout << data[data.size()/2+S/2] << endl; } return 0; }