結果
問題 |
No.1594 Three Classes
|
ユーザー |
![]() |
提出日時 | 2021-07-09 22:41:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 373 bytes |
コンパイル時間 | 1,563 ms |
コンパイル使用メモリ | 168,148 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 17:24:08 |
合計ジャッジ時間 | 2,310 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll N;cin>>N; vector<ll>A(N); ll ans = 0; ll num = 0; for(ll i=0;i<N;i++){ cin>>A[i]; ans += A[i]; num = max(num,A[i]); } if(ans%3!=0){ cout<<"No"<<endl; return 0; } if(num<=ans/3){ cout<<"Yes"<<endl; } }