結果

問題 No.1083 余りの余り
ユーザー lloyzlloyz
提出日時 2022-09-16 00:03:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 85,468 KB
最終ジャッジ日時 2023-08-22 17:32:05
合計ジャッジ時間 9,064 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,236 KB
testcase_01 AC 77 ms
71,156 KB
testcase_02 AC 84 ms
76,620 KB
testcase_03 AC 76 ms
71,444 KB
testcase_04 WA -
testcase_05 AC 170 ms
79,076 KB
testcase_06 AC 76 ms
71,404 KB
testcase_07 AC 83 ms
76,332 KB
testcase_08 AC 83 ms
76,508 KB
testcase_09 AC 77 ms
71,384 KB
testcase_10 AC 84 ms
76,608 KB
testcase_11 WA -
testcase_12 AC 75 ms
71,240 KB
testcase_13 AC 76 ms
71,204 KB
testcase_14 AC 75 ms
71,216 KB
testcase_15 AC 75 ms
71,076 KB
testcase_16 AC 76 ms
71,068 KB
testcase_17 AC 76 ms
71,440 KB
testcase_18 WA -
testcase_19 AC 172 ms
79,052 KB
testcase_20 AC 87 ms
76,628 KB
testcase_21 AC 94 ms
76,808 KB
testcase_22 AC 74 ms
71,308 KB
testcase_23 AC 596 ms
85,300 KB
testcase_24 AC 592 ms
85,200 KB
testcase_25 AC 594 ms
85,192 KB
testcase_26 AC 602 ms
85,416 KB
testcase_27 AC 82 ms
76,428 KB
testcase_28 WA -
testcase_29 AC 76 ms
71,276 KB
testcase_30 AC 77 ms
71,284 KB
testcase_31 AC 79 ms
71,448 KB
testcase_32 AC 76 ms
71,276 KB
testcase_33 AC 603 ms
85,256 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