結果

問題 No.702 中央値を求めよ LIMITED
ユーザー %20%20
提出日時 2018-06-15 23:59:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 448 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 193,440 KB
実行使用メモリ 31,488 KB
最終ジャッジ日時 2024-04-24 20:59:26
合計ジャッジ時間 4,544 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
31,104 KB
testcase_01 AC 71 ms
31,360 KB
testcase_02 AC 71 ms
31,488 KB
testcase_03 AC 70 ms
31,232 KB
testcase_04 AC 70 ms
31,360 KB
testcase_05 AC 72 ms
31,360 KB
testcase_06 AC 72 ms
31,232 KB
testcase_07 AC 71 ms
31,232 KB
testcase_08 AC 72 ms
31,104 KB
testcase_09 AC 71 ms
30,976 KB
testcase_10 AC 71 ms
31,488 KB
testcase_11 AC 70 ms
31,232 KB
testcase_12 AC 71 ms
31,360 KB
testcase_13 AC 69 ms
31,232 KB
testcase_14 AC 71 ms
31,360 KB
testcase_15 AC 70 ms
30,976 KB
testcase_16 AC 69 ms
31,360 KB
testcase_17 AC 71 ms
31,360 KB
testcase_18 AC 72 ms
31,360 KB
testcase_19 AC 73 ms
31,488 KB
testcase_20 AC 72 ms
31,104 KB
testcase_21 AC 71 ms
31,360 KB
testcase_22 AC 70 ms
31,104 KB
testcase_23 AC 76 ms
31,232 KB
testcase_24 AC 74 ms
31,104 KB
testcase_25 AC 75 ms
31,232 KB
testcase_26 AC 73 ms
31,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~

ソースコード

diff #

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