結果

問題 No.868 ハイパー部分和問題
ユーザー convexineqconvexineq
提出日時 2020-11-22 04:56:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 79,636 KB
最終ジャッジ日時 2023-09-30 22:28:44
合計ジャッジ時間 30,960 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
75,536 KB
testcase_01 AC 83 ms
75,728 KB
testcase_02 WA -
testcase_03 AC 80 ms
75,500 KB
testcase_04 AC 74 ms
71,212 KB
testcase_05 AC 75 ms
71,560 KB
testcase_06 AC 75 ms
71,540 KB
testcase_07 AC 74 ms
71,168 KB
testcase_08 AC 74 ms
71,256 KB
testcase_09 AC 75 ms
71,208 KB
testcase_10 AC 73 ms
71,220 KB
testcase_11 AC 75 ms
71,452 KB
testcase_12 AC 74 ms
71,208 KB
testcase_13 AC 75 ms
71,372 KB
testcase_14 AC 1,286 ms
79,520 KB
testcase_15 AC 1,282 ms
79,636 KB
testcase_16 AC 1,283 ms
79,540 KB
testcase_17 AC 1,275 ms
79,456 KB
testcase_18 AC 1,287 ms
79,488 KB
testcase_19 AC 986 ms
77,936 KB
testcase_20 AC 988 ms
77,940 KB
testcase_21 AC 1,001 ms
78,044 KB
testcase_22 AC 992 ms
77,956 KB
testcase_23 AC 870 ms
78,700 KB
testcase_24 AC 988 ms
78,160 KB
testcase_25 AC 994 ms
78,584 KB
testcase_26 AC 991 ms
78,040 KB
testcase_27 AC 993 ms
78,140 KB
testcase_28 AC 996 ms
78,252 KB
testcase_29 AC 717 ms
79,416 KB
testcase_30 AC 722 ms
79,496 KB
testcase_31 AC 725 ms
79,384 KB
testcase_32 AC 1,282 ms
79,416 KB
testcase_33 AC 1,284 ms
79,340 KB
testcase_34 WA -
testcase_35 AC 1,984 ms
78,680 KB
testcase_36 AC 1,423 ms
79,220 KB
testcase_37 AC 1,416 ms
79,500 KB
testcase_38 AC 74 ms
71,344 KB
testcase_39 AC 75 ms
71,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def mul(c,m):
    for i in range(m,c-1,-1): dp[i] = (dp[i]+dp[i-c])%MOD
def div(c,m):
    for i in range(m-c+1): dp[i+c] = (dp[i+c]-dp[i])%MOD
n,k = map(int,input().split())
*a, = map(int,input().split())
MOD = 1<<59+1
dp = [0]*(k+1)
dp[0] = 1
for i in a: mul(i,k)
q = int(input())
for _ in range(q):
    x,v = map(int,input().split())
    if a[x-1]: div(a[x-1],k)
    if v: mul(v,k)
    a[x-1] = v
    print(1 if dp[-1] else 0)
0