結果

問題 No.702 中央値を求めよ LIMITED
ユーザー kotatsugame
提出日時 2019-09-28 00:05:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 367 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 64,384 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 06:07:44
合計ジャッジ時間 14,804 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
unsigned int m,seed,n=1e7+1,t,x,y,z,w,f=2144000000L,l=2150000000L;
main()
{
	cin>>seed;
	while(l-f>1)
	{
		m=((long)f+(long)l)/2;
		x=seed;y=1,z=2,w=3;
		int cnt=0;
		for(int i=0;i<n;i++)
		{
			t=(x^(x<<11));
			x=y,y=z,z=w;
			w=(w^(w>>19))^(t^(t>>8));
			cnt+=w<=m;
		}
		if(cnt<5000001)f=m;
		else l=m;
	}
	cout<<l<<endl;
}
0