結果

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

ソースコード

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;
  set<llong> st;
  for (llong i = 1; i * i <= Ax; i++) {
    if (Ax % i == 0) {
      st.insert(i);
      st.insert(Ax/i);
    }
  }
  
  llong ans = 0;
  for (auto s: st) {
    if (s > K) {
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}
0