結果

問題 No.512 魔法少女の追いかけっこ
ユーザー akitsu818akitsu818
提出日時 2017-05-05 22:58:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 2,220 ms
コンパイル使用メモリ 71,592 KB
実行使用メモリ 58,140 KB
最終ジャッジ日時 2023-09-09 13:09:00
合計ジャッジ時間 10,822 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,752 KB
testcase_01 AC 120 ms
55,892 KB
testcase_02 AC 127 ms
55,960 KB
testcase_03 AC 125 ms
56,092 KB
testcase_04 AC 129 ms
56,068 KB
testcase_05 AC 122 ms
55,656 KB
testcase_06 AC 119 ms
56,132 KB
testcase_07 WA -
testcase_08 AC 126 ms
55,724 KB
testcase_09 AC 119 ms
55,976 KB
testcase_10 AC 126 ms
55,720 KB
testcase_11 AC 124 ms
55,828 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 120 ms
56,124 KB
testcase_16 AC 119 ms
56,028 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 125 ms
55,720 KB
testcase_20 AC 117 ms
55,984 KB
testcase_21 WA -
testcase_22 AC 122 ms
56,260 KB
testcase_23 AC 120 ms
55,660 KB
testcase_24 AC 126 ms
55,900 KB
testcase_25 AC 119 ms
53,832 KB
testcase_26 AC 119 ms
55,972 KB
testcase_27 WA -
testcase_28 AC 120 ms
55,724 KB
testcase_29 AC 119 ms
55,748 KB
testcase_30 WA -
testcase_31 AC 126 ms
56,064 KB
testcase_32 AC 127 ms
55,972 KB
testcase_33 WA -
testcase_34 AC 120 ms
55,856 KB
testcase_35 AC 123 ms
55,840 KB
testcase_36 AC 119 ms
55,456 KB
testcase_37 AC 120 ms
56,080 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 129 ms
55,876 KB
testcase_41 AC 121 ms
55,800 KB
testcase_42 WA -
testcase_43 AC 119 ms
55,344 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 131 ms
56,144 KB
testcase_48 AC 119 ms
55,816 KB
testcase_49 WA -
testcase_50 AC 121 ms
55,440 KB
testcase_51 AC 120 ms
55,776 KB
testcase_52 AC 128 ms
55,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String args[]){

		Scanner cin = new Scanner(System.in);

		int X = cin.nextInt();
		int Y = cin.nextInt();
		int N = cin.nextInt();
		int A[] = new int[N];
		long sum = 0L;
		boolean result = true;
		double rate = (Y-X)/X;

		for(int i=1;i<=N;i++){
			A[i-1] = cin.nextInt();
			if(i>1){
				if(sum*rate>(double)A[i-1]){
					result = false;
					break;
				}
			}
			sum += (long)A[i-1];
		}
		
		if(result){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}

	}
}
0