結果

問題 No.1083 余りの余り
ユーザー prd_xxxprd_xxx
提出日時 2020-06-19 22:04:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 85,380 KB
最終ジャッジ日時 2023-09-16 14:23:57
合計ジャッジ時間 11,305 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,240 KB
testcase_01 AC 72 ms
71,196 KB
testcase_02 AC 80 ms
76,464 KB
testcase_03 AC 71 ms
71,192 KB
testcase_04 WA -
testcase_05 AC 285 ms
79,016 KB
testcase_06 AC 73 ms
71,128 KB
testcase_07 AC 85 ms
76,480 KB
testcase_08 AC 81 ms
76,316 KB
testcase_09 AC 74 ms
71,124 KB
testcase_10 AC 82 ms
76,624 KB
testcase_11 WA -
testcase_12 AC 73 ms
70,948 KB
testcase_13 AC 74 ms
71,492 KB
testcase_14 AC 72 ms
71,248 KB
testcase_15 AC 72 ms
71,160 KB
testcase_16 AC 73 ms
71,056 KB
testcase_17 AC 72 ms
71,064 KB
testcase_18 WA -
testcase_19 AC 288 ms
78,860 KB
testcase_20 AC 86 ms
76,312 KB
testcase_21 AC 107 ms
77,144 KB
testcase_22 AC 73 ms
71,072 KB
testcase_23 AC 1,111 ms
85,052 KB
testcase_24 AC 1,112 ms
84,832 KB
testcase_25 AC 1,111 ms
85,152 KB
testcase_26 AC 1,109 ms
85,232 KB
testcase_27 AC 80 ms
76,520 KB
testcase_28 WA -
testcase_29 AC 70 ms
71,072 KB
testcase_30 AC 71 ms
70,944 KB
testcase_31 AC 72 ms
71,056 KB
testcase_32 AC 70 ms
71,056 KB
testcase_33 AC 1,110 ms
85,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
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