結果

問題 No.702 中央値を求めよ LIMITED
ユーザー mamumamura1mamumamura1
提出日時 2018-06-16 12:39:40
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 978 bytes
コンパイル時間 1,647 ms
コンパイル使用メモリ 166,364 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 00:32:46
合計ジャッジ時間 48,225 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,656 ms
4,380 KB
testcase_01 AC 1,478 ms
4,380 KB
testcase_02 AC 1,633 ms
4,380 KB
testcase_03 AC 1,568 ms
4,380 KB
testcase_04 AC 1,648 ms
4,380 KB
testcase_05 AC 1,638 ms
4,376 KB
testcase_06 AC 1,510 ms
4,376 KB
testcase_07 AC 1,502 ms
4,380 KB
testcase_08 AC 1,621 ms
4,380 KB
testcase_09 AC 1,650 ms
4,376 KB
testcase_10 AC 1,584 ms
4,380 KB
testcase_11 AC 1,501 ms
4,380 KB
testcase_12 AC 1,670 ms
4,384 KB
testcase_13 WA -
testcase_14 AC 1,697 ms
4,380 KB
testcase_15 AC 1,656 ms
4,380 KB
testcase_16 AC 1,469 ms
4,380 KB
testcase_17 AC 1,740 ms
4,376 KB
testcase_18 AC 1,618 ms
4,380 KB
testcase_19 AC 1,655 ms
4,384 KB
testcase_20 AC 1,670 ms
4,376 KB
testcase_21 AC 1,648 ms
4,380 KB
testcase_22 AC 1,570 ms
4,376 KB
testcase_23 AC 1,643 ms
4,380 KB
testcase_24 AC 1,657 ms
4,380 KB
testcase_25 AC 1,686 ms
4,380 KB
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
uint32_t x=0,y=1,z=2,w=3;
uint32_t generate() { 
    uint32_t t = (x^(x<<11));
    x = y;
    y = z;
    z = w;
    w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); 
    return w;
}
int main(){
  uint32_t seed;
  cin>>seed;
  x=seed;
  deque<uint32_t>a;
  ll left=0,right=pow(2,32);
  ll mid=0;
  while(right-left>1){
    //  cout<<left<<" "<<right<<endl;
    mid=(left+right)/2;
    x=seed;y=1;z=2;w=3;
    int cnt=0;
    int cnt2=0;
    for(int i=0;i<10000001;i++){
      ll num=generate();
      if(mid<num)
	cnt++;
      else if(mid>num)
	cnt2++;
    }
    if(cnt==5000000&&cnt2==5000000){cout<<mid<<endl;break;}
    else if(cnt<5000000){
      right=mid;
    }else if(cnt>5000000){
      left=mid;
    }else if(cnt==5000000){
      right=mid;
    }
  }
  //cout<<mid<<endl;
  return 0;
}
0