結果

問題 No.814 ジジ抜き
ユーザー maspymaspy
提出日時 2020-03-25 02:05:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 555 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 78,360 KB
最終ジャッジ日時 2023-08-30 09:11:38
合計ジャッジ時間 18,478 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
29,728 KB
testcase_01 AC 134 ms
29,608 KB
testcase_02 AC 133 ms
29,596 KB
testcase_03 AC 139 ms
30,104 KB
testcase_04 MLE -
testcase_05 AC 593 ms
62,248 KB
testcase_06 MLE -
testcase_07 AC 397 ms
52,096 KB
testcase_08 MLE -
testcase_09 AC 500 ms
61,740 KB
testcase_10 MLE -
testcase_11 MLE -
testcase_12 AC 413 ms
51,716 KB
testcase_13 AC 424 ms
51,876 KB
testcase_14 MLE -
testcase_15 AC 340 ms
46,700 KB
testcase_16 AC 340 ms
46,672 KB
testcase_17 MLE -
testcase_18 AC 543 ms
59,992 KB
testcase_19 MLE -
testcase_20 AC 402 ms
51,956 KB
testcase_21 AC 444 ms
54,708 KB
testcase_22 MLE -
testcase_23 AC 362 ms
48,220 KB
testcase_24 AC 581 ms
62,136 KB
testcase_25 AC 440 ms
55,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

N = int(readline())
KLD = np.array(read().split(), np.int64)

K = KLD[::3]
L = KLD[1::3]
D = KLD[2::3]
D2 = 1 << D


def test(x):
    # x 以下が奇数個ある
    return np.minimum(K, np.maximum(0, (x - L) // D2 + 1)).sum() % 2 == 1


left = -1
right = 10 ** 18 + 10
while left + 1 < right:
    x = (left + right) // 2
    if test(x):
        right = x
    else:
        left = x
print(right)
0