結果
| 問題 | No.1940 Escape through + - |
| ユーザー |
|
| 提出日時 | 2022-05-28 11:19:05 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 629 bytes |
| 記録 | |
| コンパイル時間 | 2,752 ms |
| コンパイル使用メモリ | 81,648 KB |
| 実行使用メモリ | 46,728 KB |
| 最終ジャッジ日時 | 2026-04-09 05:44:26 |
| 合計ジャッジ時間 | 8,134 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
}