結果
| 問題 |
No.1219 Mancala Combo
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-05 00:10:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 2,000 ms |
| コード長 | 331 bytes |
| コンパイル時間 | 188 ms |
| コンパイル使用メモリ | 82,164 KB |
| 実行使用メモリ | 119,936 KB |
| 最終ジャッジ日時 | 2024-11-26 21:13:19 |
| 合計ジャッジ時間 | 2,955 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
from itertools import dropwhile,accumulate
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()
b=list(accumulate(a[::-1]))
for i in range(n):
if b[i]%(n-i)!=0:
print("No")
break
else:
print("Yes")