結果
問題 |
No.1219 Mancala Combo
|
ユーザー |
|
提出日時 | 2020-09-04 23:38:15 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 621 bytes |
コンパイル時間 | 1,774 ms |
コンパイル使用メモリ | 140,108 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 21:07:46 |
合計ジャッジ時間 | 3,378 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 10 |
ソースコード
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } int tmp = 0; bool ok = true; for(int i = n - 1; i >= 0; i--) { if((a[i] + tmp) % (i + 1) != 0) { ok = false; } if(a[i] > 0) { tmp += (a[i] + tmp) / (i + 1); } } ok ? (cout << "Yes\n") : (cout << "No\n"); return 0; }