結果
問題 |
No.1083 余りの余り
|
ユーザー |
![]() |
提出日時 | 2020-06-19 21:52:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 84,224 KB |
最終ジャッジ日時 | 2024-07-03 14:22:07 |
合計ジャッジ時間 | 6,503 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 4 |
ソースコード
import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 def main(): N,K=MI() A=LI() inf=10**9+1 M=pow(2,N) dp=[0]*(M) dp[0]=K for i in range(1,M): for j in range(N): if i>>j&1: temp=(dp[i-pow(2,j)])%A[j] dp[i]=max(dp[i],temp) print(dp[-1]) main()