結果
問題 |
No.2417 Div Count
|
ユーザー |
![]() |
提出日時 | 2024-06-15 12:10:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 596 bytes |
コンパイル時間 | 2,001 ms |
コンパイル使用メモリ | 174,340 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-15 12:10:45 |
合計ジャッジ時間 | 4,009 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 40 WA * 1 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i<n; ++i) #define repl(i,m,n) for(ll i=m; i<n; ++i) vector<ll> divisor(ll n){ vector<ll> res; for(ll i = 1LL; i*i <= n; ++i){ if(n % i != 0LL) continue; res.push_back(i); res.push_back(n / i); } sort(res.begin(), res.end()); return res; } int main(){ ll N, K; cin >> N >> K; int ans = 0; vector<ll> div = divisor(N - K); for(ll d : div){ if(d <= K) continue; ans++; } cout << ans << endl; return 0; }