Created
April 11, 2017 17:25
-
-
Save ileasile/d3ad80111ab7393cc286721da451d398 to your computer and use it in GitHub Desktop.
Nick4343
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int findBestWay() { | |
unsigned int be4last = N; | |
for(int i=0; i < N; ++i) | |
bestWay[i].resize(N); | |
for (unsigned int i = 0; i < N; i++) { | |
for (unsigned int k = 0; k < N; k++) | |
for (unsigned int j = 0; j < N; j++) { | |
int res = G[ans[i]][ans[k]] * G[ans[k]][ans[j]] / 10000; | |
if (G[ans[i]][ans[j]] < res) { | |
G[ans[i]][ans[j]] = res; | |
bestWay[ans[i]][ans[j]] = ans[k]; | |
} | |
} | |
} | |
return be4last; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment