Free Ticket - INOI1402-WA

Can someone tell me what is wrong with my code for this?

#include<bits/stdc++.h>
using namespace std;
int largest(int arr[],int n){
int max = arr[0];
for (int i=0;i<n;i++){
if (arr[i]> max)
max = arr[i];
return max;
}
}

int main(){
int DistArray[231][231];
int x,y,c,f,z;
DistArray[x][y] = z;
z = DistArray[y][x];
cin >> c>> f;
for (int i=0;i<c;i++){
for (int j=0;j<c;j++){
cin >> x >> y >> DistArray[x][y];
}
}
int k,l,m;
int shortestpath[c];
for (int k=0;k<c;k++){
if(DistArray[k][l] != 0)
if (DistArray[k][l] > DistArray[k][m] + DistArray[m][l]);
shortestpath[k] += DistArray[k][m]+DistArray[m][l];

}
int p= sizeof(shortestpath)/sizeof(shortestpath[0]);
cout << largest(shortestpath,p);
return 0;

}