結果

問題 No.1083 余りの余り
ユーザー nephrologistnephrologist
提出日時 2020-06-19 21:47:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 1,562 ms
コンパイル使用メモリ 86,632 KB
実行使用メモリ 93,516 KB
最終ジャッジ日時 2023-09-16 13:51:41
合計ジャッジ時間 9,152 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,008 KB
testcase_01 AC 71 ms
70,956 KB
testcase_02 AC 84 ms
76,084 KB
testcase_03 AC 70 ms
70,752 KB
testcase_04 WA -
testcase_05 AC 202 ms
80,880 KB
testcase_06 AC 70 ms
71,072 KB
testcase_07 AC 76 ms
76,304 KB
testcase_08 AC 76 ms
76,396 KB
testcase_09 AC 70 ms
70,972 KB
testcase_10 AC 76 ms
75,808 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,128 KB
testcase_13 AC 69 ms
71,212 KB
testcase_14 AC 69 ms
71,236 KB
testcase_15 AC 69 ms
70,988 KB
testcase_16 AC 69 ms
70,896 KB
testcase_17 AC 69 ms
71,056 KB
testcase_18 WA -
testcase_19 AC 204 ms
80,876 KB
testcase_20 AC 76 ms
76,040 KB
testcase_21 AC 88 ms
76,804 KB
testcase_22 AC 70 ms
70,868 KB
testcase_23 AC 684 ms
93,296 KB
testcase_24 AC 686 ms
92,668 KB
testcase_25 AC 691 ms
93,272 KB
testcase_26 AC 694 ms
93,184 KB
testcase_27 AC 74 ms
76,292 KB
testcase_28 WA -
testcase_29 AC 69 ms
70,880 KB
testcase_30 AC 69 ms
71,080 KB
testcase_31 AC 70 ms
71,100 KB
testcase_32 AC 69 ms
70,972 KB
testcase_33 AC 680 ms
92,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
dp = [0] * (1 << n + 1)
dp[0] = k
for s in range(1 << n):
    for i in range(n):
        ns = s | 1 << i
        dp[ns] = max(dp[ns], dp[s] % A[i])
        # print(s, ns, dp[ns])
print(dp[(1 << n) - 1])
0