結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,232 KB
testcase_01 AC 69 ms
71,236 KB
testcase_02 AC 76 ms
76,520 KB
testcase_03 AC 69 ms
71,112 KB
testcase_04 WA -
testcase_05 AC 167 ms
78,988 KB
testcase_06 AC 68 ms
71,248 KB
testcase_07 AC 78 ms
76,532 KB
testcase_08 AC 75 ms
76,276 KB
testcase_09 AC 70 ms
71,412 KB
testcase_10 AC 74 ms
76,556 KB
testcase_11 WA -
testcase_12 AC 69 ms
71,264 KB
testcase_13 AC 70 ms
71,232 KB
testcase_14 AC 69 ms
71,360 KB
testcase_15 AC 70 ms
71,208 KB
testcase_16 AC 70 ms
71,208 KB
testcase_17 AC 70 ms
71,196 KB
testcase_18 WA -
testcase_19 AC 168 ms
78,948 KB
testcase_20 AC 77 ms
76,640 KB
testcase_21 AC 85 ms
76,768 KB
testcase_22 AC 70 ms
71,168 KB
testcase_23 AC 584 ms
85,184 KB
testcase_24 AC 589 ms
85,012 KB
testcase_25 AC 580 ms
84,908 KB
testcase_26 AC 590 ms
84,904 KB
testcase_27 AC 74 ms
76,628 KB
testcase_28 WA -
testcase_29 AC 70 ms
71,368 KB
testcase_30 AC 68 ms
71,324 KB
testcase_31 AC 68 ms
71,312 KB
testcase_32 AC 70 ms
71,208 KB
testcase_33 AC 583 ms
85,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [0] * (1 << N)
dp[0] = K
for b in range(1, 1 << N):
    for i in range(N):
        if b >> i & 1:
            dp[b] = max(dp[b - (1 << i)] % A[i], dp[b])
print(dp[-1])
0