結果
問題 |
No.1242 高橋君とすごろく
|
ユーザー |
|
提出日時 | 2020-10-03 12:16:53 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 651 bytes |
コンパイル時間 | 141 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 67,580 KB |
最終ジャッジ日時 | 2024-07-18 04:17:53 |
合計ジャッジ時間 | 2,218 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 2 |
other | AC * 13 WA * 1 RE * 10 |
ソースコード
n,k=map(int,input().split()) a=list(map(int,input().split())) b=set(a) for i in range(k-1,-1,-1): if a[i]<=8: break else: if a[i]+1 in b: print("No") exit() if a[i]+3 in b: print("No") exit() if a[i]+5 in b: print("No") exit() for j in range(8,0,-1): if j in b: if j+1 in b: if j-3>=1: b.add(j-3) if j+3 in b: if j-2>=1: b.add(j-2) if j+5 in b: if j-1>=1: b.add(j-1) if 1 in b: print("No") exit() print("Yes") print(dp)