結果

問題 No.1083 余りの余り
ユーザー nephrologistnephrologist
提出日時 2020-06-19 21:44:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 93,292 KB
最終ジャッジ日時 2023-09-16 13:47:49
合計ジャッジ時間 8,550 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,236 KB
testcase_01 AC 69 ms
70,920 KB
testcase_02 AC 78 ms
76,468 KB
testcase_03 AC 71 ms
71,072 KB
testcase_04 WA -
testcase_05 AC 203 ms
80,752 KB
testcase_06 AC 69 ms
70,924 KB
testcase_07 AC 75 ms
76,292 KB
testcase_08 AC 75 ms
76,536 KB
testcase_09 AC 72 ms
71,296 KB
testcase_10 AC 75 ms
76,508 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,184 KB
testcase_13 AC 69 ms
71,260 KB
testcase_14 AC 70 ms
71,064 KB
testcase_15 AC 70 ms
71,172 KB
testcase_16 AC 70 ms
71,176 KB
testcase_17 AC 69 ms
71,192 KB
testcase_18 WA -
testcase_19 AC 205 ms
80,756 KB
testcase_20 AC 79 ms
76,284 KB
testcase_21 AC 89 ms
76,852 KB
testcase_22 AC 71 ms
71,192 KB
testcase_23 AC 689 ms
93,140 KB
testcase_24 AC 686 ms
93,140 KB
testcase_25 AC 689 ms
93,136 KB
testcase_26 AC 686 ms
93,292 KB
testcase_27 AC 75 ms
76,504 KB
testcase_28 WA -
testcase_29 AC 67 ms
71,280 KB
testcase_30 AC 67 ms
71,240 KB
testcase_31 AC 69 ms
71,152 KB
testcase_32 AC 69 ms
71,156 KB
testcase_33 AC 678 ms
93,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
dp = [-1] * (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