結果

問題 No.1219 Mancala Combo
ユーザー poohbearpoohbear
提出日時 2020-09-04 21:44:25
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 199,604 KB
実行使用メモリ 6,216 KB
最終ジャッジ日時 2023-08-17 15:20:11
合計ジャッジ時間 3,718 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 36 ms
5,564 KB
testcase_18 AC 41 ms
5,228 KB
testcase_19 AC 31 ms
5,172 KB
testcase_20 AC 41 ms
5,416 KB
testcase_21 AC 27 ms
4,836 KB
testcase_22 AC 36 ms
4,992 KB
testcase_23 AC 42 ms
5,816 KB
testcase_24 AC 31 ms
4,568 KB
testcase_25 AC 30 ms
4,840 KB
testcase_26 AC 40 ms
5,268 KB
testcase_27 AC 49 ms
6,172 KB
testcase_28 AC 57 ms
6,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(a,n) for (int a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<int,int> P;
typedef pair<ll,P> PP;
typedef vector<vector<int> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;


int main(){
    ll n;
    cin >> n;
    vector<ll>a(n);
    rep(i,n)cin>>a[i];
    vector<ll>r(n+1);
    rep(i,n){
        r[i+1]=r[i]+a[i];
    }
    for(int i=1;i<=n;i++){
        ll now = r[n]-r[i-1];
        if(now%i!=0){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

0