結果
問題 | No.1219 Mancala Combo |
ユーザー |
|
提出日時 | 2024-05-24 09:44:37 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 476 bytes |
コンパイル時間 | 2,598 ms |
コンパイル使用メモリ | 202,888 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-20 19:16:10 |
合計ジャッジ時間 | 4,418 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h>#define INF 1000000001#define MOD 1000000007#define long long long#define all(x) x.begin(),x.end()using namespace std;int main(){ios_base::sync_with_stdio(0);cin.tie(0);int n;cin >> n;vector<int> arr(n);for(int i = 0; i<n; i++)cin >> arr[i];long cnt = 0;for(int i = n-1; i>=0; i--){long v = arr[i]+cnt;if(v%(i+1)){cout << "No\n";return 0;}cnt+=v/(i+1);}cout << "Yes\n";return 0;}