結果

問題 No.882 約数倍数
ユーザー GrenacheGrenache
提出日時 2019-09-13 22:46:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 500 ms
コード長 664 bytes
コンパイル時間 3,311 ms
コンパイル使用メモリ 72,424 KB
実行使用メモリ 56,064 KB
最終ジャッジ日時 2023-09-17 14:55:47
合計ジャッジ時間 5,940 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,920 KB
testcase_01 AC 126 ms
55,896 KB
testcase_02 AC 127 ms
55,876 KB
testcase_03 AC 126 ms
55,580 KB
testcase_04 AC 126 ms
54,380 KB
testcase_05 AC 131 ms
55,452 KB
testcase_06 AC 127 ms
55,600 KB
testcase_07 AC 126 ms
56,064 KB
testcase_08 AC 126 ms
55,980 KB
testcase_09 AC 127 ms
55,812 KB
testcase_10 AC 125 ms
55,664 KB
testcase_11 AC 128 ms
55,884 KB
testcase_12 AC 126 ms
55,612 KB
testcase_13 AC 125 ms
55,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.Scanner;


public class Main_yukicoder882 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		for (int d = 1; d <= a; d++) {
			if (a % d == 0 && d % b == 0) {
				pr.println("YES");
				return;
			}
		}

		pr.println("NO");
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0