結果

問題 No.1083 余りの余り
ユーザー AEnAEn
提出日時 2022-05-16 21:36:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 269 ms / 3,000 ms
コード長 244 bytes
コンパイル時間 1,426 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 77,168 KB
最終ジャッジ日時 2023-10-12 16:01:46
合計ジャッジ時間 5,755 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,312 KB
testcase_01 AC 69 ms
71,176 KB
testcase_02 AC 70 ms
71,472 KB
testcase_03 AC 68 ms
71,492 KB
testcase_04 AC 99 ms
76,612 KB
testcase_05 AC 120 ms
76,828 KB
testcase_06 AC 69 ms
71,316 KB
testcase_07 AC 77 ms
76,428 KB
testcase_08 AC 72 ms
71,440 KB
testcase_09 AC 71 ms
71,372 KB
testcase_10 AC 70 ms
71,472 KB
testcase_11 AC 75 ms
76,464 KB
testcase_12 AC 68 ms
71,340 KB
testcase_13 AC 70 ms
71,308 KB
testcase_14 AC 70 ms
71,196 KB
testcase_15 AC 69 ms
71,340 KB
testcase_16 AC 71 ms
71,452 KB
testcase_17 AC 71 ms
71,256 KB
testcase_18 AC 165 ms
77,168 KB
testcase_19 AC 120 ms
76,720 KB
testcase_20 AC 76 ms
76,372 KB
testcase_21 AC 77 ms
76,568 KB
testcase_22 AC 70 ms
71,488 KB
testcase_23 AC 269 ms
77,136 KB
testcase_24 AC 237 ms
77,048 KB
testcase_25 AC 262 ms
76,904 KB
testcase_26 AC 239 ms
76,956 KB
testcase_27 AC 70 ms
71,332 KB
testcase_28 AC 241 ms
76,844 KB
testcase_29 AC 68 ms
71,044 KB
testcase_30 AC 69 ms
71,336 KB
testcase_31 AC 68 ms
71,580 KB
testcase_32 AC 68 ms
71,388 KB
testcase_33 AC 240 ms
76,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

A.sort(reverse=True)

ans = 0
for i in range(2**(N-1)):
    k = K
    for j in range(N-1):
        if i & (1<<j):
            k %= A[j]
    ans = max(ans, k%A[-1])
print(ans)
0