結果

問題 No.1083 余りの余り
ユーザー gr1msl3ygr1msl3y
提出日時 2022-05-17 23:03:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 85,256 KB
最終ジャッジ日時 2023-10-14 01:53:32
合計ジャッジ時間 8,179 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,344 KB
testcase_01 AC 71 ms
71,168 KB
testcase_02 AC 77 ms
76,564 KB
testcase_03 AC 71 ms
71,096 KB
testcase_04 WA -
testcase_05 AC 191 ms
78,908 KB
testcase_06 AC 70 ms
71,124 KB
testcase_07 AC 79 ms
76,208 KB
testcase_08 AC 79 ms
76,324 KB
testcase_09 AC 72 ms
71,292 KB
testcase_10 AC 79 ms
76,356 KB
testcase_11 WA -
testcase_12 AC 70 ms
71,072 KB
testcase_13 AC 73 ms
71,264 KB
testcase_14 AC 71 ms
71,304 KB
testcase_15 AC 72 ms
71,444 KB
testcase_16 AC 72 ms
71,296 KB
testcase_17 AC 72 ms
71,260 KB
testcase_18 WA -
testcase_19 AC 197 ms
78,960 KB
testcase_20 AC 82 ms
76,484 KB
testcase_21 AC 92 ms
76,612 KB
testcase_22 AC 73 ms
71,368 KB
testcase_23 AC 587 ms
85,256 KB
testcase_24 AC 598 ms
84,848 KB
testcase_25 AC 589 ms
84,840 KB
testcase_26 AC 596 ms
84,852 KB
testcase_27 AC 77 ms
76,564 KB
testcase_28 WA -
testcase_29 AC 73 ms
71,264 KB
testcase_30 AC 72 ms
71,380 KB
testcase_31 AC 71 ms
71,104 KB
testcase_32 AC 72 ms
71,372 KB
testcase_33 AC 591 ms
85,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
dp = [0]*(1 << N)
dp[0] = K

for i in range(1 << N):
    for j in range(N):
        if (i >> j) & 1:
            continue
        ni = i+(1 << j)
        dp[ni] = max(dp[ni], dp[i] % A[j])

print(dp[-1])
0