結果

問題 No.1083 余りの余り
ユーザー anagohirame
提出日時 2020-06-20 15:45:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 239 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 82,972 KB
実行使用メモリ 76,464 KB
最終ジャッジ日時 2024-07-03 17:21:36
合計ジャッジ時間 5,954 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 11 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for b in range(1, 1<<n):
    res = k
    for i in range(n):
        if (b>>i) & 1:
            res %= a[i]
    ans = max(ans, res)
print(ans)
0