結果

問題 No.1219 Mancala Combo
ユーザー seven_threeseven_three
提出日時 2020-09-04 21:50:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 717 ms
コンパイル使用メモリ 91,112 KB
実行使用メモリ 5,032 KB
最終ジャッジ日時 2023-08-17 15:30:23
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int sum[200020] = { 0 };
int a[200020];
int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	for (int i = n; i > 0; i--) {
		if (a[i] != 0) {
			sum[i]++;
			sum[i] += sum[i + 1];
		}
	}
	for (int i = 1; i <= n; i++) {
		if ((sum[i + 1] + a[i]) % i != 0) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}
0