結果

問題 No.1083 余りの余り
ユーザー tassei903tassei903
提出日時 2021-09-30 10:25:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 3,000 ms
コード長 573 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 77,060 KB
最終ジャッジ日時 2023-09-24 12:52:46
合計ジャッジ時間 6,670 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,332 KB
testcase_01 AC 73 ms
71,376 KB
testcase_02 AC 72 ms
71,076 KB
testcase_03 AC 71 ms
71,316 KB
testcase_04 AC 81 ms
76,496 KB
testcase_05 AC 120 ms
76,560 KB
testcase_06 AC 71 ms
71,292 KB
testcase_07 AC 78 ms
76,048 KB
testcase_08 AC 72 ms
71,320 KB
testcase_09 AC 71 ms
71,288 KB
testcase_10 AC 71 ms
71,308 KB
testcase_11 AC 77 ms
75,960 KB
testcase_12 AC 71 ms
71,216 KB
testcase_13 AC 71 ms
71,376 KB
testcase_14 AC 71 ms
71,376 KB
testcase_15 AC 72 ms
71,188 KB
testcase_16 AC 73 ms
71,208 KB
testcase_17 AC 71 ms
71,264 KB
testcase_18 AC 157 ms
76,580 KB
testcase_19 AC 117 ms
76,392 KB
testcase_20 AC 80 ms
76,396 KB
testcase_21 AC 83 ms
76,560 KB
testcase_22 AC 72 ms
71,292 KB
testcase_23 AC 315 ms
76,984 KB
testcase_24 AC 317 ms
76,904 KB
testcase_25 AC 316 ms
77,060 KB
testcase_26 AC 314 ms
76,864 KB
testcase_27 AC 72 ms
71,164 KB
testcase_28 AC 315 ms
76,956 KB
testcase_29 AC 72 ms
71,324 KB
testcase_30 AC 71 ms
71,400 KB
testcase_31 AC 72 ms
71,312 KB
testcase_32 AC 73 ms
71,008 KB
testcase_33 AC 319 ms
76,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

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