結果

問題 No.2051 Divide
ユーザー Maeda
提出日時 2025-09-09 16:08:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 2,473 ms
コンパイル使用メモリ 76,932 KB
実行使用メモリ 41,728 KB
最終ジャッジ日時 2025-09-09 16:08:56
合計ジャッジ時間 6,951 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long a = scan.nextLong();
        long b = scan.nextLong();
        long count = 0;
    	for(long i = 1 ; i*i <= a ; i++){
    		if(a%i != 0){
    			continue;	
    		}
    		if(i%b == 0){
    			count++;
    		}
    		if(a/i != i && (a/i)%b == 0){
    			count++;
    		}
    	}
    	System.out.println(count);
    }
}
0