結果

問題 No.1083 余りの余り
ユーザー wattaiheiwattaihei
提出日時 2020-06-19 22:39:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 564 ms / 3,000 ms
コード長 289 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 77,088 KB
最終ジャッジ日時 2023-09-16 14:54:30
合計ジャッジ時間 7,775 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,384 KB
testcase_01 AC 68 ms
71,268 KB
testcase_02 AC 73 ms
76,484 KB
testcase_03 AC 69 ms
71,252 KB
testcase_04 AC 74 ms
76,680 KB
testcase_05 AC 163 ms
77,016 KB
testcase_06 AC 69 ms
71,264 KB
testcase_07 AC 75 ms
76,352 KB
testcase_08 AC 78 ms
76,644 KB
testcase_09 AC 72 ms
71,260 KB
testcase_10 AC 74 ms
76,340 KB
testcase_11 AC 75 ms
76,700 KB
testcase_12 AC 69 ms
71,220 KB
testcase_13 AC 66 ms
71,404 KB
testcase_14 AC 69 ms
71,200 KB
testcase_15 AC 66 ms
71,180 KB
testcase_16 AC 67 ms
71,112 KB
testcase_17 AC 70 ms
71,444 KB
testcase_18 AC 248 ms
76,872 KB
testcase_19 AC 155 ms
76,472 KB
testcase_20 AC 78 ms
76,500 KB
testcase_21 AC 82 ms
76,648 KB
testcase_22 AC 69 ms
71,332 KB
testcase_23 AC 563 ms
76,724 KB
testcase_24 AC 561 ms
76,812 KB
testcase_25 AC 556 ms
76,856 KB
testcase_26 AC 564 ms
76,804 KB
testcase_27 AC 70 ms
76,336 KB
testcase_28 AC 561 ms
77,088 KB
testcase_29 AC 70 ms
71,324 KB
testcase_30 AC 69 ms
71,260 KB
testcase_31 AC 68 ms
71,264 KB
testcase_32 AC 68 ms
71,444 KB
testcase_33 AC 561 ms
76,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))


A.sort(reverse=True)
ans = 0
for bit in range(1<<N):
    p = K
    for i in range(N):
        if bit&(1<<i):
            p %= A[i]
    p %= A[-1]
    ans = max(ans, p)

print(ans)
0