結果

問題 No.512 魔法少女の追いかけっこ
ユーザー fkwnw3_1243
提出日時 2017-05-05 22:32:56
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 1,125 bytes
コンパイル時間 2,105 ms
コンパイル使用メモリ 77,684 KB
実行使用メモリ 50,456 KB
最終ジャッジ日時 2024-06-27 05:56:40
合計ジャッジ時間 6,027 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 47 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

import static java.lang.System.in;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        int X = Integer.parseInt(inputs[0]);
        int Y = Integer.parseInt(inputs[1]);
        double X1 = X * 1000 / 3600.0;
        double Y1 = Y * 1000 / 3600.0;


        int N = Integer.parseInt(reader.readLine());
        inputs = reader.readLine().split(" ");
        boolean result = true;
        for (int i = 0; i < N - 1; i++) {
            int first = Integer.parseInt(inputs[i]);
            int second = Integer.parseInt(inputs[i + 1]);

            double tmp = (double) first / X1;
            if (tmp * Y1 > second) {
                result = false;
                break;
            }
        }
        if(result) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

}
0