結果
| 問題 | 
                            No.2051 Divide
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Schnee
                         | 
                    
| 提出日時 | 2022-09-02 05:54:55 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 344 bytes | 
| コンパイル時間 | 248 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-11-15 10:38:06 | 
| 合計ジャッジ時間 | 1,903 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 12 WA * 11 | 
ソースコード
import math
a, b = map(int, input().split())
c = 0
while a%b==0:
    if b==1:
        c = 1
        break
    a //= b
    c += 1
d = a
for i in range(2, math.ceil(math.sqrt(a))):
    if a%i==0:
        tmp = 1
        while a%i==0:
            tmp += 1
            a //= i
        c *= tmp
if a==d and b!=1:
    print(c*2)
else:
    print(c)
            
            
            
        
            
Schnee