結果
| 問題 |
No.3220 Forest Creation
|
| コンテスト | |
| ユーザー |
Tehom
|
| 提出日時 | 2025-08-23 00:42:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 688 bytes |
| コンパイル時間 | 3,699 ms |
| コンパイル使用メモリ | 251,280 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-08-23 00:42:56 |
| 合計ジャッジ時間 | 6,244 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 22 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repl(i,a,b) for(ll i=(a);i<(b);i++)
#define all(a) (a).begin(),(a).end()
template <typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;} return false;}
template <typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;} return false;}
int main(){
int n; cin >> n;
vector<ll> a(n+1);
rep(i,0,n+1) cin >> a[i];
ll sum=0;
ll cnt=0;
rep(i,2,n+1){
sum+=i*a[i];
cnt+=a[i];
}
if(sum-2*(cnt-1)<=a[1] && a[1]<=sum && (sum-a[1])%2 == 0){
cout << "Yes" << endl;
}
else cout << "No" << endl;
}
Tehom