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

[최단 경로] 2171064 문하영 #354

Open
wants to merge 37 commits into
base: 2171064-문하영2
Choose a base branch
from

Conversation

gkdudans
Copy link

@gkdudans gkdudans commented May 30, 2023

인적사항

학번: 2171064
이름: 문하영


과제 제출

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


jk0527 and others added 30 commits May 5, 2023 16:59
@Dong-droid
Copy link
Contributor

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

graph[s].push_back({e, T});
}
//연산
vector<int> dist_x = dijkstra(x, n, graph); //최단 시간 저장
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 +55 to +59
for (int i = 1; i <= n; i++) {
vector<int> dist_i = dijkstra(i, n, graph); // i -> X의의 최단 시간
max_T = max(max_T, dist_x[i] + dist_i[x]); //max_T 갱신
}

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 +39 to +54
//출력
int ans = 0;
for(int i=1; i<=N; i++){
bool flag = true;
for(int j=1; j<=N; j++){
if(i == j) continue;
else if(graph[i][j] == INF && graph[j][i] == INF){
flag = false; //i와 j 사이의 가중치가 없는 경우
break;
}
}
if(flag) {
ans++;
}

}
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. else if 일 필요는 없을 것 같아요. 앞에서 continue;이니까 if만 써줘도 될 것 같아요~

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