結果

問題 No.512 魔法少女の追いかけっこ
ユーザー uafr_cs
提出日時 2017-05-05 22:46:42
言語 Java
(openjdk 23)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 644 bytes
コンパイル時間 2,539 ms
コンパイル使用メモリ 75,812 KB
実行使用メモリ 41,988 KB
最終ジャッジ日時 2024-06-27 06:04:54
合計ジャッジ時間 11,361 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 53
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final int X = sc.nextInt();
		final int Y = sc.nextInt();
		final int N = sc.nextInt();
		
		int[] array = new int[N];
		for(int i = 0; i < N; i++){
			array[i] = sc.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++){
			if(array[i] * Y > array[i + 1] * X){
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
	}
}
0