結果

問題 No.1219 Mancala Combo
ユーザー c-yanc-yan
提出日時 2020-09-04 21:54:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 353 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 24,368 KB
最終ジャッジ日時 2023-08-17 15:33:50
合計ジャッジ時間 4,447 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,348 KB
testcase_01 AC 15 ms
7,956 KB
testcase_02 AC 15 ms
8,076 KB
testcase_03 AC 15 ms
7,956 KB
testcase_04 AC 48 ms
8,064 KB
testcase_05 AC 30 ms
8,028 KB
testcase_06 AC 20 ms
8,032 KB
testcase_07 AC 29 ms
8,072 KB
testcase_08 AC 29 ms
8,008 KB
testcase_09 AC 16 ms
8,080 KB
testcase_10 AC 16 ms
7,960 KB
testcase_11 AC 24 ms
8,004 KB
testcase_12 AC 17 ms
8,148 KB
testcase_13 AC 20 ms
8,120 KB
testcase_14 AC 15 ms
8,032 KB
testcase_15 AC 16 ms
7,932 KB
testcase_16 AC 15 ms
8,092 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop, heappush

N, *A = map(int, open(0).read().split())

q = []
for i in range(N):
    if A[i] == i + 1:
        heappush(q, i)

while q:
    i = heappop(q)
    A[i] = 0
    for j in range(i):
        A[j] += 1
        if A[j] == j + 1:
            heappush(q, j)

if all(a == 0 for a in A):
    print('Yes')
else:
    print('No')
0