Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

GETTING WRONG ANSWER

$
0
0

include<stdio.h>

int main(){ int t,n,x[101],y[101],tr1,tr2,tr3,ash,resn,resd,i; float cx,cy; scanf("%d",&t); for(;t>0;t--){resn=0;resd=0; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d%d",&x[i],&y[i]); for(tr1="0;tr1&lt;n;tr1++){" for(tr2="0;tr2&lt;n;tr2++){" if(tr2!="tr1){" for(tr3="0;tr3&lt;n;tr3++){" if(tr3!="tr2&amp;&amp;tr3!=tr1){resd++;" if((x[tr1]-x[tr2])*(y[tr2]-y[tr3])-(y[tr1]-y[tr2])*(x[tr2]-x[tr3])){="" for(ash="0;ash&lt;n;ash++){" if(ash!="tr1&amp;&amp;ash!=tr2&amp;&amp;ash!=tr3){" cy="((x[tr2]-x[tr3])*(x[tr1]*x[tr1]+y[tr1]*y[tr1]-x[tr2]*x[tr2]-y[tr2]*y[tr2])-(x[tr1]-x[tr2])*(x[tr2]*x[tr2]+y[tr2]*y[tr2]-x[tr3]*x[tr3]-y[tr3]*y[tr3]))*1.0/(2*((x[tr2]-x[tr3])*(y[tr1]-y[tr2])-(x[tr1]-x[tr2])*(y[tr2]-y[tr3])));" cx="-((y[tr2]-y[tr3])*(x[tr1]*x[tr1]+y[tr1]*y[tr1]-x[tr2]*x[tr2]-y[tr2]*y[tr2])-(y[tr1]-y[tr2])*(x[tr2]*x[tr2]+y[tr2]*y[tr2]-x[tr3]*x[tr3]-y[tr3]*y[tr3]))*1.0/(2*((x[tr2]-x[tr3])*(y[tr1]-y[tr2])-(x[tr1]-x[tr2])*(y[tr2]-y[tr3])));" if((x[ash]-x[tr1])*(2*cx-x[ash]-x[tr1])+(y[ash]-y[tr1])*(2*cy-y[ash]-y[tr1])="">=0.0) resn++; }}}}}}}} printf("%f",resn1.0/((n-3)resd));} return 0;}


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>