結果

問題 No.2812 Plus Minus Blackboard
ユーザー HIcoder
提出日時 2024-08-16 09:40:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 724 bytes
コンパイル時間 1,082 ms
コンパイル使用メモリ 114,780 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 02:17:01
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<queue>
#include<vector>
#include<cassert>
#include<random>
#include<set>
#include<map>
#include<cassert>
#include<unordered_map>
#include<bitset>
#include<numeric>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=1<<30;
const ll INF=1LL<<62;
typedef pair<int,ll> P;
typedef pair<int,P> PP; 
const ll MOD=998244353;

int main(){
    int N;
    cin>>N;
    vector<ll> A(N);
    ll sumA=0;
    ll minA=INF,maxA=-INF;
    for(int i=0;i<N;i++){
        cin>>A[i];
        minA=min(minA,A[i]);
        maxA=max(maxA,A[i]);
        sumA+=A[i];
    }

    if(minA<=sumA && sumA<=maxA){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

}
0