結果

問題 No.1242 高橋君とすごろく
ユーザー kotatsugamekotatsugame
提出日時 2020-10-02 21:40:58
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 624 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 65,484 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-27 08:36:38
合計ジャッジ時間 1,477 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#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;
}
0