結果

問題 No.485 方程式のお勉強
ユーザー yagi2
提出日時 2017-04-14 10:47:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 2,148 ms
コンパイル使用メモリ 75,032 KB
実行使用メモリ 54,332 KB
最終ジャッジ日時 2024-10-04 04:29:21
合計ジャッジ時間 5,241 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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