結果
| 問題 |
No.1242 高橋君とすごろく
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-02 21:40:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 624 bytes |
| コンパイル時間 | 524 ms |
| コンパイル使用メモリ | 66,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-20 02:42:03 |
| 合計ジャッジ時間 | 1,452 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
long N;
int K;
long A[101];
bool ng[110];
main()
{
cin>>N>>K;
for(int i=0;i<K;i++)
{
cin>>A[i];
if(A[i]<100)ng[A[i]]=true;
}
for(int k=100;--k;)
{
bool now=false;
for(int i=1;i<=3;i++)now=now||ng[k+i]&&ng[k+7-i];
ng[k]=now;
}
bool out=ng[1];
for(int i=0;i<K;i++)for(int j=i+1;j<K;j++)
{
long a=A[i],b=A[j];
if(b-a==5)
{
long t=a-1;
b=a;
a=t;
if(t==1)out=true;
}
if(b-a==1)
{
long t=a-3;
b=a;
a=t;
if(t==1)out=true;
}
if(a<1)continue;
if(b-a==3)
{
if(a>=6||a==4||a==3)out=true;
}
}
cout<<(out?"No":"Yes")<<endl;
}