結果

問題 No.2417 Div Count
ユーザー LaFolia13
提出日時 2023-07-29 16:28:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 1,585 ms
コンパイル使用メモリ 166,348 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-08 03:02:50
合計ジャッジ時間 3,162 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

constexpr llong mod = 1e9+7;
constexpr llong inf = mod * mod;

int main() {
  llong N, K;
  cin >> N >> K;

  llong Ax = N - K;
  llong ans = 0;
  for (llong i = 1; i * i <= Ax; i++) {
    if (Ax % i == 0) {
      ans += i > K;
      ans += Ax/i > K;
      if (i * i == Ax) {
        ans--;
      }
    }
  }

  cout << ans << endl;

  return 0;
}
0