結果
問題 | No.1586 Equal Array |
ユーザー |
|
提出日時 | 2023-02-06 08:12:59 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 621 ms / 1,000 ms |
コード長 | 662 bytes |
コンパイル時間 | 2,234 ms |
コンパイル使用メモリ | 75,236 KB |
実行使用メモリ | 49,912 KB |
最終ジャッジ日時 | 2024-07-04 14:30:53 |
合計ジャッジ時間 | 11,737 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import java.util.*; import java.io.*; import java.math.*; // import java.util.stream.Stream; class Main{ static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static PrintWriter output = new PrintWriter(System.out); static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws IOException{ int n = sc.nextInt(); long sum = 0; long [] a = new long[n]; for(int i=0;i<n;i++) { a[i] = sc.nextLong(); sum += a[i]; } output.print(sum % n == 0 ? "Yes":"No"); output.flush(); } }