結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2024-04-24 20:53:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 607 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 66,680 KB
最終ジャッジ日時 2024-04-24 20:54:17
合計ジャッジ時間 28,814 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 449 ms
44,188 KB
testcase_01 AC 475 ms
44,152 KB
testcase_02 AC 451 ms
44,412 KB
testcase_03 AC 451 ms
44,408 KB
testcase_04 MLE -
testcase_05 MLE -
testcase_06 AC 1,448 ms
62,972 KB
testcase_07 AC 785 ms
51,712 KB
testcase_08 AC 1,034 ms
62,580 KB
testcase_09 AC 1,145 ms
55,288 KB
testcase_10 AC 1,158 ms
62,336 KB
testcase_11 AC 1,420 ms
62,456 KB
testcase_12 AC 871 ms
51,708 KB
testcase_13 AC 798 ms
51,704 KB
testcase_14 AC 986 ms
56,180 KB
testcase_15 AC 746 ms
49,400 KB
testcase_16 AC 728 ms
49,660 KB
testcase_17 AC 1,272 ms
58,620 KB
testcase_18 AC 965 ms
55,288 KB
testcase_19 AC 1,104 ms
61,944 KB
testcase_20 AC 887 ms
51,576 KB
testcase_21 AC 812 ms
52,480 KB
testcase_22 AC 937 ms
59,040 KB
testcase_23 AC 734 ms
50,232 KB
testcase_24 AC 880 ms
56,184 KB
testcase_25 AC 806 ms
53,244 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.int8)
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