結果

問題 No.281 門松と魔法(1)
ユーザー yumechi
提出日時 2015-09-18 22:52:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-11-06 18:50:36
合計ジャッジ時間 3,588 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37 WA * 18 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

d = int(input())
hl = [int(input()) for i in range(3)]

# 3 3 4 or 3 3 2
if hl[1] == hl[0] or hl[1] == hl[2]:
    # 0 0 2 NG
    print(1 if hl[1] > 0 else -1)
    exit(0)

# 5 7 5 or 2 0 1
if max(hl) == hl[1] or min(hl) == hl[1]:
    print(0)
    exit(0)

midx = hl.index(max(hl))
print(math.ceil((hl[midx] - hl[1]) / d) + (0 if (hl[midx] - hl[1])  % d != 0 else 1))
0