結果

問題 No.2812 Plus Minus Blackboard
ユーザー tanaka255
提出日時 2024-07-20 12:49:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 1,488 ms
コンパイル使用メモリ 194,464 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 02:15:38
合計ジャッジ時間 2,866 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int N;
int main(){
  cin.tie(0)->sync_with_stdio(0);
  cin>>N;
  long long sum=0,mn=1<<30,mx=-1<<30;
  for(int i=0;i<N;++i){
    long long A;cin>>A;
    sum+=A;
    mn=min(mn,A);
    mx=max(mx,A);
  }
  cout<<(mn<=sum&&sum<=mx?"Yes":"No")<<endl;
}
0