結果

問題 No.1219 Mancala Combo
ユーザー iqueue02iqueue02
提出日時 2020-09-04 21:45:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 2,086 ms
コンパイル使用メモリ 202,092 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 22:01:13
合計ジャッジ時間 3,146 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 WA -
testcase_17 AC 34 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 32 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 27 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 43 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 29 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 48 ms
5,376 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  int ok = 1;
  ll add = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (!a[i]) continue;
    if (a[i] <= i + 1 && (a[i] + add) % (i + 1) == 0) add += (a[i] + add) / (i + 1);
    else ok = 0;
  }

  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
0