結果

問題 No.1219 Mancala Combo
ユーザー kyoskyos
提出日時 2020-09-04 23:01:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 1,536 ms
コンパイル使用メモリ 165,324 KB
実行使用メモリ 4,616 KB
最終ジャッジ日時 2023-08-17 20:38:52
合計ジャッジ時間 3,374 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,504 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 35 ms
4,380 KB
testcase_18 AC 41 ms
4,380 KB
testcase_19 AC 30 ms
4,376 KB
testcase_20 AC 43 ms
4,384 KB
testcase_21 AC 27 ms
4,380 KB
testcase_22 AC 37 ms
4,376 KB
testcase_23 AC 42 ms
4,460 KB
testcase_24 AC 31 ms
4,376 KB
testcase_25 AC 29 ms
4,384 KB
testcase_26 AC 41 ms
4,376 KB
testcase_27 AC 48 ms
4,592 KB
testcase_28 AC 58 ms
4,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <iostream>
#include <ctime>
using namespace std;
#define _LL long long
#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)
#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)

bool getans()
{
    _LL n; cin >> n;
    vector<_LL> a(n);
    rep(i, n) cin >> a[i];
    _LL sum = 0;
    for( _LL k = n; k >= 1; k-- )
    {
        a[k - 1] += sum;
        if( a[k - 1] % k != 0 ) return false;
        sum += a[k - 1] / k;
    }
    return true;
}

int main()
{
    if( getans() )
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;    
}
0