結果

問題 No.702 中央値を求めよ LIMITED
ユーザー kotatsugamekotatsugame
提出日時 2022-08-15 04:06:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 523 ms / 5,000 ms
コード長 367 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 66,700 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 18:35:52
合計ジャッジ時間 16,297 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 519 ms
6,816 KB
testcase_01 AC 521 ms
6,944 KB
testcase_02 AC 519 ms
6,940 KB
testcase_03 AC 498 ms
6,940 KB
testcase_04 AC 497 ms
6,940 KB
testcase_05 AC 520 ms
6,944 KB
testcase_06 AC 520 ms
6,944 KB
testcase_07 AC 521 ms
6,940 KB
testcase_08 AC 522 ms
6,940 KB
testcase_09 AC 520 ms
6,940 KB
testcase_10 AC 520 ms
6,944 KB
testcase_11 AC 520 ms
6,940 KB
testcase_12 AC 520 ms
6,940 KB
testcase_13 AC 520 ms
6,944 KB
testcase_14 AC 523 ms
6,944 KB
testcase_15 AC 520 ms
6,948 KB
testcase_16 AC 523 ms
6,944 KB
testcase_17 AC 520 ms
6,944 KB
testcase_18 AC 497 ms
6,940 KB
testcase_19 AC 519 ms
6,944 KB
testcase_20 AC 520 ms
6,944 KB
testcase_21 AC 520 ms
6,944 KB
testcase_22 AC 520 ms
6,944 KB
testcase_23 AC 520 ms
6,944 KB
testcase_24 AC 520 ms
6,940 KB
testcase_25 AC 520 ms
6,940 KB
testcase_26 AC 498 ms
6,944 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=2151000000L;
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