結果
問題 | No.1645 AB's abs |
ユーザー |
👑 ![]() |
提出日時 | 2021-08-13 21:28:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 144 ms / 2,000 ms |
コード長 | 321 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,444 KB |
実行使用メモリ | 79,728 KB |
最終ジャッジ日時 | 2024-10-03 17:12:24 |
合計ジャッジ時間 | 5,094 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 |
ソースコード
from collections import defaultdictN=int(input())A=list(map(int,input().split()))Mod=998244353D=defaultdict(int); D[0]=1for a in A:E=DD=defaultdict(int)for x in E:D[x+a]+=E[x]D[x-a]+=E[x]for x in D:D[x]%=ModY=0for x in D:Y+=abs(x)*D[x]Y%=Modprint(Y)