結果

問題 No.1083 余りの余り
ユーザー kurimupykurimupy
提出日時 2020-06-19 21:46:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 85,664 KB
最終ジャッジ日時 2023-09-16 13:49:42
合計ジャッジ時間 13,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,288 KB
testcase_01 AC 69 ms
71,160 KB
testcase_02 AC 79 ms
76,736 KB
testcase_03 AC 68 ms
71,088 KB
testcase_04 WA -
testcase_05 AC 365 ms
79,132 KB
testcase_06 AC 71 ms
71,268 KB
testcase_07 AC 81 ms
76,668 KB
testcase_08 AC 79 ms
76,292 KB
testcase_09 AC 71 ms
71,016 KB
testcase_10 AC 80 ms
76,496 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,092 KB
testcase_13 AC 72 ms
71,360 KB
testcase_14 AC 69 ms
71,252 KB
testcase_15 AC 71 ms
71,388 KB
testcase_16 AC 70 ms
71,024 KB
testcase_17 AC 71 ms
71,236 KB
testcase_18 WA -
testcase_19 AC 371 ms
79,044 KB
testcase_20 AC 87 ms
76,520 KB
testcase_21 AC 117 ms
77,444 KB
testcase_22 AC 71 ms
71,440 KB
testcase_23 AC 1,445 ms
85,200 KB
testcase_24 AC 1,451 ms
85,408 KB
testcase_25 AC 1,443 ms
85,456 KB
testcase_26 AC 1,440 ms
85,352 KB
testcase_27 AC 80 ms
76,700 KB
testcase_28 WA -
testcase_29 AC 68 ms
71,220 KB
testcase_30 AC 69 ms
71,276 KB
testcase_31 AC 71 ms
71,140 KB
testcase_32 AC 70 ms
71,228 KB
testcase_33 AC 1,446 ms
85,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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