結果

問題 No.2836 Comment Out
ユーザー momoyuu
提出日時 2024-08-09 21:26:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 1,005 ms
コンパイル使用メモリ 94,224 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-08-09 21:26:38
合計ジャッジ時間 3,380 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll n;
    cin>>n;
    vector<ll> a(n);
    for(int i = 0;i<n;i++) cin>>a[i];
    ll sum = 0;
    for(int i = 0;i<n;i++) {
        if(a[i]==1||a[i]==0){
            cout<<"Yes\n";
            return 0;
        }
        sum += a[i];
    }
    if(sum==0) cout<<"Yes\n";
    else cout<<"No\n";
}

0