結果

問題 No.1083 余りの余り
ユーザー kohei2019kohei2019
提出日時 2022-07-25 23:05:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 85,436 KB
最終ジャッジ日時 2023-09-22 09:48:44
合計ジャッジ時間 8,521 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,360 KB
testcase_01 AC 79 ms
71,396 KB
testcase_02 AC 90 ms
76,288 KB
testcase_03 AC 81 ms
71,484 KB
testcase_04 WA -
testcase_05 AC 205 ms
79,184 KB
testcase_06 AC 80 ms
71,160 KB
testcase_07 AC 91 ms
76,508 KB
testcase_08 AC 85 ms
76,596 KB
testcase_09 AC 81 ms
71,432 KB
testcase_10 AC 86 ms
76,636 KB
testcase_11 WA -
testcase_12 AC 80 ms
71,352 KB
testcase_13 AC 82 ms
71,440 KB
testcase_14 AC 80 ms
71,472 KB
testcase_15 AC 82 ms
71,252 KB
testcase_16 AC 81 ms
71,268 KB
testcase_17 AC 81 ms
71,324 KB
testcase_18 WA -
testcase_19 AC 204 ms
79,216 KB
testcase_20 AC 93 ms
76,696 KB
testcase_21 AC 102 ms
76,920 KB
testcase_22 AC 82 ms
71,252 KB
testcase_23 AC 630 ms
85,436 KB
testcase_24 AC 633 ms
85,396 KB
testcase_25 AC 631 ms
85,392 KB
testcase_26 AC 632 ms
85,312 KB
testcase_27 AC 86 ms
76,508 KB
testcase_28 WA -
testcase_29 AC 83 ms
71,496 KB
testcase_30 AC 82 ms
71,364 KB
testcase_31 AC 81 ms
71,560 KB
testcase_32 AC 83 ms
71,400 KB
testcase_33 AC 630 ms
85,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
lsA = list(map(int,input().split()))
lsA.sort()
# bitDP?
dp = [0]*(2**N)
dp[0] = K

for i in range(2**N):
    for j in range(N):
        if (1<<j & i) == 0:
            dp[i|(1<<j)] = max(dp[i|(1<<j)],dp[i] % lsA[j])

print(dp[-1])
0