結果
| 問題 |
No.467 隠されていたゲーム
|
| コンテスト | |
| ユーザー |
picares9ue
|
| 提出日時 | 2016-12-18 13:21:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 606 bytes |
| コンパイル時間 | 209 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-04 16:18:40 |
| 合計ジャッジ時間 | 2,003 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#要はxとyの値の大きい方に引っ張られる距離だな
n = int(input())
d = sorted([int(i) for i in input().split()])
x, y = [abs(int(i)) for i in input().split()]
def func(n, d, x, y):
d_max = d[-1]
ans = -1
if max(x, y)==0:
ans=0
else:
for m in d:
if m==max(x, y):
ans = 1
if ans==-1:
if max(x, y)>2*d_max:
c = max(x, y)//d_max
if max(x,y)%d_max==0:
ans+=c+1
else:
ans+=c+2
else:
ans=2
return ans
print(func(n, d, x, y))
picares9ue