結果

問題 No.1219 Mancala Combo
ユーザー ytft
提出日時 2021-05-14 00:02:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,166 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 8,186 ms
コンパイル使用メモリ 376,396 KB
実行使用メモリ 9,620 KB
最終ジャッジ日時 2024-09-25 11:52:27
合計ジャッジ時間 12,826 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mp;

int main(){
    int n;
    cin>>n;
    vector<mp> A(n);
    for(int i=0;i!=n;++i){
        cin>>A[i];
    }
    mp cnt=0;
    for(int i=n-1;i!=-1;--i){
        cerr<<(A[i]+cnt)<<' '<<(i+1)<<endl;
        if((A[i]+cnt)%(i+1)){
            cout<<"No"<<endl;
            return 0;
        }
        cnt+=(A[i]+cnt)/(i+1);
    }
    cout<<"Yes"<<endl;
}
0