結果

問題 No.512 魔法少女の追いかけっこ
ユーザー fjafjafja
提出日時 2017-07-19 01:17:08
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 3,797 ms
コンパイル使用メモリ 77,612 KB
実行使用メモリ 41,872 KB
最終ジャッジ日時 2024-06-27 06:38:03
合計ジャッジ時間 11,788 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N512
{
	public static void main(String[] args)
	{
		Scanner sc =new Scanner (System.in);
		double X=sc.nextInt();
		double Y=sc.nextInt();
		int N=sc.nextInt();
		int[] A=new int[N];
		double D=Y-X;
		for(int i=0;i<N;i++)
		{
			A[i]=sc.nextInt();
		}
		double xtime=0;
		double now=0;
		double next=A[0];
		String msg="YES";
		for(int i=0;i<N-1;i++)
		{
			now+=A[i];
			next+=A[i+1];
			xtime=now/X;
			if(xtime*Y>next)
			{
				msg="NO";
			}
		}
		System.out.println(msg);
	}

}
0