結果

問題 No.702 中央値を求めよ LIMITED
ユーザー cielciel
提出日時 2018-06-17 23:43:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 207 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 46,528 KB
実行使用メモリ 9,152 KB
最終ジャッジ日時 2023-08-14 21:35:35
合計ジャッジ時間 7,367 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 206 ms
9,124 KB
testcase_01 AC 205 ms
9,096 KB
testcase_02 AC 204 ms
9,088 KB
testcase_03 AC 205 ms
9,100 KB
testcase_04 AC 204 ms
9,124 KB
testcase_05 AC 204 ms
9,036 KB
testcase_06 AC 205 ms
9,092 KB
testcase_07 AC 204 ms
9,132 KB
testcase_08 AC 204 ms
9,152 KB
testcase_09 AC 204 ms
9,088 KB
testcase_10 AC 204 ms
9,028 KB
testcase_11 AC 202 ms
9,092 KB
testcase_12 AC 204 ms
9,092 KB
testcase_13 AC 204 ms
9,080 KB
testcase_14 AC 206 ms
9,080 KB
testcase_15 AC 204 ms
9,092 KB
testcase_16 AC 205 ms
9,032 KB
testcase_17 AC 204 ms
9,148 KB
testcase_18 AC 207 ms
9,152 KB
testcase_19 AC 203 ms
9,120 KB
testcase_20 AC 206 ms
9,096 KB
testcase_21 AC 204 ms
9,116 KB
testcase_22 AC 204 ms
9,112 KB
testcase_23 AC 204 ms
9,116 KB
testcase_24 AC 204 ms
9,148 KB
testcase_25 AC 204 ms
9,112 KB
testcase_26 AC 204 ms
9,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <algorithm>
unsigned int a[6000000];
int main(){
	unsigned int i=0,n=0,m=0,t,x,y=1,z=2,w=3;
	scanf("%u",&x);
	for(;i<10000001;i++){
		t = (x^(x<<11));
		x = y;
		y = z;
		z = w;
		w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
		if(w<0x70000000)m++;
		else if(w<0x90000000)a[n++]=w;
	}
	std::sort(a,a+n);
	printf("%u\n",a[5000000-m]);
}
0