1 //within the circle, the integer point farthest from the center Hiho the 111th week farthest point2 //idea: Direct violence absolute T3 //determine the X range, within each X range, the point farthest from the center of the circle must be the point at both ends of the y-axis. Enumerate the ranges of x and then compare y4 //O (n)5 6#include <bits/stdc++.h>7 using namespacestd;8 #defineLL Long Long9 Const DoubleINF =123456789012345.0;Ten ConstLL MOD =100000000LL; One Const intN =1e7+Ten; A #defineCLC (A, B) memset (A,b,sizeof (a)) - Const DoubleEPS = 1e-7; - voidFre () {freopen ("In.txt","R", stdin);} the voidFreout () {freopen ("OUT.txt","W", stdout);} -InlineintRead () {intx=0, f=1;CharCh=getchar (); while(ch>'9'|| ch<'0') {if(ch=='-') f=-1; Ch=getchar ();} while(ch>='0'&&ch<='9') {x=x*Ten+ch-'0'; Ch=getchar ();}returnx*F;} - - DoubleDisDoubleADoubleBDoubleCDoubled) { + return(a-c) * (a-c) + (b-d) * (b-d); - } + intMain () { A DoubleX,y,r; at Doublelen=-1; - intans_y,ans_x; -scanf"%LF%LF%LF",&x,&y,&R); - for(DoubleI=floor (x+r); I>=ceil (x-r); i--){ - DoubleD= (Double) sqrt (r*r-(i-x) * (I-x)); - DoubleY1=floor (D+y), Y2=ceil (yd); in if(Dis (x,y,i,y1) >Len) { -len=dis (x,y,i,y1); toans_x=i,ans_y=Y1; + } - if(Dis (x,y,i,y2) >Len) { thelen=dis (x,y,i,y2); *ans_x=i,ans_y=Y2; $ }Panax Notoginseng } -printf"%d%d\n", ans_x,ans_y); the return 0; +}
Within the circle, the integer point farthest from the center Hiho the 111th Week farthest point