-
Notifications
You must be signed in to change notification settings - Fork 37
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
base: 2171024-신수정2
Are you sure you want to change the base?
[최단경로] 2171024 신수정 #362
Conversation
코드리뷰완료 |
#include <vector> | ||
|
||
using namespace std; | ||
const int CONNECT = 1; |
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.
이렇게 선언하니까 좋네요!! 배워갑니다~
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++; | ||
} | ||
} | ||
} | ||
} |
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. if(connected_student == N-1) 이어도 될 것 같아요~ 여기 부분 잘하셨네요!! 👍 👍
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"; |
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.
아~~~깔끔합니다~~ 👍 👍
인적사항
학번:
이름:
과제 제출
기존 제출 : 1238, 2458
추가 제출 :