강의

멘토링

커뮤니티

Inflearn Community Q&A

tkdgns35084243's profile image
tkdgns35084243

asked

10-Week Completion C++ Coding Test | Algorithm Coding Test

2-A 2178 질문있습니다ㅜ

Written on

·

395

0

https://www.acmicpc.net/source/56777065

 

이 코드랑

 

https://www.acmicpc.net/source/57068084

 

이 코드의 차이점이 뭐죠.,,? 왜 하나는 맞고 하나는 틀릴까요 ? ㅠ

c++코딩-테스트

Answer 2

0

kundol님의 프로필 이미지
kundol
Instructor

성빈님이 잘 대답해주셨네요. ㅎㅎ

if (nx < 0 || nx >= m || ny < 0 || ny >= 0 || a[ny][nx] == 0)continue;

마찬가지로 이부분이 잘못되었습니다.

또 질문 있으시면 질문주세요 :)

 

감사합니다.

0

1번)

if (ny < 0 || ny >= n || nx < 0 || nx >= m || a[ny][nx] == 0) continue;

 

2번)

if (nx < 0 || nx >= m || ny < 0 || ny >= 0 || a[ny][nx] == 0)continue;

 

ny >= n 이랑 ny >= 0 차이가 있네용

tkdgns35084243님의 프로필 이미지
tkdgns35084243
Questioner

왜 못찾았을까요. 감사합니다

tkdgns35084243's profile image
tkdgns35084243

asked

Ask a question