結果
| 問題 |
No.1940 Escape through + -
|
| ユーザー |
|
| 提出日時 | 2022-05-28 11:23:50 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 595 ms / 2,000 ms |
| コード長 | 490 bytes |
| コンパイル時間 | 3,997 ms |
| コンパイル使用メモリ | 74,872 KB |
| 実行使用メモリ | 54,520 KB |
| 最終ジャッジ日時 | 2024-09-20 20:55:32 |
| 合計ジャッジ時間 | 13,019 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 |
ソースコード
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.nextLong();
//目標値
long S = sc.nextLong();
long sum = 0;
for(int i = 0; i < N; i++) {
sum += sc.nextLong();
}
String ans;
if((S - sum) % M == 0) {
ans = "Yes";
} else {
ans = "No";
}
System.out.println(ans);
}
}