結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2022-06-23 14:30:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 608 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 66,424 KB
最終ジャッジ日時 2024-04-24 20:19:06
合計ジャッジ時間 32,744 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 534 ms
44,024 KB
testcase_01 AC 538 ms
44,408 KB
testcase_02 AC 540 ms
44,280 KB
testcase_03 AC 549 ms
44,664 KB
testcase_04 MLE -
testcase_05 MLE -
testcase_06 AC 1,700 ms
62,588 KB
testcase_07 AC 872 ms
51,832 KB
testcase_08 AC 1,181 ms
62,332 KB
testcase_09 AC 1,366 ms
55,420 KB
testcase_10 AC 1,331 ms
62,336 KB
testcase_11 AC 1,652 ms
62,200 KB
testcase_12 AC 984 ms
51,448 KB
testcase_13 AC 892 ms
51,580 KB
testcase_14 AC 1,195 ms
56,696 KB
testcase_15 AC 854 ms
49,528 KB
testcase_16 AC 811 ms
49,536 KB
testcase_17 AC 1,471 ms
59,000 KB
testcase_18 AC 1,151 ms
54,912 KB
testcase_19 AC 1,248 ms
61,948 KB
testcase_20 AC 1,040 ms
52,216 KB
testcase_21 AC 920 ms
52,484 KB
testcase_22 AC 1,034 ms
59,252 KB
testcase_23 AC 804 ms
50,040 KB
testcase_24 AC 982 ms
56,184 KB
testcase_25 AC 894 ms
53,624 KB
権限があれば一括ダウンロードができます

ソースコード

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):
    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