結果

問題 No.1219 Mancala Combo
ユーザー ldsybldsyb
提出日時 2020-09-04 22:11:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 552 bytes
コンパイル時間 1,981 ms
コンパイル使用メモリ 199,824 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-08-17 15:46:49
合計ジャッジ時間 6,060 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> as(n + 1, 0);
	for (int64_t i = 1; i <= n; i++)
	{
		cin >> as[i];
	}

	int64_t sum = accumulate(as.begin(), as.end(), int64_t(0));

	while (as[0] != sum)
	{
		bool f = true;
		for (int64_t i = 1; i <= n; i++)
		{
			if (as[i] == i)
			{
				f = false;
				as[i] = 0;
				for (int64_t j = i - 1; 0 <= j; j--)
				{
					as[j]++;
				}
				break;
			}
		}

		if (f)
		{
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}
0