結果
問題 |
No.1048 Zero (Advanced)
|
ユーザー |
|
提出日時 | 2024-12-16 12:39:38 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 709 bytes |
コンパイル時間 | 3,659 ms |
コンパイル使用メモリ | 244,116 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-16 12:39:43 |
合計ジャッジ時間 | 3,557 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
ソースコード
#ifndef LOCAL #include <bits/stdc++.h> using namespace std; #define debug(...) (void(0)) #else #include "algo/debug.h" #endif void solve() { int L, R, M, K; cin >> L >> R >> M >> K; if((K == 0) || (L == 0) || (L <= M && M <= R) || (R - L + 1) >= M) { cout << "Yes\n"; } else { int lr = L % M; int rr = R % M; int64_t mn = min(lr, rr), mx = max(lr, rr); int64_t hi = mx * K, lo = mn * K; int64_t cnt = hi / M - max(0L, lo - 1) / M; cout << (cnt ? "Yes\n" : "No\n"); } } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int tt = 1; // std::cin >> tt; while (tt--) { solve(); } }