結果

問題 No.702 中央値を求めよ LIMITED
ユーザー kotatsugamekotatsugame
提出日時 2019-09-28 00:05:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 367 bytes
コンパイル時間 712 ms
コンパイル使用メモリ 65,140 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 21:04:44
合計ジャッジ時間 15,578 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 505 ms
5,248 KB
testcase_01 AC 482 ms
5,376 KB
testcase_02 AC 484 ms
5,376 KB
testcase_03 AC 498 ms
5,376 KB
testcase_04 AC 506 ms
5,376 KB
testcase_05 AC 504 ms
5,376 KB
testcase_06 AC 506 ms
5,376 KB
testcase_07 AC 500 ms
5,376 KB
testcase_08 AC 482 ms
5,376 KB
testcase_09 AC 496 ms
5,376 KB
testcase_10 AC 500 ms
5,376 KB
testcase_11 AC 502 ms
5,376 KB
testcase_12 AC 507 ms
5,376 KB
testcase_13 AC 477 ms
5,376 KB
testcase_14 AC 503 ms
5,376 KB
testcase_15 AC 502 ms
5,376 KB
testcase_16 AC 484 ms
5,376 KB
testcase_17 AC 473 ms
5,376 KB
testcase_18 AC 499 ms
5,376 KB
testcase_19 AC 501 ms
5,376 KB
testcase_20 AC 497 ms
5,376 KB
testcase_21 AC 503 ms
5,376 KB
testcase_22 AC 483 ms
5,376 KB
testcase_23 AC 485 ms
5,376 KB
testcase_24 AC 483 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 503 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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