結果

問題 No.1219 Mancala Combo
ユーザー FromBooskaFromBooska
提出日時 2023-10-16 13:16:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 670 bytes
コンパイル時間 2,600 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 106,896 KB
最終ジャッジ日時 2023-10-16 13:16:20
合計ジャッジ時間 6,414 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,436 KB
testcase_01 AC 67 ms
71,336 KB
testcase_02 AC 66 ms
71,328 KB
testcase_03 AC 67 ms
71,244 KB
testcase_04 WA -
testcase_05 AC 69 ms
71,400 KB
testcase_06 WA -
testcase_07 AC 68 ms
71,064 KB
testcase_08 WA -
testcase_09 AC 66 ms
71,276 KB
testcase_10 WA -
testcase_11 AC 66 ms
71,064 KB
testcase_12 WA -
testcase_13 AC 66 ms
71,240 KB
testcase_14 AC 66 ms
71,240 KB
testcase_15 AC 66 ms
71,064 KB
testcase_16 WA -
testcase_17 AC 112 ms
96,500 KB
testcase_18 WA -
testcase_19 AC 93 ms
94,268 KB
testcase_20 WA -
testcase_21 AC 123 ms
91,596 KB
testcase_22 WA -
testcase_23 AC 104 ms
102,500 KB
testcase_24 WA -
testcase_25 AC 90 ms
93,836 KB
testcase_26 WA -
testcase_27 AC 108 ms
106,084 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 右端の数字に着目
# 右端の数字がインデックスとマッチしていなければアウト
# そこから左に1つずつ動く、右端
# 右端からの歩数分だけの数がそこに降ってくる、そのそきに初期値と降ってくる数の和がそのインデックスの倍数必要か

N = int(input())
A = list(map(int, input().split()))

for i in range(N-1, -1, -1):
    if A[i] == 0:
        A.pop()
    else:
        break
remainder = len(A)
#print(A, remainder)

ans = 'Yes'
cumu = 0
for i in range(remainder-1, -1, -1):
    if (A[i]+cumu)%(i+1)!=0:
        ans = 'No'
    cumu += 1
    #print('ans', ans, 'cumu', cumu)
print(ans)
0