結果

問題 No.1083 余りの余り
ユーザー tanon710tanon710
提出日時 2020-06-20 00:00:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 86,628 KB
実行使用メモリ 85,380 KB
最終ジャッジ日時 2023-09-16 16:10:14
合計ジャッジ時間 8,104 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,336 KB
testcase_01 AC 74 ms
71,356 KB
testcase_02 AC 84 ms
76,660 KB
testcase_03 AC 73 ms
71,236 KB
testcase_04 WA -
testcase_05 AC 193 ms
79,092 KB
testcase_06 AC 72 ms
71,176 KB
testcase_07 AC 79 ms
76,468 KB
testcase_08 AC 78 ms
76,352 KB
testcase_09 AC 72 ms
71,116 KB
testcase_10 AC 81 ms
76,412 KB
testcase_11 WA -
testcase_12 AC 73 ms
71,360 KB
testcase_13 AC 73 ms
71,296 KB
testcase_14 AC 73 ms
71,276 KB
testcase_15 AC 71 ms
71,276 KB
testcase_16 AC 72 ms
71,212 KB
testcase_17 AC 72 ms
70,944 KB
testcase_18 WA -
testcase_19 AC 194 ms
79,016 KB
testcase_20 AC 83 ms
76,376 KB
testcase_21 AC 91 ms
76,608 KB
testcase_22 AC 73 ms
71,168 KB
testcase_23 AC 631 ms
85,380 KB
testcase_24 AC 630 ms
85,148 KB
testcase_25 AC 629 ms
84,936 KB
testcase_26 AC 630 ms
85,168 KB
testcase_27 AC 77 ms
76,396 KB
testcase_28 WA -
testcase_29 AC 71 ms
71,304 KB
testcase_30 AC 74 ms
71,280 KB
testcase_31 AC 72 ms
71,248 KB
testcase_32 AC 71 ms
71,208 KB
testcase_33 AC 627 ms
84,900 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(n):
    dp[1<<i]=k%arr[i]
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