結果

問題 No.1219 Mancala Combo
ユーザー uni_pythonuni_python
提出日時 2020-09-05 16:17:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 956 bytes
コンパイル時間 978 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 106,808 KB
最終ジャッジ日時 2023-08-19 06:37:34
合計ジャッジ時間 5,732 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,248 KB
testcase_01 AC 65 ms
71,260 KB
testcase_02 AC 62 ms
71,168 KB
testcase_03 AC 62 ms
71,196 KB
testcase_04 AC 61 ms
71,208 KB
testcase_05 AC 66 ms
71,232 KB
testcase_06 AC 63 ms
71,248 KB
testcase_07 AC 63 ms
70,848 KB
testcase_08 AC 62 ms
71,120 KB
testcase_09 AC 63 ms
70,968 KB
testcase_10 AC 63 ms
70,968 KB
testcase_11 AC 64 ms
70,964 KB
testcase_12 AC 63 ms
71,128 KB
testcase_13 AC 63 ms
71,120 KB
testcase_14 AC 60 ms
71,124 KB
testcase_15 AC 60 ms
70,924 KB
testcase_16 AC 64 ms
71,188 KB
testcase_17 AC 102 ms
96,484 KB
testcase_18 AC 93 ms
97,096 KB
testcase_19 AC 90 ms
94,144 KB
testcase_20 AC 98 ms
99,476 KB
testcase_21 AC 85 ms
91,404 KB
testcase_22 AC 90 ms
94,492 KB
testcase_23 AC 95 ms
102,636 KB
testcase_24 AC 88 ms
91,788 KB
testcase_25 AC 87 ms
93,652 KB
testcase_26 AC 96 ms
97,108 KB
testcase_27 AC 100 ms
106,188 KB
testcase_28 AC 106 ms
106,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

"""
右側に影響を与えない,左側から見てできるならやるを繰り返す?
O(N^2)になりそう

各マスには,右側にある「石のあるます」の数だけ石が増えることになる,それがiで割り切れればOK
いや,自分より右のますで2回操作するますがあるかもしれないから違う,右から見て行けばわかるか


"""

def main():
    mod=10**9+7
    N=I()
    A=[0]+LI()
    
    for i in range(N+1):
        if A[i]>i:
            print("No")
            exit()
    
    flag=1
    cnt=0
    for i in range(N,0,-1):
        a=A[i]+cnt
        if a%i==0:
            cnt+=a//i
        else:
            flag=0
            break

        
    if flag==1:
        print("Yes")
    else:
        print("No")
    


main()
0