結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2024-04-24 20:49:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 68,980 KB
最終ジャッジ日時 2024-04-24 20:49:50
合計ジャッジ時間 10,427 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 679 ms
49,784 KB
testcase_01 AC 602 ms
44,160 KB
testcase_02 AC 528 ms
44,408 KB
testcase_03 WA -
testcase_04 MLE -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

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.int32)
L=np.array(L,dtype=np.int32)
D=np.array(D,dtype=np.int32)
def is_ok(ans):
    where=np.where(ans>=L)[0]
    return np.sum(np.minimum(K[where],(ans-L[where]>>D[where])+1)%2)%2
ans=Bisect_Int(1<<60,-1,is_ok)
print(ans)
0