結果
問題 | No.1219 Mancala Combo |
ユーザー |
|
提出日時 | 2020-09-04 22:04:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 401 bytes |
コンパイル時間 | 283 ms |
コンパイル使用メモリ | 31,488 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 12:53:35 |
合計ジャッジ時間 | 1,467 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include<cstdio>long long a[200005];int main(){int n;scanf("%d",&n);for(int i = 1; i <= n; i++) scanf("%lld",&a[i]);long long sum = 0;int ok = 1;for(long long i = n; i >= 1; i--){long long cur = sum+a[i];if(cur%i==0){sum += cur/i;}else ok = 0;}if(ok) printf("Yes\n");else printf("No\n");return 0;}