結果
問題 | No.1242 高橋君とすごろく |
ユーザー |
|
提出日時 | 2020-10-02 22:33:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 427 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 193,404 KB |
最終ジャッジ日時 | 2024-07-17 22:08:39 |
合計ジャッジ時間 | 4,081 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 TLE * 1 -- * 17 |
ソースコード
N, K = map(int, input().split()) A = list(map(int, input().split())) from collections import defaultdict d = defaultdict(lambda: [0]*7) for a in A: d[a][0] = 1 while A: a = A.pop() for i in range(1,7): if a-i<=0: break if d[a-i][0]==1: continue if d[a-i][7-i]==1: d[a-i][0] = 1 A.append(a-i) elif d[a-i][i]==0: d[a-i][i] = 1 if d[1][0]==0: print('Yes') else: print('No')