Hello, I am a bit new to this so bare with me, I am facing a problem with NOTATRIANGLE problem!! I submitted the code which is working fine on the test case provided on the problem plus some of my own and it get me WA...............Can Anyone suggest me a special test case to get the bug within my Code ?
Here's a copy my code
include
include
using namespace std;
int arr[2000],ret;
int bSearch(int num, int s,int e){
bool flag =false;
int mid ;
while(e>=s){
mid= (s+e)/2;
if(num<arr[mid]){e=mid-1;flag=true;
}
else
{
s=mid+1;
}
}
return flag?mid:mid+1;
}
int main() {
int t,i,j,temp;
while(cin>>t&&t){ret =0;
for(i=0;i>arr[i];i++);
sort(arr,arr+t);
for(i=0;i<t;i++){
for(j=i+1;j<t-1;j++){
temp=0;
temp= bSearch(arr[i]+arr[j],j+1,t-1);
ret+=t-temp;
//cout<<ret<<endl;
}
}
cout<<ret<<endl;
}
return 0;
}