結果

問題 No.3773 mod A > mod B
コンテスト
ユーザー Mikan04y
提出日時 2026-11-18 13:28:10
言語 C++23(gnu拡張gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc16.so -lm -std=gnu++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 849µs
コード長 762 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,818 ms
コンパイル使用メモリ 356,140 KB
実行使用メモリ 9,888 KB
最終ジャッジ日時 2026-11-18 13:28:17
合計ジャッジ時間 4,713 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = (a); i < (ll)(b); i++)
#define all(x) (x).begin(), (x).end()
constexpr int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};
template <typename T>
bool chmin(T& a, const T& b) { return a > b ? (a = b, true) : false; }
template <typename T>
bool chmax(T& a, const T& b) { return a < b ? (a = b, true) : false; }

void solve() {
    int N, A, B;
    cin >> N >> A >> B;
    int ans = 0;
    rep(n, 1, N + 1) {
        if ((n % A) > (n % B)) ans++;
    }
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    // cin >> T;
    while (T--) {
        solve();
    }
}
0