結果
| 問題 |
No.1219 Mancala Combo
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-19 13:38:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 352 bytes |
| コンパイル時間 | 651 ms |
| コンパイル使用メモリ | 81,916 KB |
| 実行使用メモリ | 107,120 KB |
| 最終ジャッジ日時 | 2024-11-18 08:17:49 |
| 合計ジャッジ時間 | 3,515 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
def main1(n,a):
a=[0]+a
cnt=0
for i in reversed(range(1,n+1)):
if a[i]>i:return False
if a[i]==0 and cnt==0:continue
if (a[i]+cnt)%i==0:
cnt+=(a[i]+cnt)//i
else:
return False
return True
if __name__=='__main__':
n=int(input())
a=list(map(int,input().split()))
ret1=main1(n,a)
print('Yes' if ret1 else 'No')