結果

問題 No.814 ジジ抜き
ユーザー maspymaspy
提出日時 2020-03-25 02:06:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 553 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 75,548 KB
最終ジャッジ日時 2023-08-30 09:12:37
合計ジャッジ時間 14,852 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
29,600 KB
testcase_01 AC 134 ms
29,624 KB
testcase_02 AC 135 ms
29,700 KB
testcase_03 AC 140 ms
30,016 KB
testcase_04 AC 618 ms
62,612 KB
testcase_05 AC 628 ms
62,764 KB
testcase_06 MLE -
testcase_07 AC 415 ms
52,296 KB
testcase_08 MLE -
testcase_09 AC 514 ms
61,840 KB
testcase_10 MLE -
testcase_11 MLE -
testcase_12 AC 425 ms
51,736 KB
testcase_13 AC 426 ms
51,964 KB
testcase_14 MLE -
testcase_15 AC 350 ms
46,564 KB
testcase_16 AC 346 ms
46,860 KB
testcase_17 MLE -
testcase_18 AC 557 ms
61,832 KB
testcase_19 MLE -
testcase_20 AC 417 ms
52,000 KB
testcase_21 AC 449 ms
54,740 KB
testcase_22 MLE -
testcase_23 AC 380 ms
48,132 KB
testcase_24 AC 542 ms
62,136 KB
testcase_25 AC 441 ms
55,384 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]
D = 1 << D


def test(x):
    # x 以下が奇数個ある
    return np.minimum(K, np.maximum(0, (x - L) // D + 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