結果
問題 |
No.1940 Escape through + -
|
ユーザー |
|
提出日時 | 2022-05-28 11:21:03 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 484 bytes |
コンパイル時間 | 1,957 ms |
コンパイル使用メモリ | 74,268 KB |
実行使用メモリ | 41,460 KB |
最終ジャッジ日時 | 2024-09-20 20:53:50 |
合計ジャッジ時間 | 6,107 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 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); } }