結果

問題 No.512 魔法少女の追いかけっこ
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-05 22:43:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,402 bytes
コンパイル時間 2,587 ms
コンパイル使用メモリ 79,624 KB
実行使用メモリ 50,944 KB
最終ジャッジ日時 2023-09-09 13:01:10
合計ジャッジ時間 7,165 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
50,332 KB
testcase_01 AC 56 ms
50,528 KB
testcase_02 AC 57 ms
50,480 KB
testcase_03 AC 57 ms
50,532 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 55 ms
50,524 KB
testcase_07 AC 55 ms
50,688 KB
testcase_08 AC 56 ms
50,872 KB
testcase_09 WA -
testcase_10 AC 56 ms
50,476 KB
testcase_11 AC 56 ms
50,468 KB
testcase_12 AC 55 ms
50,508 KB
testcase_13 AC 56 ms
50,536 KB
testcase_14 AC 56 ms
50,652 KB
testcase_15 AC 55 ms
50,408 KB
testcase_16 AC 55 ms
50,576 KB
testcase_17 AC 56 ms
50,472 KB
testcase_18 AC 56 ms
50,484 KB
testcase_19 WA -
testcase_20 AC 55 ms
50,800 KB
testcase_21 AC 57 ms
50,404 KB
testcase_22 AC 56 ms
50,588 KB
testcase_23 AC 56 ms
48,544 KB
testcase_24 AC 58 ms
50,536 KB
testcase_25 AC 56 ms
50,468 KB
testcase_26 AC 57 ms
50,520 KB
testcase_27 AC 56 ms
50,556 KB
testcase_28 AC 55 ms
50,536 KB
testcase_29 AC 56 ms
50,376 KB
testcase_30 AC 56 ms
50,592 KB
testcase_31 AC 56 ms
50,500 KB
testcase_32 AC 57 ms
50,500 KB
testcase_33 AC 55 ms
50,464 KB
testcase_34 AC 55 ms
50,816 KB
testcase_35 AC 60 ms
50,852 KB
testcase_36 AC 58 ms
50,768 KB
testcase_37 AC 56 ms
50,372 KB
testcase_38 AC 57 ms
50,584 KB
testcase_39 AC 56 ms
50,456 KB
testcase_40 AC 57 ms
50,476 KB
testcase_41 AC 56 ms
50,544 KB
testcase_42 AC 56 ms
50,852 KB
testcase_43 AC 56 ms
50,496 KB
testcase_44 AC 57 ms
50,632 KB
testcase_45 AC 55 ms
50,504 KB
testcase_46 AC 56 ms
50,552 KB
testcase_47 WA -
testcase_48 AC 55 ms
50,588 KB
testcase_49 AC 55 ms
50,456 KB
testcase_50 AC 55 ms
50,684 KB
testcase_51 WA -
testcase_52 AC 56 ms
50,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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 canChase = true;

        int[] intersections = Stream.of(inputs).mapToInt(Integer::parseInt).toArray();

        for (int i = 0; i < N; i++) {
            int intersection = Integer.parseInt(inputs[i]);
            double time = intersection / X1;

            double masterPosition = time * Y1;
            for (int j = i + 1; j < N; j++) {
                if (masterPosition > intersections[j]) {
                    canChase = false;
                    break;
                }
            }
            if (!canChase) {
                break;
            }
        }

        if (canChase) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

}
0