結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2022-06-23 14:16:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 11,016 KB
実行使用メモリ 53,100 KB
最終ジャッジ日時 2023-08-07 01:45:37
合計ジャッジ時間 14,718 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
29,624 KB
testcase_01 AC 129 ms
29,716 KB
testcase_02 AC 131 ms
29,704 KB
testcase_03 AC 135 ms
30,020 KB
testcase_04 WA -
testcase_05 AC 675 ms
53,100 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.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