結果
| 問題 | No.1242 高橋君とすごろく |
| コンテスト | |
| ユーザー |
anagohirame
|
| 提出日時 | 2020-10-02 22:07:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 82,116 KB |
| 実行使用メモリ | 60,480 KB |
| 最終ジャッジ日時 | 2024-07-17 13:33:33 |
| 合計ジャッジ時間 | 4,183 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 TLE * 1 -- * 17 |
ソースコード
import sys
from heapq import heappush, heappop
n, k = map(int, input().split())
a = list(map(int, input().split()))
q = []
for x in a:
heappush(q, -x)
while q:
l = -heappop(q)
if l == 1:
print("No")
sys.exit()
ret = []
for _ in range(3):
if not q:
continue
m = -heappop(q)
ret.append(-m)
if l - m in {1, 3, 5}:
p = (l+m)//2 - 3
if p > 0:
heappush(q, -p)
for r in ret:
heappush(q, r)
print("Yes")
anagohirame