結果

問題 No.2051 Divide
ユーザー _yurimoir
提出日時 2022-10-18 10:03:10
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 3,880 ms
コンパイル使用メモリ 243,036 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 19:14:20
合計ジャッジ時間 3,943 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(b!=1&&a%b!=0){
        cout<<0<<endl;
	    return 0;
    }
    int cnt=0;
    a/=b;
    for(int i=1;i<=sqrt(a);i++){
        if(a%i==0){
            cnt+=2;
            if(i==sqrt(a))cnt--;
        }
    }
    cout<<cnt<<endl;
    return 0;
}
0