About failing test case Test case 0

Why the test case 0 failed plz hlp me

@Vijay-Gwala-1537851266358174 you can refer to this code https://ide.codingblocks.com/s/230510

1 Like

this code also give the same error

/bin/run.sh: line 4: 17 Segmentation fault (core dumped) ./exe

@Vijay-Gwala-1537851266358174 it is running fine for me. For which input are you testing?

1 Like

it is running fin on coding blocks ide bt in there assignments it will give error

@Vijay-Gwala-1537851266358174 use datatype as long long int for all the values

1 Like

@Vijay-Gwala-1537851266358174 please mark your doubt as resolved.

i tried to clear this doubt of many days bt till now my assignment is not submitted bcoz it gives same error i really demotivated now bcoz the same error are giving in many assignments problems even the same code running on hackerblocks fine with all the test cases

@Vijay-Gwala-1537851266358174 please share your final code with all the changes in it and i’ll have a look :slight_smile:

@Vijay-Gwala-1537851266358174 your logic needs to be modified slightly, im sharing a code snippet with you have a look
if (query == 1) {

  long long int x, y;

  cin >> x >> y;

  long long int rocketDist = x*x + y*y;

  if (pq.size() < k) {

    pq.push(rocketDist);

  }

  else {

    if (pq.top() > rocketDist) {

      pq.pop();

      pq.push(rocketDist);

    }

  }

}

i modified this with your code bt still it is not working and it will give the same error again i knw now you also get irrited to same doubt bt i m doing my 100% and i cant give up

Hey @Vijay-Gwala-1537851266358174
You’ve reopened the doubt
I submitted your code and got AC
What is the issue ?