結果

問題 No.1083 余りの余り
ユーザー ttrttr
提出日時 2020-06-19 21:54:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 389 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 8,292 KB
最終ジャッジ日時 2023-09-16 14:04:41
合計ジャッジ時間 20,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,240 KB
testcase_01 AC 15 ms
8,216 KB
testcase_02 AC 16 ms
8,104 KB
testcase_03 AC 16 ms
8,104 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 16 ms
8,216 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 16 ms
8,140 KB
testcase_10 AC 16 ms
8,180 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 16 ms
8,220 KB
testcase_15 AC 15 ms
8,276 KB
testcase_16 AC 16 ms
8,176 KB
testcase_17 AC 16 ms
8,108 KB
testcase_18 WA -
testcase_19 AC 624 ms
8,176 KB
testcase_20 WA -
testcase_21 AC 82 ms
8,292 KB
testcase_22 AC 15 ms
8,216 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 16 ms
8,212 KB
testcase_28 WA -
testcase_29 AC 16 ms
8,272 KB
testcase_30 AC 16 ms
8,128 KB
testcase_31 AC 15 ms
8,268 KB
testcase_32 AC 16 ms
8,164 KB
testcase_33 AC 2,507 ms
8,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

s = min(A)
cnt = A.count(s)
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
        for _ in range(cnt-C.count(s)):
            num %= s
    ans = max(ans, num)

print(ans)
0