結果

問題 No.1083 余りの余り
ユーザー takakintakakin
提出日時 2020-06-19 22:29:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 85,504 KB
最終ジャッジ日時 2023-09-16 14:45:36
合計ジャッジ時間 7,845 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,324 KB
testcase_01 AC 72 ms
71,276 KB
testcase_02 AC 79 ms
76,588 KB
testcase_03 AC 74 ms
71,260 KB
testcase_04 WA -
testcase_05 AC 194 ms
79,244 KB
testcase_06 AC 73 ms
71,504 KB
testcase_07 AC 84 ms
76,592 KB
testcase_08 AC 78 ms
76,368 KB
testcase_09 AC 74 ms
71,044 KB
testcase_10 AC 80 ms
76,580 KB
testcase_11 WA -
testcase_12 AC 73 ms
71,064 KB
testcase_13 AC 75 ms
71,264 KB
testcase_14 AC 73 ms
71,320 KB
testcase_15 AC 73 ms
71,064 KB
testcase_16 AC 73 ms
71,408 KB
testcase_17 AC 75 ms
71,068 KB
testcase_18 WA -
testcase_19 AC 194 ms
79,088 KB
testcase_20 AC 84 ms
76,808 KB
testcase_21 AC 93 ms
76,712 KB
testcase_22 AC 73 ms
71,476 KB
testcase_23 AC 612 ms
85,348 KB
testcase_24 AC 618 ms
85,304 KB
testcase_25 AC 605 ms
85,500 KB
testcase_26 AC 605 ms
85,328 KB
testcase_27 AC 81 ms
76,600 KB
testcase_28 WA -
testcase_29 AC 75 ms
71,176 KB
testcase_30 AC 75 ms
71,260 KB
testcase_31 AC 73 ms
71,424 KB
testcase_32 AC 74 ms
71,300 KB
testcase_33 AC 606 ms
85,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,heapq
input = sys.stdin.buffer.readline
n,k=map(int,input().split())
A=[int(i) for i in input().split()]
DP=[0]*(2**n)
DP[0]=k
for i in range(2**n):
  for j in range(n):
    if not i&(1<<j):
      DP[i|(1<<j)]=max(DP[i|(1<<j)],DP[i]%A[j])
print(DP[-1])
0