結果
問題 | No.1242 高橋君とすごろく |
ユーザー |
![]() |
提出日時 | 2020-10-02 22:27:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 798 bytes |
コンパイル時間 | 1,965 ms |
コンパイル使用メモリ | 199,748 KB |
最終ジャッジ日時 | 2025-01-15 00:39:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 7 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;} template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;} ll dx[4]={0,1,-1,0}; ll dy[4]={1,0,0,-1}; signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20); ll n,k; cin>>n>>k; ll a[k]; map<ll,ll> mp; for(int i=0;i<k;i++){ cin>>a[i]; mp[a[i]] = 1; } bool pos = 1; for(int i=0;i<k;i++){ for(int d=1;d<=6;d++){ ll now = a[i] - d; ll nx = now + 7 - d; if(mp.count(nx) && min(a[i],nx)%2)pos=false; } } if(pos)cout << "Yes\n"; else cout << "No\n"; }