結果
| 問題 | No.1242 高橋君とすごろく |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-02 22:51:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 566 bytes |
| 記録 | |
| コンパイル時間 | 206 ms |
| コンパイル使用メモリ | 82,764 KB |
| 実行使用メモリ | 83,088 KB |
| 最終ジャッジ日時 | 2024-07-17 22:51:40 |
| 合計ジャッジ時間 | 4,277 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 TLE * 1 -- * 17 |
ソースコード
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
from bisect import *
def binary_search(A,p):
if A[0]<=p and p<=A[-1]:
if p == A[bisect_left(A,p)]:
return True
return False
while A:
a = A.pop()
if a==1:
print('No')
break
lis = []
while A:
b = A.pop()
lis.append(b)
if a-b>5:
break
if (a-b)%2==1:
p = b-(3-(a-b)//2)
if p>=1:
insort(A,p)
for l in lis:
if len(A)==0:
A.append(l)
elif not binary_search(A,l):
insort(A,l)
else:
print('Yes')