結果
問題 | No.2417 Div Count |
ユーザー | daiota |
提出日時 | 2023-08-12 14:26:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 518 bytes |
コンパイル時間 | 1,835 ms |
コンパイル使用メモリ | 169,476 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-19 19:30:08 |
合計ジャッジ時間 | 3,236 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; #define REP(i,n) for(int i=0;i<int(n);i++) vector<ll> div(ll n){ vector<ll> d; for(ll i=1;i*i<=n;i++){ if(n%i==0){ d.push_back(i); if(i!=n/i) d.push_back(n/i); } } return d; } int main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll i,j,k; ll N,K; cin >> N >> K; vector<ll> v=div(N-K); ll ans=0; for(i=0;i<(ll)v.size();i++) if(v[i]>K) ans++; cout << ans << endl; return 0; }