結果

問題 No.1219 Mancala Combo
ユーザー umezoumezo
提出日時 2022-08-09 18:28:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 1,967 ms
コンパイル使用メモリ 203,820 KB
実行使用メモリ 6,384 KB
最終ジャッジ日時 2023-10-20 03:23:42
合計ジャッジ時間 3,579 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,348 KB
testcase_12 WA -
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 WA -
testcase_17 AC 15 ms
5,592 KB
testcase_18 WA -
testcase_19 AC 14 ms
5,328 KB
testcase_20 WA -
testcase_21 AC 12 ms
5,064 KB
testcase_22 WA -
testcase_23 AC 18 ms
5,856 KB
testcase_24 WA -
testcase_25 AC 13 ms
5,064 KB
testcase_26 WA -
testcase_27 AC 20 ms
6,384 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n;
  cin>>n;
  vector<ll> A(n+1),B(n+2);
  rep(i,n) cin>>A[i+1];
  for(int i=n;i>=1;i--){
    if(A[i]>i){
      cout<<"No"<<endl;
      return 0;
    }
    if(A[i]) B[i]=B[i+1]+1;
    else B[i]=B[i+1];
  }
  for(int i=2;i<=n;i++){
    if((A[i]+B[i+1])%i!=0){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
   
  return 0;
}
0