結果

問題 No.1083 余りの余り
ユーザー lloyzlloyz
提出日時 2022-09-16 00:03:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 84,224 KB
最終ジャッジ日時 2024-05-09 23:19:47
合計ジャッジ時間 6,429 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,584 KB
testcase_01 AC 39 ms
51,712 KB
testcase_02 AC 53 ms
59,648 KB
testcase_03 AC 44 ms
51,584 KB
testcase_04 WA -
testcase_05 AC 147 ms
75,264 KB
testcase_06 AC 42 ms
51,968 KB
testcase_07 AC 51 ms
60,800 KB
testcase_08 AC 46 ms
59,776 KB
testcase_09 AC 39 ms
52,096 KB
testcase_10 AC 46 ms
59,520 KB
testcase_11 WA -
testcase_12 AC 38 ms
51,968 KB
testcase_13 AC 38 ms
52,096 KB
testcase_14 AC 39 ms
51,712 KB
testcase_15 AC 38 ms
51,456 KB
testcase_16 AC 44 ms
51,456 KB
testcase_17 AC 46 ms
51,840 KB
testcase_18 WA -
testcase_19 AC 134 ms
75,264 KB
testcase_20 AC 51 ms
61,184 KB
testcase_21 AC 57 ms
62,592 KB
testcase_22 AC 37 ms
51,584 KB
testcase_23 AC 564 ms
83,840 KB
testcase_24 AC 577 ms
83,840 KB
testcase_25 AC 521 ms
83,840 KB
testcase_26 AC 569 ms
83,840 KB
testcase_27 AC 53 ms
59,904 KB
testcase_28 WA -
testcase_29 AC 38 ms
51,456 KB
testcase_30 AC 37 ms
51,584 KB
testcase_31 AC 37 ms
51,456 KB
testcase_32 AC 37 ms
51,584 KB
testcase_33 AC 513 ms
84,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))

DP = [0 for _ in range(1 << n)]
DP[0] = k
for bit in range(1, 1 << n):
    res = 0
    for i in range(n):
        if (bit >> i) & 1:
            res = max(res, DP[bit ^ (1 << i)] % A[i])
    DP[bit] = res
print(DP[-1])
0