結果

問題 No.1219 Mancala Combo
ユーザー daikisuyamadaikisuyama
提出日時 2020-09-05 08:07:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 1,259 ms
コンパイル使用メモリ 86,804 KB
実行使用メモリ 113,916 KB
最終ジャッジ日時 2023-08-18 10:20:48
合計ジャッジ時間 5,176 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,164 KB
testcase_01 AC 71 ms
71,152 KB
testcase_02 AC 72 ms
71,040 KB
testcase_03 AC 71 ms
71,128 KB
testcase_04 AC 72 ms
71,128 KB
testcase_05 AC 73 ms
71,152 KB
testcase_06 AC 70 ms
71,320 KB
testcase_07 AC 70 ms
70,924 KB
testcase_08 AC 70 ms
71,444 KB
testcase_09 AC 72 ms
71,252 KB
testcase_10 AC 70 ms
71,380 KB
testcase_11 AC 70 ms
71,036 KB
testcase_12 AC 71 ms
71,368 KB
testcase_13 AC 74 ms
71,124 KB
testcase_14 AC 71 ms
71,268 KB
testcase_15 AC 72 ms
71,032 KB
testcase_16 AC 73 ms
71,308 KB
testcase_17 AC 121 ms
108,308 KB
testcase_18 AC 124 ms
108,144 KB
testcase_19 AC 115 ms
104,384 KB
testcase_20 AC 129 ms
112,140 KB
testcase_21 AC 105 ms
100,436 KB
testcase_22 AC 120 ms
104,472 KB
testcase_23 AC 126 ms
113,916 KB
testcase_24 AC 111 ms
100,404 KB
testcase_25 AC 111 ms
103,444 KB
testcase_26 AC 124 ms
108,208 KB
testcase_27 AC 127 ms
112,544 KB
testcase_28 AC 137 ms
109,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0