結果

問題 No.1083 余りの余り
ユーザー ttrttr
提出日時 2020-06-19 21:46:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 8,332 KB
最終ジャッジ日時 2023-09-16 13:49:19
合計ジャッジ時間 16,059 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,296 KB
testcase_01 AC 17 ms
8,252 KB
testcase_02 AC 16 ms
8,204 KB
testcase_03 AC 15 ms
8,140 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 15 ms
8,056 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 15 ms
8,260 KB
testcase_10 AC 16 ms
8,192 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 16 ms
8,172 KB
testcase_15 AC 16 ms
8,184 KB
testcase_16 AC 15 ms
8,188 KB
testcase_17 AC 16 ms
8,124 KB
testcase_18 WA -
testcase_19 AC 507 ms
8,144 KB
testcase_20 WA -
testcase_21 AC 67 ms
8,272 KB
testcase_22 AC 15 ms
8,268 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 17 ms
8,136 KB
testcase_28 WA -
testcase_29 AC 15 ms
8,136 KB
testcase_30 AC 15 ms
8,200 KB
testcase_31 AC 16 ms
8,216 KB
testcase_32 AC 15 ms
8,272 KB
testcase_33 AC 1,927 ms
8,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

s = min(A)
ans = 0
for i in range(1, N+1):
    num = K
    for C in itertools.combinations(A, i):
        C = list(C)
        C.sort(reverse=True)
        for c in C:
            num %= c
    ans = max(ans, num%s)

print(ans)
0