結果

問題 No.1219 Mancala Combo
ユーザー umezo
提出日時 2022-08-09 18:28:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 195,216 KB
最終ジャッジ日時 2025-01-30 19:44:14
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 12
権限があれば一括ダウンロードができます

ソースコード

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