結果
| 問題 | No.1219 Mancala Combo |
| コンテスト | |
| ユーザー |
IKyopro
|
| 提出日時 | 2020-09-04 22:01:26 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 754 bytes |
| 記録 | |
| コンパイル時間 | 1,186 ms |
| コンパイル使用メモリ | 210,832 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-13 09:42:10 |
| 合計ジャッジ時間 | 2,502 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template<class T> bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b){if(a<b) {a = b; return true;} return false;}
#define debug(x) cerr << #x << " = " << (x) << endl;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
vec<ll> A(N+1);
for(int i=1;i<=N;i++){
cin >> A[i];
}
ll s = 0;
for(int i=N;i>=1;i--){
if(A[i]+s==0) continue;
if((A[i]+s)%i!=0){
cout << "No\n";
return 0;
}
s += (A[i]+s)/i;
}
cout << "Yes\n";
}
IKyopro