結果

問題 No.1219 Mancala Combo
ユーザー warabi0906warabi0906
提出日時 2023-02-07 17:01:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 1,390 bytes
コンパイル時間 4,833 ms
コンパイル使用メモリ 226,404 KB
実行使用メモリ 4,672 KB
最終ジャッジ日時 2023-09-18 23:49:40
合計ジャッジ時間 7,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,384 KB
testcase_09 AC 2 ms
4,388 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,384 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 35 ms
4,384 KB
testcase_18 AC 41 ms
4,380 KB
testcase_19 AC 31 ms
4,380 KB
testcase_20 AC 42 ms
4,380 KB
testcase_21 AC 26 ms
4,380 KB
testcase_22 AC 37 ms
4,380 KB
testcase_23 AC 42 ms
4,392 KB
testcase_24 AC 31 ms
4,384 KB
testcase_25 AC 30 ms
4,384 KB
testcase_26 AC 40 ms
4,384 KB
testcase_27 AC 48 ms
4,672 KB
testcase_28 AC 58 ms
4,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include "atcoder/all"
#define debug cout << "OK" << endl;
template<typename T>
inline bool chmax(T& a, const T b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
inline bool chmin(T& a, const T b) { if (a > b) { a = b; return true; } return false; }
inline int Code(char c) {
	if ('A' <= c and c <= 'Z')return (int)(c - 'A');
	if ('a' <= c and c <= 'z')return (int)(c - 'a');
	if ('0' <= c and c <= '9')return (int)(c - '0');
	assert(false);
}
using namespace std;
using namespace atcoder;
#define int long long
constexpr int MOD = 998244353;
constexpr int INF = (1LL << 62);
using minit = modint998244353;

template<typename T>
ostream& operator << (ostream& st, const vector<T> &v) {
	for (const T value : v) {
		st << value << " ";
	}
	return st;
}
template<typename T>
istream& operator >> (istream& st, vector<T>& v) {
	for (T &value : v) {
		st >> value;
	}
	return st;
}

//

//

void solve() {
	int N;
	cin >> N;
	vector<int> A(N);
	cin >> A;

	int sum = 0;
	for (int i = N - 1; 0 <= i; i--) {
		if (i + 1 < A[i] or (A[i] + sum) % (i + 1)) {
			cout << "No" << endl;
			return;
		}
		sum += (A[i] + sum) / (i + 1);
	}
	cout << "Yes" << endl;
	return;
}
signed main() {
	int T = 1;
	// cin >> T;
	for (int i = 0; i < T; i++)
		solve();
	return 0;
}

/*
* わらびのコードこーどすぺーす
 (σ・∀・)σゲッツ!!
*/
0