結果
| 問題 |
No.1242 高橋君とすごろく
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-03 03:35:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 2,000 ms |
| コード長 | 849 bytes |
| コンパイル時間 | 1,969 ms |
| コンパイル使用メモリ | 201,640 KB |
| 最終ジャッジ日時 | 2025-01-15 01:47:31 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n; cin >> n;
int k; cin >> k;
set<ll> st;
for(int i=0;i<k;i++){
ll a; cin >> a;
st.insert(a);
}
bool ok=true;
while(1){
bool f=false;
vector<ll> v;
if(st.find(1)!=st.end()){
ok=false; break;
}
for(ll p:st){
for(int u=1;u<=3;u++){
if(p>u and st.find(p-u+7-u)!=st.end() and st.find(p-u)==st.end()){
f=true;
v.push_back(p-u);
}
}
}
for(ll vv:v)st.insert(vv);
for(ll p:st){
if(p>8){
bool ff=true;
for(int i=0;i<6;i++){
if(st.find(p+i)==st.end()){
ff=false;
break;
}
}
if(ff){
ok=false;
f=false;
}
}
}
if(!f)break;
}
if(ok)printf("Yes\n");
else printf("No\n");
}