結果

問題 No.1219 Mancala Combo
ユーザー uni_pythonuni_python
提出日時 2020-09-05 16:17:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 956 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 102,400 KB
最終ジャッジ日時 2024-05-06 13:49:54
合計ジャッジ時間 3,852 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,840 KB
testcase_01 AC 41 ms
52,096 KB
testcase_02 AC 41 ms
51,840 KB
testcase_03 AC 42 ms
51,840 KB
testcase_04 AC 42 ms
52,352 KB
testcase_05 AC 44 ms
52,480 KB
testcase_06 AC 43 ms
51,712 KB
testcase_07 AC 44 ms
52,480 KB
testcase_08 AC 43 ms
51,968 KB
testcase_09 AC 44 ms
51,712 KB
testcase_10 AC 43 ms
51,968 KB
testcase_11 AC 42 ms
52,096 KB
testcase_12 AC 43 ms
52,096 KB
testcase_13 AC 41 ms
52,096 KB
testcase_14 AC 38 ms
51,944 KB
testcase_15 AC 38 ms
51,968 KB
testcase_16 AC 37 ms
52,096 KB
testcase_17 AC 67 ms
87,680 KB
testcase_18 AC 71 ms
89,216 KB
testcase_19 AC 66 ms
84,352 KB
testcase_20 AC 75 ms
92,160 KB
testcase_21 AC 61 ms
81,408 KB
testcase_22 AC 69 ms
86,144 KB
testcase_23 AC 76 ms
95,488 KB
testcase_24 AC 75 ms
82,432 KB
testcase_25 AC 68 ms
84,480 KB
testcase_26 AC 72 ms
88,832 KB
testcase_27 AC 80 ms
100,224 KB
testcase_28 AC 86 ms
102,400 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