結果

問題 No.1083 余りの余り
ユーザー ayaoniayaoni
提出日時 2020-11-22 10:34:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 266 ms / 3,000 ms
コード長 352 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 77,044 KB
最終ジャッジ日時 2023-09-30 22:34:11
合計ジャッジ時間 5,597 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,276 KB
testcase_01 AC 76 ms
71,096 KB
testcase_02 AC 77 ms
71,172 KB
testcase_03 AC 77 ms
70,812 KB
testcase_04 AC 84 ms
76,364 KB
testcase_05 AC 125 ms
76,228 KB
testcase_06 AC 77 ms
71,260 KB
testcase_07 AC 85 ms
76,268 KB
testcase_08 AC 78 ms
71,120 KB
testcase_09 AC 77 ms
71,064 KB
testcase_10 AC 79 ms
71,268 KB
testcase_11 AC 85 ms
76,324 KB
testcase_12 AC 81 ms
71,144 KB
testcase_13 AC 80 ms
71,068 KB
testcase_14 AC 79 ms
70,824 KB
testcase_15 AC 78 ms
71,296 KB
testcase_16 AC 78 ms
71,196 KB
testcase_17 AC 76 ms
71,300 KB
testcase_18 AC 170 ms
76,684 KB
testcase_19 AC 132 ms
76,556 KB
testcase_20 AC 86 ms
76,272 KB
testcase_21 AC 88 ms
76,436 KB
testcase_22 AC 78 ms
71,332 KB
testcase_23 AC 266 ms
76,724 KB
testcase_24 AC 263 ms
77,044 KB
testcase_25 AC 265 ms
76,908 KB
testcase_26 AC 254 ms
76,632 KB
testcase_27 AC 79 ms
71,316 KB
testcase_28 AC 255 ms
76,804 KB
testcase_29 AC 76 ms
70,984 KB
testcase_30 AC 75 ms
70,984 KB
testcase_31 AC 78 ms
71,160 KB
testcase_32 AC 75 ms
70,824 KB
testcase_33 AC 254 ms
76,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))


N,K = MI()
A = LI()
A.sort(reverse=True)

ans = K % A[-1]
for i in range(1<<(N-1)):
    a = K
    for j in range(N-1):
        if (i>>j) & 1:
            a %= A[j]
    ans = max(ans,a % A[-1])

print(ans)
0