結果
問題 |
No.1242 高橋君とすごろく
|
ユーザー |
![]() |
提出日時 | 2020-10-02 21:42:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,183 bytes |
コンパイル時間 | 1,774 ms |
コンパイル使用メモリ | 171,728 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 02:42:25 |
合計ジャッジ時間 | 2,373 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; //#define int long long #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair #define endl '\n' #define vec vector<ll> #define mat vector<vector<ll> > #define fi first #define se second typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> pll; typedef long double ld; typedef complex<double> comp; const ll INF=1e9+7; const ll inf=INF; const ll MOD=998244353; const ll mod=MOD; const int MAX=200010; signed main(){ ll n,k;cin>>n>>k; set<ll>st; rep(i,k){ ll b;cin>>b; st.insert(b); } bool f=1; for(auto e:st){ if(st.find(e+5)!=st.end()){ if(e>=10)f=0; else { if(e==2||e==5||e==7||e==8)f=0; } } if(st.find(e+3)!=st.end()){ if(e>=6)f=0; else if(e==3||e==4)f=0; } if(st.find(e+1)!=st.end()){ if(e>=9)f=0; else if(e==4||e==6||e==7)f=0; } } if(f)cout<<"Yes"<<endl; else cout<<"No"<<endl; }