結果

問題 No.1219 Mancala Combo
ユーザー FromBooskaFromBooska
提出日時 2023-10-16 13:18:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 107,012 KB
最終ジャッジ日時 2023-10-16 13:18:22
合計ジャッジ時間 4,458 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,400 KB
testcase_01 AC 69 ms
71,284 KB
testcase_02 AC 68 ms
71,228 KB
testcase_03 AC 67 ms
71,096 KB
testcase_04 WA -
testcase_05 AC 68 ms
71,260 KB
testcase_06 WA -
testcase_07 AC 68 ms
71,512 KB
testcase_08 WA -
testcase_09 AC 68 ms
71,088 KB
testcase_10 WA -
testcase_11 AC 68 ms
71,320 KB
testcase_12 WA -
testcase_13 AC 69 ms
71,200 KB
testcase_14 AC 70 ms
71,344 KB
testcase_15 AC 69 ms
71,348 KB
testcase_16 WA -
testcase_17 AC 101 ms
96,800 KB
testcase_18 WA -
testcase_19 AC 101 ms
94,176 KB
testcase_20 WA -
testcase_21 AC 94 ms
91,748 KB
testcase_22 WA -
testcase_23 AC 109 ms
102,676 KB
testcase_24 WA -
testcase_25 AC 98 ms
94,084 KB
testcase_26 WA -
testcase_27 AC 111 ms
106,244 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] > i+1 or (A[i]+cumu)%(i+1)!=0:
        ans = 'No'
    cumu += 1
    #print('ans', ans, 'cumu', cumu)
print(ans)
0