結果
問題 | No.1219 Mancala Combo |
ユーザー |
![]() |
提出日時 | 2020-09-04 23:25:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 61 ms / 2,000 ms |
コード長 | 697 bytes |
コンパイル時間 | 1,459 ms |
コンパイル使用メモリ | 167,796 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 21:04:01 |
合計ジャッジ時間 | 2,906 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#define _USE_MATH_DEFINES#include <bits/stdc++.h>using namespace std;//template#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)#define ALL(v) (v).begin(),(v).end()typedef long long int ll;const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}//endint main(){int n; cin>>n;vector<int> a(n);rep(i,0,n)cin>>a[i];ll add=0;for(int i=n-1;i>=0;i--){if((add+a[i])%(i+1)!=0){puts("No"); return 0;}add+=a[i];}puts("Yes");return 0;}