제출 #28089

#제출 시각아이디문제언어결과실행 시간메모리
28089aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (#71)도시와 비트코인 (FXCUP2_city)C++14
0 / 1
0 ms2464 KiB
#include <bits/stdc++.h>

using namespace std;

int N,M;
int a[302][302];
bool check[302][302];
int dx[] = {0,1,0,-1};
int dy[] = {1,0,-1,0};

void dfs(int x,int y){
	check[x][y] = true;
	for(int i=0; i<4; i++){
		if(a[x+dx[i]][y+dy[i]] == 0 || check[x+dx[i]][y+dy[i]]) continue;
		dfs(x+dx[i],y+dy[i]);
	}
}

int main(){
	scanf("%d %d",&M,&N);
	for(int i=1; i<=N; i++){
		for(int j=1; j<=M; j++){
			scanf("%d",&a[i][j]);
		}
	}
	dfs(1,1);
	printf("%s\n",check[N][M]?"YES":"NO");

	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

city.cpp: In function 'int main()':
city.cpp:20:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&M,&N);
                      ^
city.cpp:23:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&a[i][j]);
                        ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…