結果

問題 No.702 中央値を求めよ LIMITED
ユーザー kotatsugamekotatsugame
提出日時 2018-06-18 06:09:49
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 368 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 64,876 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 08:40:29
合計ジャッジ時間 15,720 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 499 ms
4,380 KB
testcase_01 AC 502 ms
4,380 KB
testcase_02 AC 498 ms
4,380 KB
testcase_03 AC 496 ms
4,380 KB
testcase_04 AC 497 ms
4,380 KB
testcase_05 AC 497 ms
4,384 KB
testcase_06 AC 499 ms
4,376 KB
testcase_07 AC 497 ms
4,380 KB
testcase_08 AC 498 ms
4,376 KB
testcase_09 AC 498 ms
4,376 KB
testcase_10 AC 497 ms
4,376 KB
testcase_11 AC 497 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 497 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 496 ms
4,380 KB
testcase_16 AC 498 ms
4,380 KB
testcase_17 AC 499 ms
4,376 KB
testcase_18 AC 499 ms
4,376 KB
testcase_19 AC 496 ms
4,380 KB
testcase_20 AC 497 ms
4,380 KB
testcase_21 AC 497 ms
4,376 KB
testcase_22 AC 496 ms
4,376 KB
testcase_23 AC 498 ms
4,380 KB
testcase_24 AC 498 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 498 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
unsigned int m,seed,n=1e7+1,t,x,y,z,w,f=2145000000L,l=2149000000L;
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