結果

問題 No.1083 余りの余り
ユーザー prd_xxxprd_xxx
提出日時 2020-06-19 21:38:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,340 KB
実行使用メモリ 85,620 KB
最終ジャッジ日時 2023-09-16 13:40:51
合計ジャッジ時間 11,208 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,008 KB
testcase_01 AC 70 ms
71,308 KB
testcase_02 AC 80 ms
76,364 KB
testcase_03 AC 71 ms
71,340 KB
testcase_04 WA -
testcase_05 AC 283 ms
78,864 KB
testcase_06 AC 69 ms
71,160 KB
testcase_07 AC 80 ms
76,448 KB
testcase_08 AC 79 ms
76,316 KB
testcase_09 AC 70 ms
71,260 KB
testcase_10 AC 79 ms
76,544 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,156 KB
testcase_13 AC 71 ms
71,360 KB
testcase_14 AC 70 ms
71,208 KB
testcase_15 AC 70 ms
71,396 KB
testcase_16 AC 70 ms
71,124 KB
testcase_17 AC 69 ms
71,152 KB
testcase_18 WA -
testcase_19 AC 291 ms
79,048 KB
testcase_20 AC 84 ms
76,688 KB
testcase_21 AC 106 ms
77,060 KB
testcase_22 AC 68 ms
71,204 KB
testcase_23 AC 1,099 ms
85,092 KB
testcase_24 AC 1,107 ms
85,152 KB
testcase_25 AC 1,098 ms
85,096 KB
testcase_26 AC 1,101 ms
85,432 KB
testcase_27 AC 79 ms
76,396 KB
testcase_28 WA -
testcase_29 AC 69 ms
71,284 KB
testcase_30 AC 71 ms
70,984 KB
testcase_31 AC 70 ms
71,464 KB
testcase_32 AC 70 ms
71,260 KB
testcase_33 AC 1,125 ms
85,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
dp = [0] * (1<<N)
for i,a in enumerate(A):
    dp[1<<i] = K%a

for b in range(2,1<<N):
    if bin(b).count('1') < 2: continue
    for i,a in enumerate(A):
        if b&(1<<i)==0: continue
        dp[b] = max(dp[b], dp[b^(1<<i)] % a)
print(dp[-1])
0