結果

問題 No.740 幻の木
ユーザー PachicobuePachicobue
提出日時 2018-10-05 21:26:36
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 2,101 ms
コンパイル使用メモリ 194,996 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 16:57:40
合計ジャッジ時間 2,692 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define show(x) std::cerr << #x << " = " << x << std::endl
using ll = long long;
using ull = unsigned long long;
using ld = long double;
constexpr ll MOD = 1000000007LL;
template <typename T>
constexpr T INF = std::numeric_limits<T>::max() / 10;
std::mt19937 mt{std::random_device{}()};
int main()
{
    int N, M, P, Q;
    std::cin >> N >> M >> P >> Q;
    for (int j = 0;; j++) {
        const int i = 1 + (j % 12);
        const int m = (i >= P and i < P + Q) ? 2 * M : M;
        N -= m;
        if (N <= 0) { return std::cout << j + 1 << std::endl, 0; }
    }
    return 0;
}
0