結果

問題 No.1083 余りの余り
ユーザー kohei2019kohei2019
提出日時 2022-07-25 23:08:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 275 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 85,464 KB
最終ジャッジ日時 2023-09-22 09:53:28
合計ジャッジ時間 7,888 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,312 KB
testcase_01 AC 71 ms
71,068 KB
testcase_02 AC 77 ms
76,704 KB
testcase_03 AC 71 ms
71,440 KB
testcase_04 WA -
testcase_05 AC 192 ms
79,232 KB
testcase_06 AC 71 ms
71,412 KB
testcase_07 AC 77 ms
76,400 KB
testcase_08 AC 77 ms
76,376 KB
testcase_09 AC 71 ms
71,296 KB
testcase_10 AC 77 ms
76,600 KB
testcase_11 WA -
testcase_12 AC 70 ms
71,260 KB
testcase_13 AC 70 ms
71,572 KB
testcase_14 AC 71 ms
71,224 KB
testcase_15 AC 69 ms
71,064 KB
testcase_16 AC 71 ms
71,432 KB
testcase_17 AC 69 ms
71,300 KB
testcase_18 WA -
testcase_19 AC 192 ms
79,148 KB
testcase_20 AC 82 ms
76,388 KB
testcase_21 AC 92 ms
76,948 KB
testcase_22 AC 71 ms
71,196 KB
testcase_23 AC 617 ms
85,260 KB
testcase_24 AC 615 ms
85,408 KB
testcase_25 AC 613 ms
85,276 KB
testcase_26 AC 617 ms
85,460 KB
testcase_27 AC 75 ms
76,672 KB
testcase_28 WA -
testcase_29 AC 70 ms
71,304 KB
testcase_30 AC 71 ms
71,540 KB
testcase_31 AC 71 ms
71,496 KB
testcase_32 AC 70 ms
71,396 KB
testcase_33 AC 629 ms
85,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
lsA = list(map(int,input().split()))
lsA.sort(reverse=True)
# 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