結果

問題 No.2918 Divide Applicants Fairly
ユーザー roiti46
提出日時 2024-10-12 03:50:19
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 288 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 556,508 KB
最終ジャッジ日時 2024-10-12 03:50:24
合計ジャッジ時間 4,356 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other MLE * 1 -- * 60
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
R = list(map(int, input().split()))

L = set()
for r in R:
    if r == 0: continue
    LL = L.copy()
    for l in L:
        LL.add(l + r)
        LL.add(l - r)
    LL.add(r)
    LL.add(-r)
    L = LL.copy()
ans = 10**10
for l in L:
    ans = min(ans, abs(l))
print(ans)
0