結果

問題 No.3220 Forest Creation
ユーザー Nauclhlt🪷
提出日時 2025-06-29 16:18:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 1,427 ms
コンパイル使用メモリ 195,652 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-07-04 20:47:52
合計ジャッジ時間 2,802 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 42 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

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

    int N;
    cin >> N;
    vector<ll> A(N + 1);
    
    for (int i = 0; i <= N; i++)
    {
        cin >> A[i];
    }

    ll s = 0;
    ll v = 0;
    for (int i = 0; i <= N; i++)
    {
        v += A[i];
        s += i * A[i];
    }

    if (s % 2 == 0 && v - s / 2 >= 1 && A[1] >= 2 * (v - s / 2 - A[0]))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}
0