結果

問題 No.1242 高橋君とすごろく
ユーザー anagohirameanagohirame
提出日時 2020-10-02 22:07:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 428 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-09-24 12:38:32
合計ジャッジ時間 4,808 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,480 KB
testcase_01 AC 69 ms
71,088 KB
testcase_02 AC 69 ms
71,504 KB
testcase_03 AC 68 ms
71,236 KB
testcase_04 AC 67 ms
71,620 KB
testcase_05 AC 68 ms
71,324 KB
testcase_06 AC 68 ms
71,476 KB
testcase_07 AC 70 ms
71,296 KB
testcase_08 AC 69 ms
71,376 KB
testcase_09 AC 71 ms
71,288 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0