记录详情

Wrong Answer

foo.c: In function 'main':
foo.c:29:6: warning: variable 'array' set but not used [-Wunused-but-set-variable]
  int array[N][N];
      ^~~~~
foo.c:36:4: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    scanf(" %c",&ch);
    ^~~~~~~~~~~~~~~~
# 状态 耗时 内存占用
#1 Wrong Answer Read {0}, expect {1}. ["No","Yes"] 0ms 256.0 KiB
#2 Accepted 0ms 280.0 KiB
#3 Wrong Answer Read {0}, expect {1}. ["No","Yes"] 1ms 280.0 KiB
#4 Accepted 0ms 280.0 KiB
#5 Wrong Answer Read {0}, expect {1}. ["No","Yes"] 1ms 256.0 KiB

代码

#include<stdio.h>
#define N 10
//# 0 . 1(yes)
int flag=0;
//down right up left
int x[4]={1,0,-1,0};
int y[4]={0,1,0,-1};
//condition 0不能走 1能走 2到 
void dfs(int i,int j,int array[N][N])
{
	if(i==9&&j==9)
	flag=2;
	if(flag==2)
	return;
	array[i][j]=0;
	for(int k=0;k<4;k++)
	{
		if(array[i+x[k]][j+y[k]]==1)
		{
			dfs(i+x[k],j+y[k],array);
			array[i+x[k]][j+y[k]]=1;
		}

	}
	
}
int main()
{
	int array[N][N];
	char ch;
	for(int i=0;i<10;i++)
	{
		for(int j=0;j<10;j++)
		{
			
			scanf(" %c",&ch);
			
			if(ch=='#')		array[i][j]=0;
			
			else if(ch=='.')	array[i][j]=1;
			
		}
	}
	if(flag==2)
	printf("Yes");
	else 
	printf("No");
	return 0;
	


}

信息

递交者
类型
递交
题目
P1001 hitwh 2019 新生赛 B lxdlam 和他的迷宫
语言
C
递交时间
2020-12-21 21:17:23
评测时间
2020-12-21 21:17:23
评测机
分数
40
总耗时
4ms
峰值内存
280.0 KiB