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

[최단경로] 2171024 신수정 #362

Open
wants to merge 32 commits into
base: 2171024-신수정2
Choose a base branch
from

Conversation

chock-cho
Copy link

인적사항

학번:
이름:


과제 제출

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


jk0527 and others added 30 commits April 12, 2023 11:15
@Dong-droid
Copy link
Contributor

코드리뷰완료
수고하셨습니다 😸

#include <vector>

using namespace std;
const int CONNECT = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 선언하니까 좋네요!! 배워갑니다~

Comment on lines +35 to +46
for(int i = 1; i <= N; i++){
int connected_student = 0;
for(int j = 1; j <= N; j++) {
if(adj[i][j] == CONNECT || adj[j][i] == CONNECT) {
connected_student++; // 자신을 제외한 N-1명 학생이 연결돼있나?

if(connected_student >= N-1) { // N-1명 이상이 연결되어있음
answer++;
}
}
}
}
Copy link
Contributor

@Dong-droid Dong-droid May 31, 2023

Choose a reason for hiding this comment

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

P3. if(connected_student == N-1) 이어도 될 것 같아요~ 여기 부분 잘하셨네요!! 👍 👍

Comment on lines +56 to +64
vector<int> vr1 = dijkstra(X, N, adj);

int ans = 0;
for (int i = 1; i <= N; i++) {
vector<int> vr2 = dijkstra(i, N, adj); // i 부터 X의의 최단 시간
ans = max(ans, vr1[i] + vr2[X]);
}

cout << ans << "\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

아~~~깔끔합니다~~ 👍 👍

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.

3 participants