結果
| 問題 |
No.702 中央値を求めよ LIMITED
|
| コンテスト | |
| ユーザー |
%20
|
| 提出日時 | 2018-06-15 23:59:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 448 bytes |
| コンパイル時間 | 1,973 ms |
| コンパイル使用メモリ | 190,788 KB |
| 最終ジャッジ日時 | 2025-01-05 14:25:19 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 2 |
| other | MLE * 25 |
コンパイルメッセージ
main.cpp:14:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
14 | main(){
| ^~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
uint32_t x, y=1, z=2, w=3;
uint32_t generate() {
uint32_t t=(x^(x<<11));
x=y;
y=z;
z=w;
return w=(w^(w>>19))^(t^(t>>8));
}
const uint32_t d=3900000;
const uint32_t T=(1u<<31)-d;
int p,q[2*d];
main(){
cin>>x;
for(int i=0;i<10000001;++i){
uint32_t a=generate();
if(a<T){
++p;
}else if(a<T+2*d){
++q[a-T];
}
}
uint32_t i=T-1;
for(;p<=5000000;){
p+=q[++i-T];
}
cout<<i<<"\n";
}
%20