結果

問題 No.868 ハイパー部分和問題
ユーザー mousemoodmousemood
提出日時 2019-09-16 23:53:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 351 bytes
コンパイル時間 511 ms
コンパイル使用メモリ 10,656 KB
実行使用メモリ 33,260 KB
最終ジャッジ日時 2023-09-21 08:12:01
合計ジャッジ時間 14,327 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 175 ms
30,136 KB
testcase_01 AC 180 ms
30,352 KB
testcase_02 AC 554 ms
33,260 KB
testcase_03 AC 146 ms
29,900 KB
testcase_04 AC 143 ms
29,584 KB
testcase_05 AC 145 ms
29,524 KB
testcase_06 AC 147 ms
29,656 KB
testcase_07 AC 142 ms
29,572 KB
testcase_08 AC 140 ms
29,780 KB
testcase_09 AC 147 ms
29,736 KB
testcase_10 AC 145 ms
29,652 KB
testcase_11 AC 144 ms
29,660 KB
testcase_12 AC 143 ms
29,500 KB
testcase_13 AC 144 ms
29,624 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

n, k = map(int, input().split())
a = list(map(int, input().split()))
q = int(input())

def func(arr, key):
    l = np.array([])

    for num in arr:
        l = np.unique(np.concatenate([l, [num], l + num]))

    return int(key in l)


for i in range(q):
    x, v = map(int, input().split())
    a[x - 1] = v
    print(func(a, k))
0