結果

問題 No.1083 余りの余り
ユーザー pluto77
提出日時 2020-06-20 16:47:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 229 ms / 3,000 ms
コード長 211 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 76,264 KB
最終ジャッジ日時 2024-07-03 17:25:39
合計ジャッジ時間 3,602 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1083
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
res=0
for i in range(2**(n-1)):
 t=k
 for j in range(n-1):
  if i&(1<<j):
   t%=a[j]
 res=max(res,t%a[-1])
print(res)
0