結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 193 ms
9,172 KB
testcase_01 AC 186 ms
8,388 KB
testcase_02 AC 188 ms
8,628 KB
testcase_03 AC 188 ms
8,584 KB
testcase_04 AC 187 ms
8,916 KB
testcase_05 AC 184 ms
8,640 KB
testcase_06 AC 191 ms
9,120 KB
testcase_07 AC 184 ms
9,284 KB
testcase_08 AC 185 ms
8,540 KB
testcase_09 AC 182 ms
9,480 KB
testcase_10 AC 183 ms
8,196 KB
testcase_11 AC 184 ms
8,192 KB
testcase_12 AC 189 ms
9,172 KB
testcase_13 AC 188 ms
8,212 KB
testcase_14 AC 190 ms
8,640 KB
testcase_15 AC 186 ms
8,844 KB
testcase_16 AC 185 ms
8,252 KB
testcase_17 AC 189 ms
8,176 KB
testcase_18 AC 185 ms
9,440 KB
testcase_19 AC 187 ms
8,408 KB
testcase_20 AC 187 ms
7,904 KB
testcase_21 AC 189 ms
8,968 KB
testcase_22 AC 184 ms
9,612 KB
testcase_23 AC 186 ms
8,176 KB
testcase_24 AC 186 ms
8,788 KB
testcase_25 AC 187 ms
8,200 KB
testcase_26 AC 190 ms
8,876 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