結果

問題 No.1219 Mancala Combo
ユーザー onsen_manjuuu
提出日時 2020-09-04 22:15:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 1,564 ms
コンパイル使用メモリ 167,880 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-26 13:13:48
合計ジャッジ時間 3,149 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll = long long;


int main()
{
    int n; cin >> n;
    vector<int> a(n+1);
    for(int i = 0; i < n; i++)cin >> a[i+1];

    for(int i = 1; i <= n; i++)if(a[i] > i) {
        cout << "No" << endl;
        return 0;
    }
    int sum = 0;

    for(int i = n; i >= 1; i--) {
        if(a[i] % i){cout << "No" << endl; return 0;}
        sum += a[i] / i;
        a[i - 1] += sum;
    }
    cout << "Yes" << endl;


}
0