結果

問題 No.1083 余りの余り
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-06-28 20:22:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 232 ms / 3,000 ms
コード長 259 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 77,216 KB
最終ジャッジ日時 2023-09-07 21:22:17
合計ジャッジ時間 6,022 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,240 KB
testcase_01 AC 69 ms
71,480 KB
testcase_02 AC 67 ms
71,588 KB
testcase_03 AC 64 ms
71,392 KB
testcase_04 AC 73 ms
76,592 KB
testcase_05 AC 111 ms
76,592 KB
testcase_06 AC 66 ms
71,164 KB
testcase_07 AC 76 ms
76,536 KB
testcase_08 AC 68 ms
71,336 KB
testcase_09 AC 68 ms
71,408 KB
testcase_10 AC 66 ms
71,476 KB
testcase_11 AC 70 ms
76,752 KB
testcase_12 AC 66 ms
71,308 KB
testcase_13 AC 64 ms
71,348 KB
testcase_14 AC 67 ms
71,340 KB
testcase_15 AC 63 ms
71,168 KB
testcase_16 AC 68 ms
71,560 KB
testcase_17 AC 68 ms
71,276 KB
testcase_18 AC 146 ms
76,520 KB
testcase_19 AC 111 ms
76,524 KB
testcase_20 AC 71 ms
76,712 KB
testcase_21 AC 76 ms
76,560 KB
testcase_22 AC 65 ms
71,388 KB
testcase_23 AC 226 ms
76,736 KB
testcase_24 AC 226 ms
77,180 KB
testcase_25 AC 224 ms
77,060 KB
testcase_26 AC 227 ms
76,900 KB
testcase_27 AC 68 ms
71,520 KB
testcase_28 AC 231 ms
77,216 KB
testcase_29 AC 66 ms
71,364 KB
testcase_30 AC 64 ms
71,444 KB
testcase_31 AC 63 ms
71,348 KB
testcase_32 AC 64 ms
71,416 KB
testcase_33 AC 232 ms
76,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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