結果

問題 No.1219 Mancala Combo
ユーザー ytftytft
提出日時 2021-05-14 00:02:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,167 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 11,240 ms
コンパイル使用メモリ 386,768 KB
実行使用メモリ 9,528 KB
最終ジャッジ日時 2023-10-26 04:01:15
合計ジャッジ時間 17,005 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 3 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 43 ms
7,748 KB
testcase_18 AC 818 ms
7,748 KB
testcase_19 AC 38 ms
7,220 KB
testcase_20 AC 856 ms
8,012 KB
testcase_21 AC 32 ms
7,008 KB
testcase_22 AC 743 ms
7,220 KB
testcase_23 AC 52 ms
8,804 KB
testcase_24 AC 623 ms
6,760 KB
testcase_25 AC 37 ms
7,220 KB
testcase_26 AC 811 ms
7,748 KB
testcase_27 AC 58 ms
9,528 KB
testcase_28 AC 1,167 ms
9,528 KB
権限があれば一括ダウンロードができます

ソースコード

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