結果

問題 No.1940 Escape through + -
ユーザー eagle
提出日時 2022-05-28 11:22:40
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 487 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 74,492 KB
実行使用メモリ 41,492 KB
最終ジャッジ日時 2024-09-20 20:53:57
合計ジャッジ時間 6,084 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数列の長さ
		int N = sc.nextInt();
		long M = sc.nextInt();
		//目標値
		long S = sc.nextInt();
		long sum = 0;
		for(int i = 0; i < N; i++) {
			sum += sc.nextInt();
		}
		String ans;
		if((S - sum) % M == 0) {
			ans = "Yes";
		} else {
			ans = "No";
		}
		System.out.println(ans);
	}
}
0