結果

問題 No.2051 Divide
コンテスト
ユーザー 👑 cologne
提出日時 2025-09-03 15:49:09
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WJ  
(最新)
AC  
(最初)
実行時間 -
コード長 435 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
最終ジャッジ日時 2026-10-17 00:49:07
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int A, B;
    cin >> A >> B;
    if (A % B != 0)
    {
        cout << "0\n";
        return 0;
    }
    A /= B;
    int ans = 0;
    for (int i = 1; i * i <= A; ++i)
    {
        if (A % i == 0)
        {
            ++ans;
            if (i * i != A)
                ++ans;
        }
    }
    cout << ans << endl;
}
0