結果
問題 |
No.2451 Redistribute Integers
|
ユーザー |
![]() |
提出日時 | 2023-09-01 23:07:25 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 437 bytes |
コンパイル時間 | 2,310 ms |
コンパイル使用メモリ | 74,404 KB |
実行使用メモリ | 59,816 KB |
最終ジャッジ日時 | 2024-06-11 11:05:16 |
合計ジャッジ時間 | 18,461 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 6 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } sc.close(); long sum = 0; for (int i = 0; i < n; i++) { sum += a[i]; } if (sum % n == 0) { System.out.println("Yes"); } else { System.out.println("No"); } } }