結果
問題 | No.740 幻の木 |
ユーザー |
|
提出日時 | 2018-10-05 21:26:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 606 bytes |
コンパイル時間 | 2,183 ms |
コンパイル使用メモリ | 193,924 KB |
最終ジャッジ日時 | 2025-01-06 14:16:28 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include <bits/stdc++.h>#define show(x) std::cerr << #x << " = " << x << std::endlusing 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;}