結果
問題 | No.2417 Div Count |
ユーザー |
|
提出日時 | 2023-07-11 14:55:41 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 603 bytes |
コンパイル時間 | 854 ms |
コンパイル使用メモリ | 124,544 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 05:20:19 |
合計ジャッジ時間 | 2,136 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 40 WA * 1 |
ソースコード
#include <iostream>#include <cassert>#include <set>using namespace std;using ll = long long;set<ll> divs(ll n) {set<ll> cnt;for (ll i = 1; i * i <= n; ++i) {if (n % i == 0) {cnt.insert(i);cnt.insert(n / i);}}return cnt;}int main() {ll n, k;cin >> n >> k;assert(1 <= n && n <= 1000000000000);assert(0 <= k && k < n);n -= k;auto ds = divs(n);int ans = 0;for (auto d : ds) {if (d < k) {continue;}ans += 1;}cout << ans << endl;return 0;}