結果

問題 No.2051 Divide
ユーザー AsahiAsahi
提出日時 2023-01-06 18:38:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 1,223 bytes
コンパイル時間 6,036 ms
コンパイル使用メモリ 75,808 KB
実行使用メモリ 55,832 KB
最終ジャッジ日時 2023-08-20 12:01:39
合計ジャッジ時間 8,408 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,748 KB
testcase_01 AC 123 ms
55,484 KB
testcase_02 AC 123 ms
55,672 KB
testcase_03 AC 122 ms
55,572 KB
testcase_04 AC 119 ms
54,052 KB
testcase_05 AC 121 ms
55,604 KB
testcase_06 AC 122 ms
55,312 KB
testcase_07 AC 120 ms
55,776 KB
testcase_08 AC 120 ms
55,744 KB
testcase_09 AC 121 ms
55,320 KB
testcase_10 AC 119 ms
55,664 KB
testcase_11 AC 118 ms
55,480 KB
testcase_12 AC 124 ms
55,596 KB
testcase_13 AC 121 ms
55,832 KB
testcase_14 AC 120 ms
55,576 KB
testcase_15 AC 120 ms
55,604 KB
testcase_16 AC 122 ms
55,768 KB
testcase_17 AC 119 ms
55,756 KB
testcase_18 AC 120 ms
55,320 KB
testcase_19 AC 118 ms
55,672 KB
testcase_20 AC 120 ms
55,800 KB
testcase_21 AC 120 ms
55,280 KB
testcase_22 AC 118 ms
55,692 KB
testcase_23 AC 122 ms
55,604 KB
testcase_24 AC 122 ms
55,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main{
    public static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
    public static final int INFI = Integer.MAX_VALUE;
    public static final long INFL = Long.MAX_VALUE;
    public static final int MOD = 1000000007;
    public static PrintWriter output = new PrintWriter(System.out);
    public static Scanner sc = new Scanner(System.in);
    public static final int [] dy4 = {0,1,0,-1};
    public static final int [] dx4 = {1,0,-1,0};
    public static ArrayList<ArrayList<Integer>> list = new ArrayList<>();
    public static ArrayList<Integer> answer = new ArrayList<>();
    public static boolean [] visited ;
    public static void main(String[] args) throws IOException{
        StringTokenizer st;
        //st = new StringTokenizer(buff.readLine());
        int A = sc.nextInt();
        int B = sc.nextInt();
        Set<Integer> ans = new HashSet<>();
        for(int i=1;i<=Math.sqrt(A);i++) {
            if(A % i == 0) {
                if((A/i)%B == 0) ans.add(A/i);
                if(i % B == 0) ans.add(i);
            }
        }
        output.print(ans.size());
        output.flush();
    }
}
0