結果

問題 No.882 約数倍数
ユーザー htensaihtensai
提出日時 2019-11-11 12:39:01
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 500 ms
コード長 342 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 71,520 KB
実行使用メモリ 56,396 KB
最終ジャッジ日時 2023-10-13 07:59:59
合計ジャッジ時間 4,546 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,640 KB
testcase_01 AC 124 ms
56,396 KB
testcase_02 AC 122 ms
56,116 KB
testcase_03 AC 121 ms
56,124 KB
testcase_04 AC 122 ms
55,836 KB
testcase_05 AC 121 ms
55,912 KB
testcase_06 AC 121 ms
55,976 KB
testcase_07 AC 121 ms
55,996 KB
testcase_08 AC 119 ms
56,132 KB
testcase_09 AC 123 ms
56,072 KB
testcase_10 AC 121 ms
55,916 KB
testcase_11 AC 121 ms
55,880 KB
testcase_12 AC 120 ms
55,864 KB
testcase_13 AC 121 ms
56,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		for (int i = 1; i <= a; i++) {
		    if (a % i == 0 && i % b == 0) {
		        System.out.println("YES");
		        return;
		    }
		}
		System.out.println("NO");
	}
}
0