結果

問題 No.1219 Mancala Combo
ユーザー shiomusubi496
提出日時 2020-09-05 12:46:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 1,379 ms
コンパイル使用メモリ 168,068 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 03:05:40
合計ジャッジ時間 2,977 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int N;
    cin>>N;
    vector<int> A(N);
    for(int &i:A)cin>>i;
    int sum=0;
    for(int i=N-1;i>=0;i--){
        if((sum+A[i])%(i+1)){
            puts("No");
            return 0;
        }
        sum+=(sum+A[i])/(i+1);
    }
    puts("Yes");
}
0