結果

問題 No.702 中央値を求めよ LIMITED
ユーザー vwxyzvwxyz
提出日時 2022-06-22 04:47:19
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 520 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 16,960 KB
最終ジャッジ日時 2023-08-05 09:36:43
合計ジャッジ時間 13,610 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

def Bisect_Int(ok,ng,is_ok):
    while abs(ok-ng)>1:
        mid=(ok+ng)//2
        if is_ok(mid):
            ok=mid
        else:
            ng=mid
    return ok

seed=int(readline())
bit=(1<<32)-1
def is_ok(ans):
    cnt=0
    x,y,z,w=seed,1,2,3
    for _ in range(10000001):
        t=(x^(x<<11)&bit)
        x=y
        y=z
        z=w
        w=(w^(w>>19))^(t^(t>>8))
        if w<ans:
            cnt+=1
    return cnt<=5000000
ans=Bisect_Int(7<<28,9<<28,is_ok)
print(ans)
0