結果

問題 No.1219 Mancala Combo
ユーザー FromBooska
提出日時 2023-04-19 18:46:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 103,680 KB
最終ジャッジ日時 2024-10-14 20:35:56
合計ジャッジ時間 3,595 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

# たとえば3のところにある数と、3超でnum=iの個数、の合計が3の倍数であれば消せる
# それがすべての数で満たされるか

N = int(input())
A = [0]+list(map(int, input().split()))

excess_test = False
for i in range(N, 0, -1):
    if A[i] > i:
        excess_test = True
if excess_test == True:
    print('No')
    exit()

multiple_test = True
exact = 0
for i in range(N, 0, -1):
    if (A[i]+exact)%i == 0:
        exact += (A[i]+exact)//i
    else:
        multiple_test = False
if multiple_test == True:
    print('Yes')
else:
    print('No')




0