結果

問題 No.1083 余りの余り
ユーザー H3PO4H3PO4
提出日時 2020-08-05 09:14:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,435 ms / 3,000 ms
コード長 307 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 8,240 KB
最終ジャッジ日時 2023-10-14 00:29:40
合計ジャッジ時間 12,917 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,228 KB
testcase_01 AC 16 ms
7,996 KB
testcase_02 AC 17 ms
8,000 KB
testcase_03 AC 16 ms
8,160 KB
testcase_04 AC 18 ms
8,144 KB
testcase_05 AC 335 ms
8,072 KB
testcase_06 AC 16 ms
8,080 KB
testcase_07 AC 16 ms
7,996 KB
testcase_08 AC 17 ms
8,172 KB
testcase_09 AC 16 ms
8,076 KB
testcase_10 AC 16 ms
8,240 KB
testcase_11 AC 16 ms
8,076 KB
testcase_12 AC 15 ms
8,072 KB
testcase_13 AC 16 ms
8,076 KB
testcase_14 AC 16 ms
8,068 KB
testcase_15 AC 16 ms
8,152 KB
testcase_16 AC 16 ms
8,140 KB
testcase_17 AC 16 ms
8,104 KB
testcase_18 AC 686 ms
8,060 KB
testcase_19 AC 337 ms
8,068 KB
testcase_20 AC 20 ms
8,076 KB
testcase_21 AC 53 ms
8,140 KB
testcase_22 AC 16 ms
8,080 KB
testcase_23 AC 1,435 ms
8,188 KB
testcase_24 AC 1,417 ms
8,188 KB
testcase_25 AC 1,408 ms
8,240 KB
testcase_26 AC 1,408 ms
8,084 KB
testcase_27 AC 15 ms
7,996 KB
testcase_28 AC 1,397 ms
8,056 KB
testcase_29 AC 16 ms
8,076 KB
testcase_30 AC 16 ms
8,048 KB
testcase_31 AC 15 ms
8,076 KB
testcase_32 AC 16 ms
8,100 KB
testcase_33 AC 1,285 ms
8,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
minA = A[-1]

ans = 0
for t in itertools.product((0, 1), repeat=N - 1):
    X = itertools.compress(A[:-1], t)
    k = K
    for x in X:
        k %= x
    k %= minA
    ans = max(ans, k)
print(ans)
0