結果

問題 No.1219 Mancala Combo
ユーザー NoviNovi
提出日時 2020-09-05 13:47:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 952 bytes
コンパイル時間 2,282 ms
コンパイル使用メモリ 165,664 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-18 22:37:43
合計ジャッジ時間 4,052 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,356 KB
testcase_03 AC 1 ms
4,356 KB
testcase_04 AC 2 ms
4,356 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,356 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 1 ms
4,356 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,356 KB
testcase_13 AC 2 ms
4,356 KB
testcase_14 AC 2 ms
4,356 KB
testcase_15 AC 2 ms
4,356 KB
testcase_16 AC 2 ms
4,356 KB
testcase_17 AC 13 ms
4,352 KB
testcase_18 AC 16 ms
4,352 KB
testcase_19 AC 12 ms
4,356 KB
testcase_20 AC 17 ms
4,360 KB
testcase_21 AC 10 ms
4,352 KB
testcase_22 AC 15 ms
4,356 KB
testcase_23 AC 16 ms
4,356 KB
testcase_24 AC 13 ms
4,356 KB
testcase_25 AC 12 ms
4,352 KB
testcase_26 AC 16 ms
4,356 KB
testcase_27 AC 18 ms
4,356 KB
testcase_28 AC 22 ms
4,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
typedef pair<int, int> pint;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;

Int digit(Int a){
    string s=to_string(a);
    Int tmp=0;
    for(int i=0; i<(int)s.size(); i++ ){
        tmp+=s[i]-'0';
    }
    return tmp;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n; cin>>n;
    vector<int > a(n,0);
    rep(i,n) cin>>a[i];
    Int count=0;
    bool ok=true;
    for(int i=n-1; i>=0; i--){
        if((a[i]+count)%(i+1)==0){
            count+=(a[i]+count)/(i+1);
        }
        else {
            ok=false;
            break;
        }
    }
    if(ok) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}
0