結果
| 問題 | 
                            No.1940 Escape through + -
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-05-28 11:19:05 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 629 bytes | 
| コンパイル時間 | 5,030 ms | 
| コンパイル使用メモリ | 74,620 KB | 
| 実行使用メモリ | 41,748 KB | 
| 最終ジャッジ日時 | 2024-09-20 20:53:43 | 
| 合計ジャッジ時間 | 8,894 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 15 RE * 10 | 
ソースコード
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数列の長さ
		int N = sc.nextInt();
		int M = sc.nextInt();
		//目標値
		int S = sc.nextInt();
		//与えられる値
		int[] A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		String ans;
		int sum = 0;
		//与えられる値の合計値を求める
		for(int i = 0; i < N; i++) {
			sum += A[i];
		}
		if((S - sum) % M == 0) {
			ans = "Yes";
		} else {
			ans = "No";
		}
		System.out.println(ans);
	}
}