結果

問題 No.512 魔法少女の追いかけっこ
ユーザー tsunabittsunabit
提出日時 2019-06-13 01:33:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 753 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 80,820 KB
実行使用メモリ 54,696 KB
最終ジャッジ日時 2024-04-20 10:17:41
合計ジャッジ時間 11,839 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,292 KB
testcase_01 AC 131 ms
54,060 KB
testcase_02 AC 137 ms
54,512 KB
testcase_03 AC 140 ms
54,544 KB
testcase_04 AC 135 ms
54,296 KB
testcase_05 AC 133 ms
54,312 KB
testcase_06 AC 127 ms
54,020 KB
testcase_07 AC 134 ms
54,064 KB
testcase_08 AC 138 ms
54,320 KB
testcase_09 AC 124 ms
54,308 KB
testcase_10 AC 129 ms
54,388 KB
testcase_11 AC 114 ms
53,384 KB
testcase_12 AC 128 ms
54,124 KB
testcase_13 AC 127 ms
54,224 KB
testcase_14 AC 134 ms
54,432 KB
testcase_15 AC 125 ms
53,364 KB
testcase_16 AC 135 ms
54,304 KB
testcase_17 AC 134 ms
54,372 KB
testcase_18 AC 116 ms
53,768 KB
testcase_19 AC 134 ms
54,036 KB
testcase_20 AC 140 ms
54,300 KB
testcase_21 AC 136 ms
54,572 KB
testcase_22 AC 129 ms
53,660 KB
testcase_23 AC 116 ms
53,776 KB
testcase_24 AC 135 ms
54,356 KB
testcase_25 AC 127 ms
54,296 KB
testcase_26 AC 114 ms
53,696 KB
testcase_27 AC 128 ms
54,304 KB
testcase_28 AC 137 ms
54,272 KB
testcase_29 AC 135 ms
54,396 KB
testcase_30 AC 127 ms
54,372 KB
testcase_31 AC 132 ms
54,372 KB
testcase_32 AC 135 ms
54,132 KB
testcase_33 AC 125 ms
53,572 KB
testcase_34 AC 140 ms
54,228 KB
testcase_35 AC 132 ms
54,556 KB
testcase_36 AC 135 ms
54,404 KB
testcase_37 AC 126 ms
53,508 KB
testcase_38 AC 146 ms
54,696 KB
testcase_39 AC 129 ms
53,696 KB
testcase_40 AC 140 ms
54,112 KB
testcase_41 AC 127 ms
54,232 KB
testcase_42 AC 128 ms
54,240 KB
testcase_43 AC 126 ms
54,176 KB
testcase_44 AC 130 ms
54,368 KB
testcase_45 AC 138 ms
54,212 KB
testcase_46 AC 131 ms
54,288 KB
testcase_47 AC 140 ms
54,428 KB
testcase_48 AC 131 ms
54,140 KB
testcase_49 AC 114 ms
53,508 KB
testcase_50 AC 136 ms
54,336 KB
testcase_51 AC 130 ms
54,284 KB
testcase_52 AC 129 ms
54,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No512 {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	double x = sc.nextDouble() * 1000 / 3600, y = sc.nextDouble() * 1000 / 3600;
    	int n = sc.nextInt();
    	int[] a = new int[n];
    	
    	for(int i = 0; i < n; i++) {
    		a[i] = sc.nextInt();
    	}
    	for(int i = 0; i < n - 1; i++) {
    		double j = a[i] / x;
//    		System.out.println("i = " + (i + 1) + " a[i + 1] = " + a[i + 1] + ": j * y = " + (int)(j * y));
    		// y * a[i] * x > a[i + 1] → y * a[i] > a[i + 1] * x
    		if((int)(y * a[i]) > a[i + 1] * x) {
    			System.out.println("NO");
    			return;
    		}
    	}
    	System.out.println("YES");
    }
}
0