結果

問題 No.1219 Mancala Combo
ユーザー stnkienstnkien
提出日時 2020-09-04 22:37:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 30,584 KB
最終ジャッジ日時 2024-05-05 00:15:12
合計ジャッジ時間 2,853 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 26 ms
10,752 KB
testcase_06 WA -
testcase_07 AC 26 ms
10,752 KB
testcase_08 WA -
testcase_09 AC 25 ms
10,752 KB
testcase_10 WA -
testcase_11 AC 25 ms
10,880 KB
testcase_12 WA -
testcase_13 AC 28 ms
10,880 KB
testcase_14 AC 24 ms
10,752 KB
testcase_15 AC 26 ms
10,752 KB
testcase_16 WA -
testcase_17 AC 112 ms
22,644 KB
testcase_18 WA -
testcase_19 AC 100 ms
21,408 KB
testcase_20 WA -
testcase_21 AC 93 ms
20,592 KB
testcase_22 WA -
testcase_23 AC 132 ms
26,148 KB
testcase_24 WA -
testcase_25 AC 101 ms
20,832 KB
testcase_26 WA -
testcase_27 AC 151 ms
27,424 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
N = int(input())
*A, = map(int, input().split())
last = 0
for i, a in enumerate(A):
    if a:
        last = i
A = A[:last+1]

C = list(accumulate([1 if a else 0 for i, a in enumerate(A)][::-1]))[::-1]
C = C[1:]+[0]

if all(a <= (i+1) and (a+c) % (i+1) == 0 for i, (a, c) in enumerate(zip(A, C))):
    print('Yes')
else:
    print('No')
0