結果
| 問題 | No.702 中央値を求めよ LIMITED | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-06-17 23:17:05 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 628 ms / 5,000 ms | 
| コード長 | 355 bytes | 
| コンパイル時間 | 270 ms | 
| コンパイル使用メモリ | 43,136 KB | 
| 最終ジャッジ日時 | 2025-01-05 14:37:33 | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 25 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%u",&x);
      |         ~~~~~^~~~~~~~~
            
            ソースコード
#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]);
}
            
            
            
        