結果
問題 | No.1586 Equal Array |
ユーザー |
![]() |
提出日時 | 2021-07-08 22:23:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 1,000 ms |
コード長 | 381 bytes |
コンパイル時間 | 2,330 ms |
コンパイル使用メモリ | 194,088 KB |
最終ジャッジ日時 | 2025-01-22 18:27:40 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main() {ios::sync_with_stdio(false);cin.tie(0);int n;cin >> n;vector<int> a(n);for (int i = 0; i < n; i++) {cin >> a[i];}ll s = 0;for (int i = 0; i < n; i++) {s += a[i];}cout << (s % n == 0 ? "Yes" : "No") << endl;return 0;}