結果

問題 No.1940 Escape through + -
ユーザー eagleeagle
提出日時 2022-05-28 11:23:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 613 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 2,090 ms
コンパイル使用メモリ 74,304 KB
実行使用メモリ 63,248 KB
最終ジャッジ日時 2023-10-20 22:49:07
合計ジャッジ時間 10,340 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,312 KB
testcase_01 AC 131 ms
57,280 KB
testcase_02 AC 132 ms
57,356 KB
testcase_03 AC 136 ms
57,412 KB
testcase_04 AC 134 ms
57,268 KB
testcase_05 AC 134 ms
57,060 KB
testcase_06 AC 137 ms
57,576 KB
testcase_07 AC 138 ms
57,564 KB
testcase_08 AC 133 ms
57,320 KB
testcase_09 AC 133 ms
57,548 KB
testcase_10 AC 133 ms
57,388 KB
testcase_11 AC 136 ms
57,396 KB
testcase_12 AC 131 ms
57,344 KB
testcase_13 AC 129 ms
57,464 KB
testcase_14 AC 130 ms
57,376 KB
testcase_15 AC 129 ms
57,496 KB
testcase_16 AC 132 ms
57,276 KB
testcase_17 AC 132 ms
57,304 KB
testcase_18 AC 132 ms
57,284 KB
testcase_19 AC 190 ms
57,812 KB
testcase_20 AC 289 ms
61,440 KB
testcase_21 AC 279 ms
61,388 KB
testcase_22 AC 268 ms
61,152 KB
testcase_23 AC 277 ms
61,312 KB
testcase_24 AC 613 ms
62,008 KB
testcase_25 AC 602 ms
62,420 KB
testcase_26 AC 608 ms
61,980 KB
testcase_27 AC 598 ms
63,232 KB
testcase_28 AC 606 ms
63,248 KB
権限があれば一括ダウンロードができます

ソースコード

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.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);
	}
}
0