結果

問題 No.2417 Div Count
ユーザー suminoeno7
提出日時 2025-07-13 21:23:19
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 3,106 ms
コンパイル使用メモリ 275,432 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-13 21:23:24
合計ジャッジ時間 4,181 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    ll n, k; cin >> n >> k;
    ll m = n - k;
    int res = 0;
    for (ll i = 1; i * i <= m; i++) {
        if (m % i) continue;
        if (n % i == k) ++res;
        if (i * i < m && n % (m / i) == k) ++res;
    }
    cout << res << endl;
}
0