-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
13 shortest path #13
Conversation
…Altu-Bitu-HwangJaeEun into 06_greedy_algorithm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3. 코드리뷰완료
안녕하세요, 황재은님. 수고하셨습니다!
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; | ||
} |
There was a problem hiding this comment.
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보다 작음을 나타내는 정보 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3. graph를 boolean 타입으로 해도 괜찮을 것 같습니다.
인적 사항
학번 : 2176427
이름 : 황재은
과제 제출
기존 제출 : 2458, 15685
추가 제출 : 1238