結果

問題 No.512 魔法少女の追いかけっこ
コンテスト
ユーザー Tsukasa_Type
提出日時 2018-02-17 17:11:43
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 490 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,834 ms
コンパイル使用メモリ 81,896 KB
実行使用メモリ 41,984 KB
最終ジャッジ日時 2026-03-14 17:01:21
合計ジャッジ時間 6,309 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 53
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int student = sc.nextInt();
		int teacher = sc.nextInt();
		int n = sc.nextInt();
		int[] intersection = new int[n];
		for (int i=0; i<n; i++) {
			intersection[i] = sc.nextInt();
		}
		
		boolean F = true;
		for (int i=0; i<n-1; i++) {
			if (intersection[i]*teacher > intersection[i+1]*student) {F = false;}
		}
		System.out.println(F==true?"YES":"NO");
	}
}
0