We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
can any one tell me what is wrong in this code
it passes sample test case 0,1 and also test case 1,2,3,4,5 but for other is
error message segmentation error.
include
using namespace std;
int main()
{
int c,n,i,j,temp,min=0,k=0,x[6],p=0;
cin>>n>>c;
int a[n][2],s[n],d[n*(n-1)/2],ans=c;
for(i=0;i>a[i][j];
Distant Pairs
You are viewing a single comment's thread. Return to all comments →
can any one tell me what is wrong in this code it passes sample test case 0,1 and also test case 1,2,3,4,5 but for other is error message segmentation error.
include
using namespace std; int main() { int c,n,i,j,temp,min=0,k=0,x[6],p=0; cin>>n>>c; int a[n][2],s[n],d[n*(n-1)/2],ans=c; for(i=0;i>a[i][j];
for(i=0;ix[k]) min=x[k]; d[p]=min; p++; } min=0; for(k=0;k<(n*(n-1)/2);k++) { temp=d[k]; if(temp>min) min=temp; } cout<
return 0; }