結果

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

ソースコード

diff #

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


public class Main_yukicoder512 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int x = sc.nextInt();
		int y = sc.nextInt();
		int n = sc.nextInt();

		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}

		boolean flag = true;
		for (int i = 0; i < n - 1; i++) {
			if (a[i] * y > a[i + 1] * x) {
				flag =false;
				break;
			}
		}

		if (flag) {
			pr.println("YES");
		} else {
			pr.println("NO");
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0