HDU 3644 A Chocolate Manufacturer's Problem(模拟退火)(二)

2014-11-24 10:45:28 · 作者: · 浏览: 1
for(int i=0;i for(int j=0;j<5&&!flag;j++){
double angle=rand();
cur.x=tp[i].x+step*cos(angle);
cur.y=tp[i].y+step*sin(angle);
if(!In_Polygon(cur)) continue;
Get_Min_Dist(cur);
if(cur.val+1e-3>tp[i].val){
tp[i]=cur;
if(cur.val+1e-3>r) flag=true;
}
}
}
step*=0.55;
}
puts(flag "Yes":"No");
}
return 0;
}