We are using what mountain climbing algorithm, simulated annealing algorithm ... Too high-end Konjac Konjac won't
So XS found something strange.
The 3.3 "N-hole system" in this paper is the problem.
So there's no ≥v≤~.
1 /**************************************************************2 problem:36803 User:rausen4 language:c++5 result:accepted6 time:300 Ms7 memory:1040 KB8 ****************************************************************/9 Ten#include <cstdio> One#include <cmath> A - using namespacestd; -typedefDoubleLF; the Const intN =10005; - ConstLF EPS = 1e-5; - - #defineP Point + structP { - lf x, y; + P () {} A P (LF _x, LF _y): X (_x), Y (_y) {} at -Inline Poperator*(LF X) { -returnP (x * x, Y *X); - } -Inline Poperator/(LF X) { - returnP (x/x, Y/X); in } -Inline Poperator+(P a) { toreturnP (x + a.x, y +a.y); + } - theInlineBOOL operator==(P a) { *returnFabs (x-a.x) < EPS && fabs (Y-A.Y) <EPS; $ }Panax NotoginsengInlineBOOL operator!=(P a) { -returnFabs (x-a.x) >= EPS | | Fabs (Y-A.Y) >=EPS; the } + }p[n]; A the intN; + LF W[n]; - $InlineintRead () { $intx =0, SGN =1; -CharCH =GetChar (); - while(Ch <'0'||'9'<ch) { theif(ch = ='-') SGN =-1; -CH =GetChar ();Wuyi } the while('0'<= CH && Ch <='9') { -x = x *Ten+ CH-'0'; WuCH =GetChar (); - } AboutreturnSGN *x; $ } - - Inline LF Sqr (lf x) { -returnX *x; A } + the Inline LF Dist (p A, p b) { -returnsqrt (SQR (a.x-b.x) + SQR (A.Y-b.y)); $ } the the intMain () { theinti; theLF W =0; -P P1 = P (0,0), p2 =P1, p3; inn =read (); the for(i =1; I <= N; ++i) { thep[i].x = Read (), p[i].y = Read (), w[i] =read (); AboutP1 = p1 + p[i] * W[i], W + =W[i]; the } theP1 = P1/W; the while(P1! =p2) { +P2 = P3 = P1, p1 = P (0,0); -W =0; the for(i =1; I <= N; ++i) {BayiP1 = p1 + p[i] * (W[i]/Dist (p3, p[i])); theW + = W[i]/Dist (p3, p[i]); the } -P1 = P1/W; - } theprintf"%.3LF%.3lf\n", p1.x, p1.y); thereturn 0; the}View Code
(P.S. This iteration is going to do it quickly!) )
BZOJ3680 amputated xxx