結果

問題 No.1242 高橋君とすごろく
ユーザー anagohirameanagohirame
提出日時 2020-10-02 22:09:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 488 bytes
コンパイル時間 1,826 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 248,984 KB
最終ジャッジ日時 2023-09-24 20:44:02
合計ジャッジ時間 5,292 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,624 KB
testcase_01 AC 77 ms
71,196 KB
testcase_02 AC 77 ms
71,348 KB
testcase_03 AC 78 ms
71,520 KB
testcase_04 AC 79 ms
71,432 KB
testcase_05 AC 78 ms
71,508 KB
testcase_06 AC 78 ms
71,328 KB
testcase_07 AC 77 ms
71,312 KB
testcase_08 AC 76 ms
71,500 KB
testcase_09 AC 77 ms
71,292 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 = []
used = set()
for x in a:
	heappush(q, -x)
	used.add(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 not in used and p > 0:
				heappush(q, -p)
				used.add(p)
	for r in ret:
		heappush(q, r)
print("Yes")
0