結果

問題 No.467 隠されていたゲーム
ユーザー NoaSaber
提出日時 2021-03-11 15:24:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-10-13 03:50:22
合計ジャッジ時間 2,042 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
d=list(map(int,input().split()))
x,y=map(int,input().split())
max_d=max(d)
ans=0
l=max(abs(x),abs(y))
ans+=max(0,math.ceil(max(0,(l-max_d*2))/max_d))
l-=max(0,math.ceil((l-max_d*2)/max_d)*max_d)
if l in d:
    ans+=1
elif l==0:
    pass
else:
    ans+=2
print(ans)
0