結果

問題 No.1083 余りの余り
ユーザー ttrttr
提出日時 2020-06-19 22:05:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 397 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 8,284 KB
最終ジャッジ日時 2023-09-16 14:25:42
合計ジャッジ時間 23,342 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,120 KB
testcase_01 AC 16 ms
8,284 KB
testcase_02 AC 16 ms
8,252 KB
testcase_03 AC 16 ms
8,168 KB
testcase_04 AC 18 ms
8,256 KB
testcase_05 AC 713 ms
8,052 KB
testcase_06 AC 16 ms
8,048 KB
testcase_07 AC 17 ms
8,124 KB
testcase_08 AC 16 ms
8,220 KB
testcase_09 AC 15 ms
8,108 KB
testcase_10 AC 16 ms
8,208 KB
testcase_11 AC 16 ms
8,256 KB
testcase_12 AC 15 ms
8,164 KB
testcase_13 AC 16 ms
8,052 KB
testcase_14 AC 15 ms
8,048 KB
testcase_15 AC 15 ms
8,120 KB
testcase_16 AC 15 ms
8,104 KB
testcase_17 AC 16 ms
8,200 KB
testcase_18 AC 1,584 ms
8,252 KB
testcase_19 AC 736 ms
8,188 KB
testcase_20 AC 26 ms
8,108 KB
testcase_21 AC 96 ms
8,112 KB
testcase_22 AC 15 ms
8,124 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 2,935 ms
8,256 KB
testcase_26 TLE -
testcase_27 AC 17 ms
8,132 KB
testcase_28 AC 2,868 ms
8,264 KB
testcase_29 AC 15 ms
8,124 KB
testcase_30 AC 16 ms
8,128 KB
testcase_31 AC 15 ms
8,220 KB
testcase_32 AC 16 ms
8,220 KB
testcase_33 AC 2,947 ms
8,120 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):
    for C in itertools.combinations(A, i):
        num = K
        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