結果

問題 No.1645 AB's abs
ユーザー googol_S0googol_S0
提出日時 2021-08-13 21:40:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 82,832 KB
実行使用メモリ 88,020 KB
最終ジャッジ日時 2024-04-14 17:15:39
合計ジャッジ時間 5,447 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
65,856 KB
testcase_01 AC 48 ms
63,532 KB
testcase_02 AC 78 ms
75,744 KB
testcase_03 AC 48 ms
62,504 KB
testcase_04 AC 58 ms
67,032 KB
testcase_05 AC 59 ms
66,960 KB
testcase_06 AC 64 ms
69,304 KB
testcase_07 AC 58 ms
66,032 KB
testcase_08 AC 84 ms
76,112 KB
testcase_09 AC 84 ms
77,420 KB
testcase_10 AC 82 ms
75,780 KB
testcase_11 AC 82 ms
76,604 KB
testcase_12 AC 82 ms
75,056 KB
testcase_13 AC 117 ms
87,152 KB
testcase_14 AC 112 ms
86,576 KB
testcase_15 AC 116 ms
87,412 KB
testcase_16 AC 114 ms
85,708 KB
testcase_17 AC 115 ms
86,852 KB
testcase_18 AC 114 ms
85,112 KB
testcase_19 AC 117 ms
86,428 KB
testcase_20 AC 112 ms
85,304 KB
testcase_21 AC 114 ms
85,684 KB
testcase_22 AC 116 ms
85,944 KB
testcase_23 AC 118 ms
87,000 KB
testcase_24 AC 118 ms
86,544 KB
testcase_25 AC 117 ms
87,264 KB
testcase_26 AC 117 ms
86,968 KB
testcase_27 AC 118 ms
87,972 KB
testcase_28 AC 117 ms
86,584 KB
testcase_29 AC 118 ms
87,576 KB
testcase_30 AC 117 ms
86,392 KB
testcase_31 AC 117 ms
86,732 KB
testcase_32 AC 116 ms
86,452 KB
testcase_33 AC 117 ms
86,864 KB
testcase_34 AC 117 ms
88,020 KB
testcase_35 AC 118 ms
87,480 KB
testcase_36 AC 116 ms
86,512 KB
testcase_37 AC 115 ms
87,508 KB
testcase_38 AC 118 ms
86,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
DP=[[0]*22222 for i in range(N+1)]
DP[0][0]=1
mod=998244353
for i in range(N):
  for j in range(-10000,10001):
    DP[i+1][j+A[i]]=(DP[i+1][j+A[i]]+DP[i][j])%mod
    DP[i+1][j-A[i]]=(DP[i+1][j-A[i]]+DP[i][j])%mod
print(sum([DP[N][i]*abs(i) for i in range(-10000,10001)])%mod)
0