結果

問題 No.1083 余りの余り
ユーザー 👑 rin204rin204
提出日時 2022-02-25 08:16:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 246 ms / 3,000 ms
コード長 264 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 76,912 KB
最終ジャッジ日時 2023-09-15 22:16:13
合計ジャッジ時間 5,208 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,336 KB
testcase_01 AC 71 ms
71,196 KB
testcase_02 AC 70 ms
71,272 KB
testcase_03 AC 74 ms
71,240 KB
testcase_04 AC 77 ms
76,336 KB
testcase_05 AC 118 ms
76,436 KB
testcase_06 AC 69 ms
71,372 KB
testcase_07 AC 75 ms
76,324 KB
testcase_08 AC 71 ms
71,184 KB
testcase_09 AC 70 ms
70,952 KB
testcase_10 AC 71 ms
70,984 KB
testcase_11 AC 78 ms
76,328 KB
testcase_12 AC 73 ms
71,068 KB
testcase_13 AC 70 ms
71,280 KB
testcase_14 AC 72 ms
71,336 KB
testcase_15 AC 71 ms
71,192 KB
testcase_16 AC 69 ms
71,184 KB
testcase_17 AC 72 ms
71,304 KB
testcase_18 AC 156 ms
76,168 KB
testcase_19 AC 118 ms
76,516 KB
testcase_20 AC 77 ms
76,432 KB
testcase_21 AC 82 ms
76,328 KB
testcase_22 AC 70 ms
71,240 KB
testcase_23 AC 242 ms
76,912 KB
testcase_24 AC 244 ms
76,844 KB
testcase_25 AC 245 ms
76,640 KB
testcase_26 AC 241 ms
76,644 KB
testcase_27 AC 71 ms
71,280 KB
testcase_28 AC 245 ms
76,896 KB
testcase_29 AC 71 ms
71,364 KB
testcase_30 AC 70 ms
71,180 KB
testcase_31 AC 71 ms
71,308 KB
testcase_32 AC 70 ms
71,168 KB
testcase_33 AC 246 ms
76,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)

ans = 0
for bit in range(1 << (n - 1)):
    x = k
    for i in range(n - 1):
        if bit >> i & 1:
            x %= A[i]
    x %= A[-1]
    ans = max(ans, x)
print(ans)
0