結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2022-06-23 14:10:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 566 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 102,520 KB
最終ジャッジ日時 2024-04-24 19:51:43
合計ジャッジ時間 27,566 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 480 ms
44,220 KB
testcase_01 AC 465 ms
44,092 KB
testcase_02 AC 466 ms
44,348 KB
testcase_03 AC 463 ms
44,096 KB
testcase_04 MLE -
testcase_05 MLE -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 MLE -
権限があれば一括ダウンロードができます

ソースコード

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
import numpy as np
N=int(readline())
K,L,D=[],[],[]
for _ in range(N):
    k,l,d=map(int,readline().split())
    K.append(k)
    L.append(l)
    D.append(d)
K=np.array(K,dtype=np.int64)
L=np.array(L,dtype=np.int64)
D=np.array(D,dtype=np.int64)
def is_ok(ans):
    cnt=0
    return np.sum(np.minimum(K,(ans-L>>D)+1)&1)&1
ans=Bisect_Int(1<<60,-1,is_ok)
print(ans)
0