結果

問題 No.1083 余りの余り
ユーザー wattaiheiwattaihei
提出日時 2020-06-19 21:33:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 85,440 KB
最終ジャッジ日時 2023-09-16 13:32:02
合計ジャッジ時間 7,969 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,428 KB
testcase_01 AC 74 ms
70,956 KB
testcase_02 AC 79 ms
76,412 KB
testcase_03 AC 70 ms
71,276 KB
testcase_04 WA -
testcase_05 AC 170 ms
79,192 KB
testcase_06 AC 72 ms
71,240 KB
testcase_07 AC 83 ms
76,512 KB
testcase_08 AC 80 ms
76,324 KB
testcase_09 AC 73 ms
71,184 KB
testcase_10 AC 78 ms
76,520 KB
testcase_11 WA -
testcase_12 AC 73 ms
71,160 KB
testcase_13 AC 72 ms
71,104 KB
testcase_14 AC 72 ms
71,440 KB
testcase_15 AC 74 ms
71,108 KB
testcase_16 AC 70 ms
71,248 KB
testcase_17 AC 69 ms
71,312 KB
testcase_18 WA -
testcase_19 AC 170 ms
79,156 KB
testcase_20 AC 82 ms
76,528 KB
testcase_21 AC 87 ms
76,992 KB
testcase_22 AC 71 ms
71,100 KB
testcase_23 AC 607 ms
85,312 KB
testcase_24 AC 613 ms
84,972 KB
testcase_25 AC 605 ms
85,440 KB
testcase_26 AC 614 ms
84,944 KB
testcase_27 AC 79 ms
76,196 KB
testcase_28 WA -
testcase_29 AC 72 ms
71,424 KB
testcase_30 AC 73 ms
71,096 KB
testcase_31 AC 73 ms
71,376 KB
testcase_32 AC 71 ms
70,944 KB
testcase_33 AC 606 ms
85,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [0 for _ in range(1<<N)]
dp[0] = K
for bit in range(1, 1<<N):
    p = 0
    for i in range(N):
        if bit&(1<<i):
            p = max(dp[bit^(1<<i)] % A[i], p)
    dp[bit] = p

print(dp[-1])
0