結果

問題 No.2402 Dirty Stairs and Shoes
ユーザー pengin_2000pengin_2000
提出日時 2023-08-05 03:26:46
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 699 bytes
コンパイル時間 1,171 ms
コンパイル使用メモリ 29,292 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-23 01:45:22
合計ジャッジ時間 2,459 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 12 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 17 ms
4,376 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 5 ms
4,380 KB
testcase_10 AC 10 ms
4,380 KB
testcase_11 AC 6 ms
4,376 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 3 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 3 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 0 ms
4,376 KB
testcase_34 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int v[200005];
int a[200005], b[200005];
int dp[200005];
int main()
{
	int n, k;
	scanf("%d %d", &n, &k);
	int i, j;
	int m1, m2;
	scanf("%d", &m1);
	for (i = 0; i < m1; i++)
		scanf("%d", &a[i]);
	scanf("%d", &m2);
	for (i = 0; i < m2; i++)
		scanf("%d", &b[i]);
	for (i = 0; i <= n; i++)
		v[i] = 0;
	for (i = 0; i < m1; i++)
		v[a[i]] = 1;
	for (i = 0; i < m2; i++)
		v[b[i]] = -1;
	for (i = 0; i <= n; i++)
		dp[i] = 1;
	dp[0] = 0;
	for (i = 0; i < n; i++)
	{
		if (v[i] > 0)
			dp[i] = 1;
		if (v[i] < 0)
			dp[i] = 0;
		if (dp[i] > 0)
			continue;
		dp[i + 1] = 0;
		if (i + k <= n)
			dp[i + k] = 0;
	}
	if (dp[n] > 0)
		printf("No\n");
	else
		printf("Yes\n");
	return 0;
}
0