結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,148 KB
testcase_01 AC 15 ms
8,232 KB
testcase_02 AC 16 ms
8,284 KB
testcase_03 AC 16 ms
8,108 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 16 ms
8,208 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 15 ms
8,136 KB
testcase_10 AC 16 ms
8,124 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 16 ms
8,256 KB
testcase_15 AC 15 ms
8,272 KB
testcase_16 AC 15 ms
8,168 KB
testcase_17 AC 15 ms
8,116 KB
testcase_18 WA -
testcase_19 AC 558 ms
8,168 KB
testcase_20 WA -
testcase_21 AC 74 ms
8,172 KB
testcase_22 AC 15 ms
8,136 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 16 ms
8,096 KB
testcase_28 WA -
testcase_29 AC 15 ms
8,112 KB
testcase_30 AC 15 ms
8,164 KB
testcase_31 AC 16 ms
8,092 KB
testcase_32 AC 16 ms
8,096 KB
testcase_33 AC 2,144 ms
8,320 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
        if s not in C:
            num %= s
    ans = max(ans, num)

print(ans)
0