結果

問題 No.1083 余りの余り
ユーザー kurimupykurimupy
提出日時 2020-06-19 21:52:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 475 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 198,744 KB
最終ジャッジ日時 2023-09-16 14:01:17
合計ジャッジ時間 8,514 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
78,292 KB
testcase_01 AC 72 ms
70,992 KB
testcase_02 AC 86 ms
76,436 KB
testcase_03 AC 70 ms
71,196 KB
testcase_04 AC 98 ms
76,572 KB
testcase_05 AC 1,901 ms
133,344 KB
testcase_06 AC 69 ms
71,188 KB
testcase_07 AC 90 ms
76,580 KB
testcase_08 AC 86 ms
76,312 KB
testcase_09 AC 77 ms
76,640 KB
testcase_10 AC 85 ms
76,412 KB
testcase_11 AC 91 ms
76,596 KB
testcase_12 AC 80 ms
76,588 KB
testcase_13 AC 81 ms
76,564 KB
testcase_14 AC 70 ms
71,204 KB
testcase_15 AC 70 ms
71,288 KB
testcase_16 AC 70 ms
71,248 KB
testcase_17 AC 72 ms
71,148 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
ans=0
A=list(map(int,input().split()))
#bitdp (2**N N)
dp=[[0 for j in range(N)] for i in range(2**N)]
#dp["0010101101"] := ex).A_2,,,,,,A_8を並び替えたときの考えうる最もいい最大値
dp[0]=[K for i in range(N)]
for i in range(1,2**N):
    x=format(i,"0%ib"%N)[::-1]
    for j in range(N):
        if x[j]=="1":
            for k in range(N):
                dp[i][j]=max(dp[i][j],dp[i-2**j][k]%A[j])
ans=max(dp[-1])
print(ans)

0