結果
問題 |
No.1219 Mancala Combo
|
ユーザー |
|
提出日時 | 2020-09-05 08:07:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 106 ms / 2,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 268 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 119,324 KB |
最終ジャッジ日時 | 2024-11-27 14:28:47 |
合計ジャッジ時間 | 3,058 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
from itertools import dropwhile n=int(input()) a=list(dropwhile(lambda x:x==0,list(map(int,input().split()))[::-1]))[::-1] n=len(a) if any(a[i]>i+1 for i in range(n)): print("No") exit() c=0 for i in range(n-1,-1,-1): if (c+a[i])%(i+1)!=0: print("No") break c+=(c+a[i])//(i+1) else: print("Yes")