結果

問題 No.1083 余りの余り
ユーザー nephrologist
提出日時 2020-06-19 21:47:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 92,288 KB
最終ジャッジ日時 2024-07-03 14:14:37
合計ジャッジ時間 6,434 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
dp = [-1] * (1 << n + 1)
dp[0] = k
for s in range(1 << n):
    for i in range(n):
        ns = s | 1 << i
        dp[ns] = max(dp[ns], dp[s] % A[i])
        # print(s, ns, dp[ns])
print(dp[(1 << n) - 1])
0