結果

問題 No.1219 Mancala Combo
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-09-04 21:34:45
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 105,692 KB
最終ジャッジ日時 2023-08-17 15:06:51
合計ジャッジ時間 3,898 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,068 KB
testcase_01 AC 70 ms
71,292 KB
testcase_02 AC 69 ms
71,264 KB
testcase_03 AC 69 ms
71,168 KB
testcase_04 AC 70 ms
71,248 KB
testcase_05 AC 68 ms
71,484 KB
testcase_06 AC 68 ms
71,216 KB
testcase_07 AC 69 ms
71,276 KB
testcase_08 AC 67 ms
71,436 KB
testcase_09 AC 69 ms
71,336 KB
testcase_10 AC 70 ms
71,336 KB
testcase_11 AC 69 ms
71,496 KB
testcase_12 AC 71 ms
71,360 KB
testcase_13 AC 70 ms
71,340 KB
testcase_14 AC 68 ms
71,240 KB
testcase_15 AC 67 ms
71,296 KB
testcase_16 AC 68 ms
71,444 KB
testcase_17 AC 94 ms
95,104 KB
testcase_18 AC 101 ms
96,156 KB
testcase_19 AC 92 ms
92,648 KB
testcase_20 AC 104 ms
98,832 KB
testcase_21 AC 89 ms
90,656 KB
testcase_22 AC 97 ms
93,932 KB
testcase_23 AC 102 ms
100,904 KB
testcase_24 AC 94 ms
91,588 KB
testcase_25 AC 90 ms
92,880 KB
testcase_26 AC 99 ms
96,304 KB
testcase_27 AC 106 ms
104,508 KB
testcase_28 AC 115 ms
105,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

i個だけあるマスのうち
左端を選ばなくてはならない
右端から0このマスを除く
i個になるたびに選ばれるので、
右端から見て行って、あまりが0ならおk

"""

from sys import stdin
import sys

N = int(stdin.readline())
a = list(map(int,stdin.readline().split()))

nsum = 0
for i in range(N,0,-1):

    if (nsum + a[i-1]) % i != 0:
        print ("No")
        sys.exit()

    nsum += (nsum + a[i-1]) // i

print ("Yes")
    
0