結果

問題 No.1083 余りの余り
ユーザー kurimupykurimupy
提出日時 2020-06-19 21:44:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 85,712 KB
最終ジャッジ日時 2023-09-16 13:48:11
合計ジャッジ時間 13,437 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,312 KB
testcase_01 AC 69 ms
71,156 KB
testcase_02 WA -
testcase_03 AC 73 ms
71,264 KB
testcase_04 WA -
testcase_05 AC 362 ms
79,076 KB
testcase_06 AC 67 ms
71,212 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 69 ms
70,944 KB
testcase_10 WA -
testcase_11 AC 81 ms
76,388 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 67 ms
71,040 KB
testcase_15 AC 68 ms
71,336 KB
testcase_16 AC 69 ms
71,264 KB
testcase_17 AC 68 ms
71,344 KB
testcase_18 WA -
testcase_19 AC 373 ms
79,012 KB
testcase_20 WA -
testcase_21 AC 115 ms
77,532 KB
testcase_22 AC 70 ms
71,348 KB
testcase_23 WA -
testcase_24 AC 1,447 ms
85,376 KB
testcase_25 AC 1,413 ms
85,244 KB
testcase_26 AC 1,410 ms
85,228 KB
testcase_27 AC 77 ms
76,380 KB
testcase_28 WA -
testcase_29 AC 69 ms
71,324 KB
testcase_30 AC 72 ms
71,312 KB
testcase_31 AC 70 ms
71,312 KB
testcase_32 AC 70 ms
71,160 KB
testcase_33 AC 1,424 ms
85,408 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