結果

問題 No.1083 余りの余り
ユーザー ttrttr
提出日時 2020-06-19 21:58:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 389 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 77,336 KB
最終ジャッジ日時 2023-09-16 14:07:49
合計ジャッジ時間 7,995 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,256 KB
testcase_01 AC 69 ms
71,344 KB
testcase_02 AC 70 ms
71,116 KB
testcase_03 AC 70 ms
71,296 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 68 ms
71,352 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 69 ms
71,072 KB
testcase_10 AC 70 ms
71,204 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 69 ms
71,084 KB
testcase_15 AC 69 ms
71,304 KB
testcase_16 AC 68 ms
71,208 KB
testcase_17 AC 68 ms
71,212 KB
testcase_18 WA -
testcase_19 AC 212 ms
77,160 KB
testcase_20 WA -
testcase_21 AC 97 ms
76,728 KB
testcase_22 AC 69 ms
71,356 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 72 ms
71,204 KB
testcase_28 WA -
testcase_29 AC 69 ms
71,288 KB
testcase_30 AC 68 ms
71,372 KB
testcase_31 AC 68 ms
71,212 KB
testcase_32 AC 68 ms
71,212 KB
testcase_33 AC 654 ms
77,024 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