結果
問題 | No.1219 Mancala Combo |
ユーザー |
![]() |
提出日時 | 2020-09-04 23:01:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 54 ms / 2,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 1,632 ms |
コンパイル使用メモリ | 168,224 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 20:55:38 |
合計ジャッジ時間 | 2,800 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h>#include <iostream>#include <ctime>using namespace std;#define _LL long long#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)bool getans(){_LL n; cin >> n;vector<_LL> a(n);rep(i, n) cin >> a[i];_LL sum = 0;for( _LL k = n; k >= 1; k-- ){a[k - 1] += sum;if( a[k - 1] % k != 0 ) return false;sum += a[k - 1] / k;}return true;}int main(){if( getans() ){cout << "Yes" << endl;}else{cout << "No" << endl;}return 0;}