結果
| 問題 |
No.1242 高橋君とすごろく
|
| コンテスト | |
| ユーザー |
nagiss
|
| 提出日時 | 2020-10-02 21:57:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 599 bytes |
| コンパイル時間 | 107 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 17,820 KB |
| 最終ジャッジ日時 | 2024-07-17 13:08:00 |
| 合計ジャッジ時間 | 4,067 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 TLE * 1 -- * 17 |
ソースコード
from heapq import heappop, heappush
N, K = map(int, input().split())
A = list(map(int, input().split()))
q = [-a for a in A[::-1]]
st = set(q)
cl = []
while 0 < len(q) <= 1000:
a = heappop(q)
if a == -1:
print("No")
exit()
elif a > -1:
print("Yes")
exit()
p = []
for a2 in q + cl:
if abs(a2-a) in [1, 3, 5]:
a3 = ((a2+a)//2)+4
if a < a3 and a3 not in st:
p.append(a3)
st.add(a3)
for a2 in p:
heappush(q, a2)
cl.append(a)
if q:
print("No")
else:
print("Yes")
nagiss