結果

問題 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
コンパイル時間 108 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 31,100 KB
最終ジャッジ日時 2023-08-17 17:33:36
合計ジャッジ時間 2,844 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,296 KB
testcase_01 AC 16 ms
8,152 KB
testcase_02 AC 16 ms
8,180 KB
testcase_03 AC 16 ms
8,276 KB
testcase_04 WA -
testcase_05 AC 15 ms
8,352 KB
testcase_06 WA -
testcase_07 AC 16 ms
8,288 KB
testcase_08 WA -
testcase_09 AC 15 ms
8,148 KB
testcase_10 WA -
testcase_11 AC 15 ms
8,224 KB
testcase_12 WA -
testcase_13 AC 15 ms
8,232 KB
testcase_14 AC 15 ms
8,148 KB
testcase_15 AC 15 ms
8,216 KB
testcase_16 WA -
testcase_17 AC 96 ms
20,100 KB
testcase_18 WA -
testcase_19 AC 86 ms
18,820 KB
testcase_20 WA -
testcase_21 AC 76 ms
17,736 KB
testcase_22 WA -
testcase_23 AC 114 ms
23,720 KB
testcase_24 WA -
testcase_25 AC 84 ms
18,320 KB
testcase_26 WA -
testcase_27 AC 129 ms
25,028 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