結果

問題 No.281 門松と魔法(1)
ユーザー nebukuro09nebukuro09
提出日時 2016-09-23 15:27:22
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-04-28 22:16:17
合計ジャッジ時間 2,470 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 12 ms
6,400 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 11 ms
6,272 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 12 ms
6,272 KB
testcase_15 WA -
testcase_16 AC 11 ms
6,400 KB
testcase_17 WA -
testcase_18 AC 11 ms
6,272 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 11 ms
6,272 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 12 ms
6,400 KB
testcase_30 AC 12 ms
6,272 KB
testcase_31 AC 11 ms
6,400 KB
testcase_32 AC 11 ms
6,272 KB
testcase_33 AC 11 ms
6,272 KB
testcase_34 WA -
testcase_35 AC 12 ms
6,272 KB
testcase_36 WA -
testcase_37 AC 11 ms
6,400 KB
testcase_38 WA -
testcase_39 AC 12 ms
6,400 KB
testcase_40 AC 11 ms
6,400 KB
testcase_41 WA -
testcase_42 AC 11 ms
6,272 KB
testcase_43 WA -
testcase_44 AC 11 ms
6,400 KB
testcase_45 WA -
testcase_46 AC 12 ms
6,272 KB
testcase_47 WA -
testcase_48 AC 11 ms
6,400 KB
testcase_49 AC 11 ms
6,400 KB
testcase_50 AC 11 ms
6,400 KB
testcase_51 AC 11 ms
6,272 KB
testcase_52 AC 11 ms
6,400 KB
testcase_53 AC 11 ms
6,272 KB
testcase_54 AC 11 ms
6,400 KB
testcase_55 WA -
testcase_56 AC 11 ms
6,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D, A, B, C = input(), input(), input(), input()

if A > C:
    A, C = C, A
    
if A == 0 or C == 0:
    print -1
elif A == B == C:
    print 3 if B > D else -1
elif A < B < C:
    m1 = (B-A)/D + ((B-A)%D==0)
    m2 = (C-B)/D + ((C-D)%D==0)
    if (C-A)%D == 0 and A+D == B:
        m2 += 1
    print min(m1, m2)
elif A == B < C:
    print 1
elif A < B == C:
    if C - D != A:
        print 1
    else:
        print 2
else:
    print 0
0