結果

問題 No.1083 余りの余り
ユーザー tamatotamato
提出日時 2020-06-26 00:44:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 3,000 ms
コード長 417 bytes
コンパイル時間 941 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 77,324 KB
最終ジャッジ日時 2023-09-16 23:23:57
合計ジャッジ時間 5,408 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,692 KB
testcase_01 AC 64 ms
71,508 KB
testcase_02 AC 65 ms
71,680 KB
testcase_03 AC 65 ms
71,732 KB
testcase_04 AC 77 ms
76,880 KB
testcase_05 AC 111 ms
76,856 KB
testcase_06 AC 65 ms
71,692 KB
testcase_07 AC 70 ms
76,584 KB
testcase_08 AC 66 ms
71,608 KB
testcase_09 AC 65 ms
71,700 KB
testcase_10 AC 66 ms
71,564 KB
testcase_11 AC 72 ms
76,848 KB
testcase_12 AC 67 ms
71,708 KB
testcase_13 AC 69 ms
71,832 KB
testcase_14 AC 68 ms
71,532 KB
testcase_15 AC 65 ms
71,908 KB
testcase_16 AC 64 ms
71,776 KB
testcase_17 AC 66 ms
71,664 KB
testcase_18 AC 151 ms
77,212 KB
testcase_19 AC 110 ms
76,768 KB
testcase_20 AC 73 ms
76,660 KB
testcase_21 AC 76 ms
76,620 KB
testcase_22 AC 67 ms
71,492 KB
testcase_23 AC 238 ms
77,132 KB
testcase_24 AC 241 ms
77,024 KB
testcase_25 AC 234 ms
77,324 KB
testcase_26 AC 238 ms
77,036 KB
testcase_27 AC 66 ms
71,608 KB
testcase_28 AC 238 ms
77,052 KB
testcase_29 AC 64 ms
71,716 KB
testcase_30 AC 65 ms
71,520 KB
testcase_31 AC 65 ms
71,476 KB
testcase_32 AC 65 ms
71,328 KB
testcase_33 AC 239 ms
77,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    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)):
        x = K
        for j in range(N-1):
            if i>>j & 1:
                x %= A[j]
        ans = max(ans, x%A[-1])
    print(ans)


if __name__ == '__main__':
    main()
0