Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

13 shortest path #13

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

13 shortest path #13

wants to merge 20 commits into from

Conversation

jaeeunHwang
Copy link
Collaborator

@jaeeunHwang jaeeunHwang commented Nov 26, 2023

인적 사항

학번 : 2176427
이름 : 황재은

과제 제출

기존 제출 : 2458, 15685
추가 제출 : 1238

Copy link

@Dong-droid Dong-droid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3. 코드리뷰완료

안녕하세요, 황재은님. 수고하셨습니다!

Comment on lines +21 to +35
int findAnswer(int n, vector<vector<int>> &graph) {
int answer = 0;
for (int i = 1; i <= n; ++i) {
int cnt = 0;
for (int j = 1; j <= n; ++j) {
if (i != j && (graph[i][j] != INF || graph[j][i] != INF)) {
cnt++;
}
}
if (cnt == n - 1) {
answer++;
}
}
return answer;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수화 좋습니다!

while(M--) {
int a, b;
cin >> a >> b;
graph[a][b] = 1; // a가 b보다 작음을 나타내는 정보

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3. graph를 boolean 타입으로 해도 괜찮을 것 같습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants