結果
問題 | No.1219 Mancala Combo |
ユーザー |
![]() |
提出日時 | 2020-09-04 21:46:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 1,635 ms |
コンパイル使用メモリ | 194,864 KB |
最終ジャッジ日時 | 2025-01-14 05:28:53 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#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] <= i + 1 && (a[i] + add) % (i + 1) == 0) add += (a[i] + add) / (i + 1); else ok = 0; } cout << (ok ? "Yes" : "No") << endl; return 0; }