結果

問題 No.1083 余りの余り
ユーザー roarisroaris
提出日時 2020-06-20 00:57:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 386 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 85,472 KB
最終ジャッジ日時 2023-09-16 16:21:57
合計ジャッジ時間 8,029 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,384 KB
testcase_01 AC 67 ms
71,220 KB
testcase_02 AC 73 ms
76,412 KB
testcase_03 AC 70 ms
71,216 KB
testcase_04 WA -
testcase_05 AC 181 ms
79,336 KB
testcase_06 AC 68 ms
71,632 KB
testcase_07 AC 75 ms
76,592 KB
testcase_08 AC 75 ms
76,700 KB
testcase_09 AC 69 ms
71,180 KB
testcase_10 AC 75 ms
76,532 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,376 KB
testcase_13 AC 70 ms
71,380 KB
testcase_14 AC 67 ms
71,304 KB
testcase_15 AC 70 ms
71,556 KB
testcase_16 AC 70 ms
71,380 KB
testcase_17 AC 68 ms
71,356 KB
testcase_18 WA -
testcase_19 AC 184 ms
79,312 KB
testcase_20 AC 78 ms
76,568 KB
testcase_21 AC 87 ms
76,676 KB
testcase_22 AC 69 ms
71,080 KB
testcase_23 AC 596 ms
85,472 KB
testcase_24 AC 601 ms
85,364 KB
testcase_25 AC 599 ms
85,280 KB
testcase_26 AC 603 ms
85,416 KB
testcase_27 AC 77 ms
76,624 KB
testcase_28 WA -
testcase_29 AC 70 ms
71,224 KB
testcase_30 AC 71 ms
71,608 KB
testcase_31 AC 70 ms
71,376 KB
testcase_32 AC 71 ms
71,372 KB
testcase_33 AC 607 ms
85,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for S in range(1<<N):
    for i in range(N):
        if not (S>>i)&1:
            dp[S|(1<<i)] = max(dp[S|(1<<i)], dp[S]%A[i])

print(dp[-1])
0