結果
| 問題 |
No.702 中央値を求めよ LIMITED
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2022-06-22 04:47:19 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 520 bytes |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 21,248 KB |
| 最終ジャッジ日時 | 2024-10-15 07:00:42 |
| 合計ジャッジ時間 | 12,911 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 1 |
| other | -- * 25 |
ソースコード
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)
vwxyz