結果

問題 No.1083 余りの余り
ユーザー tanon710tanon710
提出日時 2020-06-19 23:49:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 85,352 KB
最終ジャッジ日時 2023-09-16 16:08:13
合計ジャッジ時間 11,738 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,220 KB
testcase_01 AC 71 ms
71,148 KB
testcase_02 AC 90 ms
76,432 KB
testcase_03 AC 72 ms
71,304 KB
testcase_04 WA -
testcase_05 AC 297 ms
79,052 KB
testcase_06 AC 72 ms
71,220 KB
testcase_07 AC 86 ms
76,504 KB
testcase_08 AC 82 ms
76,696 KB
testcase_09 AC 73 ms
71,108 KB
testcase_10 AC 84 ms
76,500 KB
testcase_11 WA -
testcase_12 AC 74 ms
71,276 KB
testcase_13 AC 74 ms
71,288 KB
testcase_14 AC 74 ms
71,284 KB
testcase_15 AC 73 ms
71,108 KB
testcase_16 AC 73 ms
71,056 KB
testcase_17 AC 72 ms
71,568 KB
testcase_18 WA -
testcase_19 AC 293 ms
79,176 KB
testcase_20 AC 89 ms
76,612 KB
testcase_21 AC 107 ms
76,816 KB
testcase_22 AC 72 ms
71,276 KB
testcase_23 AC 1,131 ms
85,240 KB
testcase_24 AC 1,129 ms
85,312 KB
testcase_25 AC 1,136 ms
85,212 KB
testcase_26 AC 1,135 ms
85,152 KB
testcase_27 AC 83 ms
76,552 KB
testcase_28 WA -
testcase_29 AC 74 ms
71,264 KB
testcase_30 AC 73 ms
71,292 KB
testcase_31 AC 73 ms
71,232 KB
testcase_32 AC 73 ms
71,296 KB
testcase_33 AC 1,133 ms
85,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
arr=list(map(int,input().split()))
dp=[0]*(2**n)
dp[0]=k
for i in range(2**n):
    for j in range(n):
        if i&(1<<j):
            continue
        dp[i+(1<<j)]=max(dp[i+(1<<j)],dp[i]%arr[j])
for i in range(2**n):
    for j in range(n):
        if i&(1<<j):
            continue
        dp[i+(1<<j)]=max(dp[i+(1<<j)],dp[i]%arr[j])
print(dp[-1])
0