結果

問題 No.814 ジジ抜き
ユーザー vwxyzvwxyz
提出日時 2022-06-23 13:50:12
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 494 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 114,228 KB
最終ジャッジ日時 2024-04-24 19:28:15
合計ジャッジ時間 34,821 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,968 KB
testcase_01 AC 40 ms
51,968 KB
testcase_02 AC 41 ms
52,608 KB
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
権限があれば一括ダウンロードができます

ソースコード

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
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)
def is_ok(ans):
    cnt=0
    for k,l,d in zip(K,L,D):
        cnt+=min(k,(ans-l)//(1<<d)+1)
    return cnt&1
ans=Bisect_Int(1<<60,-1,is_ok)
print(ans)
0