結果

問題 No.1219 Mancala Combo
ユーザー iqueue02iqueue02
提出日時 2020-09-04 21:45:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 1,858 ms
コンパイル使用メモリ 199,684 KB
実行使用メモリ 4,632 KB
最終ジャッジ日時 2023-08-17 15:21:22
合計ジャッジ時間 3,465 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,500 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 36 ms
4,380 KB
testcase_18 WA -
testcase_19 AC 32 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 28 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 44 ms
4,380 KB
testcase_24 WA -
testcase_25 AC 31 ms
4,380 KB
testcase_26 WA -
testcase_27 AC 51 ms
4,628 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