#include using namespace std; const int INF = 2147483647; const int MAX_N = 10000; const int MAX_M = 1000000; int m, n, q; int matrix[MAX_N][MAX_N]; int costo_totale_archi[MAX_N]; int myMin(int a, int b){ return amax) max = array[i]; } return max; } int main() { ifstream fin("input.txt"); fin >> n >> m >> q; for(int i=0; i> v >> u >> w; matrix[v-1][u-1] = w; matrix[u-1][v-1] = w; //il grafo รจ indiretto } fin.close(); for(int i=0; i= 0){ costo_totale_archi[j] = myMin(costo_totale_archi[j], costo_totale_archi[j-1]+ matrix[i][j]); } } } ofstream fout("output.txt"); fout << getMax(costo_totale_archi, n) << "\n"; fout.close(); return 0; }