結果
問題 | No.1219 Mancala Combo |
ユーザー |
|
提出日時 | 2020-09-04 23:30:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 62 ms / 2,000 ms |
コード長 | 383 bytes |
コンパイル時間 | 1,868 ms |
コンパイル使用メモリ | 191,768 KB |
最終ジャッジ日時 | 2025-01-14 06:29:15 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)n; i++) using ll = long long; int main(){ ll n; cin >> n; ll a[n+1]; rep(i,n) cin >> a[i+1]; ll c = 0; for(int i = n; i > 0; i--) { if(a[i] > i or (a[i]+c) % i) { cout << "No" << endl; return 0; } c += (a[i]+c)/i; } cout << "Yes" << endl; return 0; }