結果
問題 | No.1219 Mancala Combo |
ユーザー | c-yan |
提出日時 | 2020-09-04 21:54:56 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 353 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 28,060 KB |
最終ジャッジ日時 | 2024-05-04 22:14:14 |
合計ジャッジ時間 | 4,531 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 26 ms
17,696 KB |
testcase_01 | AC | 25 ms
10,752 KB |
testcase_02 | AC | 26 ms
10,752 KB |
testcase_03 | AC | 26 ms
10,752 KB |
testcase_04 | AC | 61 ms
10,752 KB |
testcase_05 | AC | 38 ms
10,752 KB |
testcase_06 | AC | 33 ms
10,752 KB |
testcase_07 | AC | 39 ms
10,752 KB |
testcase_08 | AC | 37 ms
10,752 KB |
testcase_09 | AC | 26 ms
10,752 KB |
testcase_10 | AC | 26 ms
10,880 KB |
testcase_11 | AC | 32 ms
10,752 KB |
testcase_12 | AC | 27 ms
10,880 KB |
testcase_13 | AC | 29 ms
10,880 KB |
testcase_14 | AC | 26 ms
10,752 KB |
testcase_15 | AC | 25 ms
10,880 KB |
testcase_16 | AC | 26 ms
10,880 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 | -- | - |
ソースコード
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')