結果

問題 No.1048 Zero (Advanced)
ユーザー ooaiu
提出日時 2024-12-16 12:33:19
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 727 bytes
コンパイル時間 3,702 ms
コンパイル使用メモリ 244,940 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-16 12:33:24
合計ジャッジ時間 3,892 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#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) {
        cout << "Yes\n";
        return;
    }
    if (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();
    }
}
0