{"id":182,"date":"2012-09-23T19:36:00","date_gmt":"2012-09-23T11:36:00","guid":{"rendered":"http:\/\/nike0good.jp1.rpvhost.net\/87"},"modified":"2012-09-23T19:36:00","modified_gmt":"2012-09-23T11:36:00","slug":"poj_2588_analytic_geometry__and_investigation_set","status":"publish","type":"post","link":"https:\/\/nike0good.com\/?p=182","title":{"rendered":"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09"},"content":{"rendered":"<p>\u9898\u76ee\u5c31\u662f\u65e9\u4ece\u5de6\u5230\u53f3\u7684\u8def<\/p>\n<p>\u6ce8\u610f\u8f93\u5165\u7684\u5b9e\u6570<\/p>\n<p>\u8fd9\u9898\u56fe\u753b\u597d\u5c31\u884c\uff0c\u522b\u50cf\u6211\u4e00\u5f00\u59cb\u628a\u56fe\u5f04\u53cd\u5c31\u6210<\/p>\n<p>\u4ece\u4e0a\u5f00\u59cb\u627e\uff0c\u82e5\u627e\u5230\u4e00\u4e2a\u4e0e\u4e0b\u8fb9\u754c\u76f8\u90bb\u7684\u5c31\u65e0\u89e3\uff0c\u627e\u5230\u4e0e\u5de6\u8fb9\u76f8\u90bb\u7684\u8bb0\u5706\u4e0e\u5de6\u8fb9\u754c\u76f8\u4ea4\u7684\u4e0b\u8fb9\u7684\u70b9\uff08\u76f8\u5f53\u4e8e\u5de6\u4e0a\u89d2\u6316\u53bb\u4e00\u5757\uff09\uff0c\u53f3\u8fb9\u540c\u7406\u3002<\/p>\n<p>\n<\/p>\n<\/p>\n<pre name=\"code\" class=\"delphi\">Program snake;\nconst\n   maxn=1000;\nvar\n   n,i,j:longint;\n   x,y,r,lc,rc:array[1..maxn] of double;\n   maxl,maxr:double;\n   father:array[1..maxn] of longint;\n   b,up,down,left,right:array[1..maxn] of boolean;\nfunction getfather(x:longint):longint;\nbegin\n   if father[x]=x then exit(x);\n   father[x]:=getfather(father[x]);\n   exit(father[x]);\nend;\nProcedure union(x,y:longint);\nbegin\n   father[father[x]]:=father[father[y]];\nend;\nfunction distance(i,j:longint):double;\nbegin\n   exit(sqrt(sqr(x[i]-x[j])+sqr(y[i]-y[j])));\nend;\nfunction dis(x1,y1,x2,y2:double):double;\nbegin\n   exit(sqrt(sqr(x1-x2)+sqr(y1-y2)));\nend;\n\nbegin\n   fillchar(b,sizeof(b),false);\n   fillchar(up,sizeof(up),false);\n   fillchar(down,sizeof(down),false);\n   fillchar(left,sizeof(left),false);\n   fillchar(right,sizeof(right),false);\n   fillchar(lc,sizeof(lc),0);\n   fillchar(rc,sizeof(rc),0);\n   maxl:=1000;maxr:=1000;\n\n   read(n);\n   for i:=1 to n do\n   begin\n      read(x[i],y[i],r[i]);\n      father[i]:=i;\n      for j:=1 to i-1 do\n         if distance(i,j)&lt;r[i]+r[j] then\n            if getfather(i)&lt;&gt;getfather(j) then\n               union(i,j);\n      if (y[i]&lt;r[i]) then down[i]:=true;\n      if (y[i]+r[i]&gt;1000) then up[i]:=true;\n      if (x[i]&lt;r[i]) then\n      begin\n         left[i]:=true;\n         lc[i]:=y[i]-sqrt(sqr(r[i])-sqr(x[i]));\n      end;\n      if (x[i]+r[i]&gt;1000) then\n      begin\n         right[i]:=true;\n         rc[i]:=y[i]-sqrt(sqr(r[i])-sqr(1000-x[i]));\n      end;\n\n   end;\n   for i:=1 to n do\n      if (up[i]) and not(b[i]) then\n      begin\n         for j:=1 to n do\n            if father[i]=father[j] then\n            begin\n               b[j]:=true;\n               if (down[j]) then\n               begin\n                  writeln('Bill will be bitten.');\n                  halt;\n               end;\n               if left[j] then\n               begin\n                  if lc[j]&lt;maxl then maxl:=lc[j];\n\n               end;\n               if right[j] then\n               begin\n                  if rc[j]&lt;maxr then maxr:=rc[j];\n               end;\n\n\n            end;\n      end;\n   writeln('Bill enters at (0.00, ',maxl:2:2,') and leaves at (1000.00, ',maxr:2:2,').');\n\n\n\n\nend.\n<\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u5c31\u662f\u65e9\u4ece\u5de6\u5230\u53f3\u7684\u8def \u6ce8\u610f\u8f93\u5165\u7684\u5b9e\u6570 \u8fd9\u9898\u56fe\u753b\u597d\u5c31\u884c\uff0c\u522b\u50cf\u6211\u4e00\u5f00\u59cb\u628a\u56fe\u5f04\u53cd\u5c31\u6210 \u4ece\u4e0a\u5f00\u59cb\u627e\uff0c\u82e5\u627e\u5230\u4e00\u4e2a\u4e0e\u4e0b\u8fb9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[3],"tags":[116],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-defaultcategory","tag-analytic_geometry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09 - nike0good<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nike0good.com\/?p=182\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09 - nike0good\" \/>\n<meta property=\"og:description\" content=\"\u9898\u76ee\u5c31\u662f\u65e9\u4ece\u5de6\u5230\u53f3\u7684\u8def \u6ce8\u610f\u8f93\u5165\u7684\u5b9e\u6570 \u8fd9\u9898\u56fe\u753b\u597d\u5c31\u884c\uff0c\u522b\u50cf\u6211\u4e00\u5f00\u59cb\u628a\u56fe\u5f04\u53cd\u5c31\u6210 \u4ece\u4e0a\u5f00\u59cb\u627e\uff0c\u82e5\u627e\u5230\u4e00\u4e2a\u4e0e\u4e0b\u8fb9 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nike0good.com\/?p=182\" \/>\n<meta property=\"og:site_name\" content=\"nike0good\" \/>\n<meta property=\"article:published_time\" content=\"2012-09-23T11:36:00+00:00\" \/>\n<meta name=\"author\" content=\"nike0good\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"nike0good\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=182#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=182\"},\"author\":{\"name\":\"nike0good\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/#\\\/schema\\\/person\\\/4defa38da89de87e400861e73396baad\"},\"headline\":\"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09\",\"datePublished\":\"2012-09-23T11:36:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=182\"},\"wordCount\":1,\"commentCount\":0,\"keywords\":[\"\u89e3\u6790\u51e0\u4f55\"],\"articleSection\":[\"DefaultCategory\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nike0good.com\\\/?p=182#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=182\",\"url\":\"https:\\\/\\\/nike0good.com\\\/?p=182\",\"name\":\"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09 - nike0good\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/#website\"},\"datePublished\":\"2012-09-23T11:36:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/#\\\/schema\\\/person\\\/4defa38da89de87e400861e73396baad\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=182#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nike0good.com\\\/?p=182\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=182#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nike0good.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/#website\",\"url\":\"https:\\\/\\\/nike0good.com\\\/\",\"name\":\"nike0good\",\"description\":\"\u6709\u6240\u4f5c\u4e3a\u662f\u4eba\u751f\u7684\u6700\u9ad8\u5883\u754c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nike0good.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/#\\\/schema\\\/person\\\/4defa38da89de87e400861e73396baad\",\"name\":\"nike0good\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g\",\"caption\":\"nike0good\"},\"sameAs\":[\"https:\\\/\\\/nike0good.com\"],\"url\":\"https:\\\/\\\/nike0good.com\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09 - nike0good","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nike0good.com\/?p=182","og_locale":"zh_CN","og_type":"article","og_title":"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09 - nike0good","og_description":"\u9898\u76ee\u5c31\u662f\u65e9\u4ece\u5de6\u5230\u53f3\u7684\u8def \u6ce8\u610f\u8f93\u5165\u7684\u5b9e\u6570 \u8fd9\u9898\u56fe\u753b\u597d\u5c31\u884c\uff0c\u522b\u50cf\u6211\u4e00\u5f00\u59cb\u628a\u56fe\u5f04\u53cd\u5c31\u6210 \u4ece\u4e0a\u5f00\u59cb\u627e\uff0c\u82e5\u627e\u5230\u4e00\u4e2a\u4e0e\u4e0b\u8fb9 [&hellip;]","og_url":"https:\/\/nike0good.com\/?p=182","og_site_name":"nike0good","article_published_time":"2012-09-23T11:36:00+00:00","author":"nike0good","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"nike0good","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nike0good.com\/?p=182#article","isPartOf":{"@id":"https:\/\/nike0good.com\/?p=182"},"author":{"name":"nike0good","@id":"https:\/\/nike0good.com\/#\/schema\/person\/4defa38da89de87e400861e73396baad"},"headline":"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09","datePublished":"2012-09-23T11:36:00+00:00","mainEntityOfPage":{"@id":"https:\/\/nike0good.com\/?p=182"},"wordCount":1,"commentCount":0,"keywords":["\u89e3\u6790\u51e0\u4f55"],"articleSection":["DefaultCategory"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nike0good.com\/?p=182#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nike0good.com\/?p=182","url":"https:\/\/nike0good.com\/?p=182","name":"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09 - nike0good","isPartOf":{"@id":"https:\/\/nike0good.com\/#website"},"datePublished":"2012-09-23T11:36:00+00:00","author":{"@id":"https:\/\/nike0good.com\/#\/schema\/person\/4defa38da89de87e400861e73396baad"},"breadcrumb":{"@id":"https:\/\/nike0good.com\/?p=182#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nike0good.com\/?p=182"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nike0good.com\/?p=182#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nike0good.com\/"},{"@type":"ListItem","position":2,"name":"POJ 2588(\u89e3\u6790\u51e0\u4f55+\u5e76\u67e5\u96c6\uff09"}]},{"@type":"WebSite","@id":"https:\/\/nike0good.com\/#website","url":"https:\/\/nike0good.com\/","name":"nike0good","description":"\u6709\u6240\u4f5c\u4e3a\u662f\u4eba\u751f\u7684\u6700\u9ad8\u5883\u754c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nike0good.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/nike0good.com\/#\/schema\/person\/4defa38da89de87e400861e73396baad","name":"nike0good","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/secure.gravatar.com\/avatar\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g","caption":"nike0good"},"sameAs":["https:\/\/nike0good.com"],"url":"https:\/\/nike0good.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":0,"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"wp:attachment":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}