結果

問題 No.702 中央値を求めよ LIMITED
ユーザー cielciel
提出日時 2018-06-17 23:17:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 574 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 46,976 KB
実行使用メモリ 22,784 KB
最終ジャッジ日時 2024-05-02 09:39:36
合計ジャッジ時間 16,138 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 528 ms
22,656 KB
testcase_01 AC 542 ms
22,656 KB
testcase_02 AC 531 ms
22,656 KB
testcase_03 AC 564 ms
22,656 KB
testcase_04 AC 574 ms
22,784 KB
testcase_05 AC 568 ms
22,656 KB
testcase_06 AC 535 ms
22,656 KB
testcase_07 AC 528 ms
22,656 KB
testcase_08 AC 528 ms
22,784 KB
testcase_09 AC 524 ms
22,656 KB
testcase_10 AC 535 ms
22,656 KB
testcase_11 AC 526 ms
22,656 KB
testcase_12 AC 537 ms
22,656 KB
testcase_13 AC 536 ms
22,656 KB
testcase_14 AC 528 ms
22,656 KB
testcase_15 AC 545 ms
22,656 KB
testcase_16 AC 541 ms
22,784 KB
testcase_17 AC 540 ms
22,656 KB
testcase_18 AC 540 ms
22,784 KB
testcase_19 AC 536 ms
22,784 KB
testcase_20 AC 539 ms
22,656 KB
testcase_21 AC 554 ms
22,784 KB
testcase_22 AC 540 ms
22,656 KB
testcase_23 AC 526 ms
22,656 KB
testcase_24 AC 542 ms
22,656 KB
testcase_25 AC 534 ms
22,656 KB
testcase_26 AC 533 ms
22,656 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<1U<<30)m++;
		else if(w<(1U<<31|1U<<30))a[n++]=w;
	}
	std::sort(a,a+n);
	printf("%u\n",a[5000000-m]);
}
0