結果

問題 No.281 門松と魔法(1)
ユーザー maine_honzukimaine_honzuki
提出日時 2021-05-12 10:52:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 2,304 ms
コンパイル使用メモリ 203,132 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-23 22:58:50
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

//https://ncode.syosetu.com/n4830bu/281/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    ll d;
    vector<ll> H(3);
    cin >> d;
    for (auto&& h : H) {
        cin >> h;
    }
    auto book = [&](ll height, ll threshold) {
        if (threshold == 0)
            return (ll)1e11;
        if (height < threshold)
            return 0ll;
        return (height - threshold + d) / d;
    };
    ll maine = min(book(H[0], H[1]) + book(H[2], H[1]), book(H[1], H[0]) + book(H[1], H[2]));
    cout << (maine > 1e10 ? -1 : maine) << endl;
}
0