結果

問題 No.3064 Speedrun (Easy)
ユーザー ks2m
提出日時 2025-03-21 21:43:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 2,591 ms
コンパイル使用メモリ 80,484 KB
実行使用メモリ 54,400 KB
最終ジャッジ日時 2025-03-21 21:43:51
合計ジャッジ時間 4,707 ms
ジャッジサーバーID
(参考情報)
judge1 / judge7
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = 4;
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		int[] p = new int[n];
		for (int i = 0; i < n; i++) {
			p[i] = sc.nextInt();
		}
		int t = sc.nextInt();
		sc.close();

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i] * p[i];
		}
		if (sum <= t) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
0