結果

問題 No.1083 余りの余り
ユーザー ayaoniayaoni
提出日時 2020-11-22 10:09:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 85,264 KB
最終ジャッジ日時 2023-09-30 22:33:47
合計ジャッジ時間 8,384 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,188 KB
testcase_01 AC 79 ms
71,256 KB
testcase_02 AC 85 ms
76,496 KB
testcase_03 AC 81 ms
71,020 KB
testcase_04 WA -
testcase_05 AC 176 ms
79,168 KB
testcase_06 AC 77 ms
71,328 KB
testcase_07 AC 88 ms
76,552 KB
testcase_08 AC 86 ms
76,496 KB
testcase_09 AC 78 ms
71,136 KB
testcase_10 AC 84 ms
76,280 KB
testcase_11 WA -
testcase_12 AC 80 ms
71,212 KB
testcase_13 AC 79 ms
71,212 KB
testcase_14 AC 77 ms
70,992 KB
testcase_15 AC 77 ms
70,836 KB
testcase_16 AC 78 ms
71,024 KB
testcase_17 AC 78 ms
71,152 KB
testcase_18 WA -
testcase_19 AC 177 ms
78,936 KB
testcase_20 AC 87 ms
76,312 KB
testcase_21 AC 97 ms
76,580 KB
testcase_22 AC 78 ms
71,360 KB
testcase_23 AC 602 ms
84,976 KB
testcase_24 AC 605 ms
85,068 KB
testcase_25 AC 602 ms
85,264 KB
testcase_26 AC 605 ms
84,984 KB
testcase_27 AC 86 ms
76,684 KB
testcase_28 WA -
testcase_29 AC 79 ms
71,100 KB
testcase_30 AC 78 ms
71,376 KB
testcase_31 AC 78 ms
71,268 KB
testcase_32 AC 79 ms
71,356 KB
testcase_33 AC 610 ms
84,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))


N,K = MI()
A = LI()

dp = [0]*(1<<N)  # dp[i] = iを使った時の余りの最大値
dp[0] = K
for i in range(1,1<<N):
    for j in range(N):
        if (i>>j) & 1:
            dp[i] = max(dp[i],dp[i^(1<<j)] % A[j])

print(dp[-1])
0