結果
| 問題 |
No.1219 Mancala Combo
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-04 21:31:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 554 bytes |
| コンパイル時間 | 626 ms |
| コンパイル使用メモリ | 73,316 KB |
| 最終ジャッジ日時 | 2025-01-14 05:09:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <iostream>
#include <vector>
using lint = long long;
void solve() {
int n;
std::cin >> n;
std::vector<lint> xs(n);
for (auto& x : xs) std::cin >> x;
xs.insert(xs.begin(), 0);
lint sum = 0;
for (int p = n; p >= 1; --p) {
if (xs[p] > p || (xs[p] + sum) % p != 0) {
std::cout << "No\n";
return;
}
sum += (xs[p] + sum) / p;
}
std::cout << "Yes\n";
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}