結果
問題 | No.2417 Div Count |
ユーザー |
![]() |
提出日時 | 2023-10-03 12:32:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 576 bytes |
コンパイル時間 | 1,710 ms |
コンパイル使用メモリ | 193,856 KB |
最終ジャッジ日時 | 2025-02-17 04:05:39 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h>#include<iostream>#include<map>#include<vector>#include <algorithm>#include<math.h>#include <iomanip>#include<set>#include <numeric>#include<string>using ll = long long;using namespace std;int main(){ll n, k, cnt = 0;cin >> n >> k;for (ll i = 1; i <= pow((n-k), 0.5); i++){if (!((n-k)%i)){if ((n-k)/i != i) cnt += 2;else cnt++;if (((n-k)/i <= k) && cnt) cnt--;if ((i <= k) && cnt) cnt--;}if ((n-k)/i < k) break;}cout << cnt << endl;}