結果

問題 No.2051 Divide
ユーザー Maeda
提出日時 2025-09-09 15:48:05
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 517 bytes
コンパイル時間 2,531 ms
コンパイル使用メモリ 77,208 KB
実行使用メモリ 41,856 KB
最終ジャッジ日時 2025-09-09 15:48:19
合計ジャッジ時間 13,978 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int count = 0;
        List<Integer> list = new ArrayList<Integer>();
    	for(int i = 1 ; i <= a ; i++){
    		if(a%i == 0){
    			list.add(i);
    		}
    		
    	}
    	for(int i = 0 ; i < list.size() ; i++){
    		if(list.get(i)%b == 0){
    			count++;
    		}
    	}
    	System.out.println(count);
    }
}
0