結果

問題 No.702 中央値を求めよ LIMITED
ユーザー cielciel
提出日時 2018-06-17 23:17:05
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 611 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 46,712 KB
実行使用メモリ 23,552 KB
最終ジャッジ日時 2023-08-14 21:35:59
合計ジャッジ時間 18,440 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 602 ms
23,408 KB
testcase_01 AC 607 ms
23,376 KB
testcase_02 AC 604 ms
23,472 KB
testcase_03 AC 600 ms
23,412 KB
testcase_04 AC 607 ms
23,416 KB
testcase_05 AC 606 ms
23,420 KB
testcase_06 AC 604 ms
23,444 KB
testcase_07 AC 609 ms
23,480 KB
testcase_08 AC 603 ms
23,440 KB
testcase_09 AC 606 ms
23,412 KB
testcase_10 AC 603 ms
23,484 KB
testcase_11 AC 600 ms
23,448 KB
testcase_12 AC 607 ms
23,504 KB
testcase_13 AC 608 ms
23,444 KB
testcase_14 AC 604 ms
23,472 KB
testcase_15 AC 603 ms
23,476 KB
testcase_16 AC 602 ms
23,416 KB
testcase_17 AC 607 ms
23,552 KB
testcase_18 AC 603 ms
23,452 KB
testcase_19 AC 605 ms
23,432 KB
testcase_20 AC 606 ms
23,472 KB
testcase_21 AC 604 ms
23,444 KB
testcase_22 AC 605 ms
23,480 KB
testcase_23 AC 597 ms
23,476 KB
testcase_24 AC 611 ms
23,480 KB
testcase_25 AC 606 ms
23,376 KB
testcase_26 AC 603 ms
23,420 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