結果

問題 No.2051 Divide
ユーザー a a
提出日時 2022-10-14 15:18:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,610 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-26 12:38:22
合計ジャッジ時間 3,479 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b=list(map(int,input().split()))
if a%b!=0:
    print(0)
else:    
    i=2
    c=1
    while a>=i:
        n=0
        while a%i==0:
            a//=i
            n+=1
        while b%i==0:
            b//=i
            n-=1
        if n!=0:
            c*=(n+1)
        i+=1
    print(c)
0