結果

問題 No.702 中央値を求めよ LIMITED
ユーザー cielciel
提出日時 2018-06-17 23:17:55
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 527 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 4,937 ms
コンパイル使用メモリ 117,248 KB
実行使用メモリ 22,656 KB
最終ジャッジ日時 2024-05-02 09:37:48
合計ジャッジ時間 16,835 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 504 ms
22,528 KB
testcase_01 AC 502 ms
22,528 KB
testcase_02 AC 506 ms
22,656 KB
testcase_03 AC 498 ms
22,656 KB
testcase_04 AC 504 ms
22,656 KB
testcase_05 AC 506 ms
22,528 KB
testcase_06 AC 502 ms
22,656 KB
testcase_07 AC 511 ms
22,528 KB
testcase_08 AC 518 ms
22,528 KB
testcase_09 AC 519 ms
22,528 KB
testcase_10 AC 509 ms
22,528 KB
testcase_11 AC 513 ms
22,656 KB
testcase_12 AC 518 ms
22,528 KB
testcase_13 AC 511 ms
22,528 KB
testcase_14 AC 510 ms
22,528 KB
testcase_15 AC 515 ms
22,528 KB
testcase_16 AC 506 ms
22,528 KB
testcase_17 AC 527 ms
22,528 KB
testcase_18 AC 511 ms
22,528 KB
testcase_19 AC 516 ms
22,528 KB
testcase_20 AC 508 ms
22,656 KB
testcase_21 AC 513 ms
22,656 KB
testcase_22 AC 522 ms
22,656 KB
testcase_23 AC 510 ms
22,656 KB
testcase_24 AC 516 ms
22,656 KB
testcase_25 AC 509 ms
22,528 KB
testcase_26 AC 513 ms
22,528 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