結果
| 問題 |
No.1242 高橋君とすごろく
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2020-10-02 21:30:15 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 2,000 ms |
| コード長 | 580 bytes |
| コンパイル時間 | 117 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-20 02:41:36 |
| 合計ジャッジ時間 | 2,698 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 |
ソースコード
import sys
input = sys.stdin.readline
N,K=map(int,input().split())
A=list(map(int,input().split()))
NG=set(A)
for a in A[::-1]:
for j in range(a,a-1001,-1):
if j<1:
continue
if (j+1 in NG and j+6 in NG) or (j+2 in NG and j+5 in NG) or (j+3 in NG and j+4 in NG):
NG.add(j)
if 1 in NG:
print("No")
sys.exit()
if j in NG and j+1 in NG and j+2 in NG and j+3 in NG and j+4 in NG and j+5 in NG and j+6 in NG:
print("No")
sys.exit()
else:
print("Yes")
titia