結果
問題 |
No.1242 高橋君とすごろく
|
ユーザー |
|
提出日時 | 2020-10-03 03:32:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 826 bytes |
コンパイル時間 | 2,098 ms |
コンパイル使用メモリ | 200,232 KB |
最終ジャッジ日時 | 2025-01-15 01:46:11 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 TLE * 3 |
other | AC * 10 TLE * 14 |
ソースコード
#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()){ f=true; v.push_back(p-u+7-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"); }