結果

問題 No.485 方程式のお勉強
ユーザー yagi2yagi2
提出日時 2017-04-14 10:47:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 2,198 ms
コンパイル使用メモリ 75,016 KB
実行使用メモリ 54,336 KB
最終ジャッジ日時 2024-04-14 23:19:38
合計ジャッジ時間 5,118 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
53,888 KB
testcase_01 AC 139 ms
54,056 KB
testcase_02 AC 128 ms
53,996 KB
testcase_03 AC 128 ms
54,336 KB
testcase_04 AC 129 ms
54,088 KB
testcase_05 AC 127 ms
54,036 KB
testcase_06 AC 128 ms
54,084 KB
testcase_07 AC 129 ms
54,160 KB
testcase_08 AC 128 ms
54,324 KB
testcase_09 AC 130 ms
54,248 KB
testcase_10 AC 131 ms
54,164 KB
testcase_11 AC 129 ms
53,864 KB
testcase_12 AC 125 ms
54,112 KB
testcase_13 AC 127 ms
54,008 KB
testcase_14 AC 131 ms
54,132 KB
testcase_15 AC 128 ms
54,184 KB
testcase_16 AC 129 ms
54,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        double D = (double)B / A;
        
        if (D - Math.floor(D) == 0.0) {
            System.out.printf("%d\n", (int)Math.floor(D));
        } else {
            System.out.println("NO");
        }
    }
}
0