結果

問題 No.2922 Rose Garden
ユーザー viral8
提出日時 2024-10-14 22:21:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 789 ms / 3,000 ms
コード長 414 bytes
コンパイル時間 2,814 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 53,164 KB
最終ジャッジ日時 2024-10-14 22:22:31
合計ジャッジ時間 29,653 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.HashMap;
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long S = sc.nextInt();
		long B = sc.nextInt();
		int max = sc.nextInt();
		while(--N>0){
			int H = sc.nextInt();
			if(max+S*B<H){
				System.out.println("No");
				return;
			}
			max = Math.max(max,H);
		}
		System.out.println("Yes");
	}
}
0