結果

問題 No.1083 余りの余り
ユーザー cmycmy
提出日時 2022-05-23 12:49:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 228 ms / 3,000 ms
コード長 245 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,836 KB
実行使用メモリ 75,448 KB
最終ジャッジ日時 2023-10-20 17:27:54
合計ジャッジ時間 4,839 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,444 KB
testcase_01 AC 37 ms
53,444 KB
testcase_02 AC 38 ms
53,444 KB
testcase_03 AC 37 ms
53,444 KB
testcase_04 AC 43 ms
60,040 KB
testcase_05 AC 83 ms
66,184 KB
testcase_06 AC 36 ms
53,444 KB
testcase_07 AC 45 ms
60,084 KB
testcase_08 AC 37 ms
53,444 KB
testcase_09 AC 36 ms
53,444 KB
testcase_10 AC 37 ms
53,444 KB
testcase_11 AC 41 ms
60,084 KB
testcase_12 AC 36 ms
53,444 KB
testcase_13 AC 37 ms
53,444 KB
testcase_14 AC 36 ms
53,444 KB
testcase_15 AC 37 ms
53,444 KB
testcase_16 AC 37 ms
53,444 KB
testcase_17 AC 36 ms
53,444 KB
testcase_18 AC 126 ms
73,656 KB
testcase_19 AC 86 ms
68,384 KB
testcase_20 AC 44 ms
60,040 KB
testcase_21 AC 48 ms
62,076 KB
testcase_22 AC 37 ms
53,444 KB
testcase_23 AC 228 ms
75,448 KB
testcase_24 AC 215 ms
75,296 KB
testcase_25 AC 226 ms
75,320 KB
testcase_26 AC 214 ms
75,292 KB
testcase_27 AC 37 ms
53,444 KB
testcase_28 AC 213 ms
75,292 KB
testcase_29 AC 36 ms
53,444 KB
testcase_30 AC 36 ms
53,444 KB
testcase_31 AC 36 ms
53,444 KB
testcase_32 AC 37 ms
53,444 KB
testcase_33 AC 214 ms
75,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
*a, = map(int, input().split())
a.sort(reverse=True)

ans = 0
for i in range(2**(n-1)):
    x = k
    for j in range(n-1):
        if (i >> j) & 1:
            x %= a[j]
    ans = max(ans, x % a[-1])

print(ans)
0