結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2022-06-23 14:17:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 63,944 KB
最終ジャッジ日時 2024-04-24 20:01:03
合計ジャッジ時間 28,771 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 462 ms
43,728 KB
testcase_01 AC 449 ms
43,604 KB
testcase_02 AC 446 ms
43,836 KB
testcase_03 AC 445 ms
43,580 KB
testcase_04 WA -
testcase_05 AC 1,323 ms
63,944 KB
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 WA -
権限があれば一括ダウンロードができます

ソースコード

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=min(k,1<<62)
    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):
    return np.sum(np.minimum(K,(ans-L>>D)+1)&1)&1
ans=Bisect_Int(1<<62,-1,is_ok)
print(ans)
0