結果
| 問題 |
No.2417 Div Count
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-05 14:02:37 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 546 bytes |
| コンパイル時間 | 1,194 ms |
| コンパイル使用メモリ | 99,408 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-29 17:55:51 |
| 合計ジャッジ時間 | 2,355 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
vector<ll> enum_divs (ll x) {
vector<ll> res;
for (int i = 1; i <= x; i++) {
if (x < 1LL * i * i) break;
if (x % i == 0) {
res.push_back(i);
res.push_back(x/i);
}
}
sort(res.begin(), res.end());
return res;
}
int main () {
ll N, K; cin >> N >> K;
auto divs = enum_divs(N-K);
int ans = 0;
for (auto& v : divs) if (K < v) ans++;
cout << ans << "\n";
}