結果
問題 | No.2417 Div Count |
ユーザー |
![]() |
提出日時 | 2023-08-16 02:38:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 616 bytes |
コンパイル時間 | 1,594 ms |
コンパイル使用メモリ | 192,940 KB |
最終ジャッジ日時 | 2025-02-16 08:38:02 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define ll long long#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)#define rrep(i, n, a) for (int i = (int)(n); i >= (int)(a); i--)void solve(){ll n,k; cin >> n >> k;ll p = n-k;ll answer = 0;ll d = 1;while(d < sqrt(p)){if(p % d == 0){if(d > k) answer++;if((ll)p/d > k )answer++;}d++;}if(p == (ll)sqrt(p)*(ll)sqrt(p) && (ll)sqrt(p) >= k) answer++;cout << answer;}int main(){ios::sync_with_stdio(false);cin.tie(0);solve();return 0;}