久久国产精品一区,AV无码久久久久不卡蜜桃,99久久国产综合精品五月天喷水 http://m.shnenglu.com/Wangzhihao/category/15609.html為了自己的夢想,每天要像小樂一樣勤奮!zh-cnMon, 03 Jan 2011 21:12:13 GMTMon, 03 Jan 2011 21:12:13 GMT601444 Parallelepiped walkhttp://m.shnenglu.com/Wangzhihao/articles/120959.html王之昊王之昊Wed, 21 Jul 2010 06:29:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/120959.htmlhttp://m.shnenglu.com/Wangzhihao/comments/120959.htmlhttp://m.shnenglu.com/Wangzhihao/articles/120959.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/120959.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/120959.html

1444 Parallelepiped walk

       做法一可以嘗試分類討論。具體類似這道題目The Return of Carl。然后也可以觀察分類討論的幾種情況。如下圖:

可以發(fā)現(xiàn)他們沿x軸一個方向走,沿y軸也是一個方向走,不會來回。(這點很重要,如果不發(fā)現(xiàn)這一點直接搜的話,會搜出更短的但不合法的距離。) 也可以判是否路線經(jīng)過了所有的矩形,如果經(jīng)過了,就是一條合法路徑。

 



王之昊 2010-07-21 14:29 發(fā)表評論
]]>
Cover an Archttp://m.shnenglu.com/Wangzhihao/articles/119376.html王之昊王之昊Mon, 05 Jul 2010 12:19:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/119376.htmlhttp://m.shnenglu.com/Wangzhihao/comments/119376.htmlhttp://m.shnenglu.com/Wangzhihao/articles/119376.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/119376.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/119376.htmlCover an Arc

       寫好計算幾何很多時候要養(yǎng)成一個好習慣。
      
       比如求比浮點數(shù) f 小的最小的整數(shù),認為絕對值差在1e-9的精度內兩個浮點數(shù)是相同的,首先是看 f 是否就是一個整數(shù), 是則返回 f 。 否則返回 f 的截斷。 這時如果直接用 floor( f ),很容易忽視這種情況 如0.9,999,999,999。它和 1 在1e-9精度下是相等的。所以答案應該是1, 而floor(f) = 0;

       又如Reflections 這道題中的反射,大致是光線從一點射出,射到某個球上,再反射,再射下一個球上,重復,直到不再與球相交。
      
       我們假設前一次反射的球為base,再求下一個射到的球的位置時,就不該考慮base,他一定不是我們要求的那個下一個球,但如果不先排除base,我們很容易就算到base是下一個射到的球這樣一個錯誤的答案,這樣模棱兩可的情況如果能在邏輯上排除,盡量排除。
       
        在這些精度問題上要注意小心,更好的辦法就是平時寫的時候養(yǎng)成一個好習慣。

        能邏輯上排除的就不進行浮點數(shù)比較,能避免就避免。如果不能避免,一定要加上符號判斷函數(shù)
        int D(double x ){ return x < -eps ? -1 : x > eps; }


王之昊 2010-07-05 20:19 發(fā)表評論
]]>
2284 That Nice Euler Circuithttp://m.shnenglu.com/Wangzhihao/articles/110299.html王之昊王之昊Mon, 22 Mar 2010 08:25:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/110299.htmlhttp://m.shnenglu.com/Wangzhihao/comments/110299.htmlhttp://m.shnenglu.com/Wangzhihao/articles/110299.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/110299.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/110299.html

王之昊 2010-03-22 16:25 發(fā)表評論
]]>
3329 Twirl Aroundhttp://m.shnenglu.com/Wangzhihao/articles/110187.html王之昊王之昊Sat, 20 Mar 2010 16:36:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/110187.htmlhttp://m.shnenglu.com/Wangzhihao/comments/110187.htmlhttp://m.shnenglu.com/Wangzhihao/articles/110187.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/110187.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/110187.html 

出題者應該會避免相切的數(shù)據(jù)。和當前木棍在同一直線上的特殊點,一種可以根據(jù)線段的中心確定它會不會阻擋。

 

 另外一種連中心也在同一條直線上。這時認為在有木棍實體的那側的特殊點不會阻擋,而另一側會。

 

 

總的來說,障礙物(一條線段)他可能出現(xiàn)的位置是0~360。而難區(qū)分的是0度和360度。如果發(fā)現(xiàn)一個點落在0度或360度的位置時,通過判斷障礙物在左邊(包括平行的時候)還是在右邊來確定會不會阻擋。

還可以通過讓木棍轉動一個小的角度,看一下是遠離障礙物,還是和障礙物相交來確定是否會阻擋。



王之昊 2010-03-21 00:36 發(fā)表評論
]]>
3525 Most Distant Point from the Seahttp://m.shnenglu.com/Wangzhihao/articles/109785.html王之昊王之昊Mon, 15 Mar 2010 15:12:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109785.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109785.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109785.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109785.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109785.html還有一種做法就是內切圓必然和多邊形的某些邊相切, 我們二分半徑, 然后枚舉兩條相切的邊(凹多邊形也可能是頂點), 確定圓心, 再看多邊形是否包含這個圓.
確定圓心的時候直接解方程就可以了.



王之昊 2010-03-15 23:12 發(fā)表評論
]]>
3608 Bridge Across Islandshttp://m.shnenglu.com/Wangzhihao/articles/109777.html王之昊王之昊Mon, 15 Mar 2010 14:56:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109777.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109777.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109777.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109777.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109777.html當遇到這種精度卡的很緊的題目時,要盡量少用角度.



王之昊 2010-03-15 22:56 發(fā)表評論
]]>
3675 Telescopehttp://m.shnenglu.com/Wangzhihao/articles/109773.html王之昊王之昊Mon, 15 Mar 2010 14:48:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109773.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109773.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109773.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109773.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109773.html對于每種情況.實際上只要算出圓和線段的相交區(qū)域的端點即可.





王之昊 2010-03-15 22:48 發(fā)表評論
]]>
2932 Coneologyhttp://m.shnenglu.com/Wangzhihao/articles/109348.html王之昊王之昊Wed, 10 Mar 2010 05:05:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109348.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109348.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109348.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109348.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109348.html閱讀全文

王之昊 2010-03-10 13:05 發(fā)表評論
]]>
3410 Split convex polygonhttp://m.shnenglu.com/Wangzhihao/articles/108911.html王之昊王之昊Thu, 04 Mar 2010 15:39:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108911.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108911.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108911.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108911.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108911.html    首先判斷兩個多邊形的凹凸性, 如果兩個多邊形都是凸的.那么兩個凸多邊形只會公共一條邊,需要檢查兩端的凹凸性.
 如果有凹多邊形,那么凹點必定是要和別人耦合的,可以先找一個凹點,再枚舉另一個多邊形的所有點,看是否和該凹點匹配,如果匹配,就沿著多邊形的方向走,繼續(xù)檢查下一對點, 下一對點要么耦合, 要么以一個凸的形狀分開.


最后只要檢查所有的凹點是否都訪問了就可以了.


王之昊 2010-03-04 23:39 發(fā)表評論
]]>
3384 Feng Shuihttp://m.shnenglu.com/Wangzhihao/articles/108797.html王之昊王之昊Wed, 03 Mar 2010 07:44:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108797.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108797.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108797.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108797.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108797.html    就是求凸多邊形的核,再求核上的最遠點。


王之昊 2010-03-03 15:44 發(fā)表評論
]]>
3347 Kadj Squareshttp://m.shnenglu.com/Wangzhihao/articles/108795.html王之昊王之昊Wed, 03 Mar 2010 07:29:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108795.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108795.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108795.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108795.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108795.html    如果能確定每個正方形的位置。那么就可以很輕松的算出遮擋關系。這可以轉換成一些區(qū)間的覆蓋問題。
    如果確定了1,2,...,k-1的位置,現(xiàn)在要確定第 k 個的位置。假設有兩個正方形a,b。a的位置已經(jīng)確定為 Xa,b在a的右邊,那么 Xb = Xa + min(a, b)*sqrt(2);這樣就可以確定第k塊正方形的位置了。
    注意到上面涉及浮點數(shù),我們把邊長擴大根號二倍,不影響最后結果,但只有整數(shù)間的運算。


王之昊 2010-03-03 15:29 發(fā)表評論
]]>
3336 ACM Undergroundhttp://m.shnenglu.com/Wangzhihao/articles/108789.html王之昊王之昊Wed, 03 Mar 2010 07:00:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108789.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108789.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108789.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108789.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108789.html閱讀全文

王之昊 2010-03-03 15:00 發(fā)表評論
]]>
3521 Geometric Maphttp://m.shnenglu.com/Wangzhihao/articles/108568.html王之昊王之昊Sat, 27 Feb 2010 11:03:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108568.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108568.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108568.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108568.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108568.html閱讀全文

王之昊 2010-02-27 19:03 發(fā)表評論
]]>
国产欧美久久一区二区| 欧美精品国产综合久久| 狠狠色丁香久久婷婷综| 国产精品久久久久9999高清| 久久精品国产69国产精品亚洲| 97精品伊人久久久大香线蕉| 91麻豆精品国产91久久久久久| 久久久久亚洲精品天堂久久久久久| 亚洲欧洲精品成人久久奇米网| 久久人人爽人人爽人人片AV麻烦| 99久久国产热无码精品免费| 久久久久亚洲精品无码网址| 久久亚洲中文字幕精品有坂深雪| 色综合久久中文色婷婷| 97香蕉久久夜色精品国产| 2021久久国自产拍精品| 亚洲精品乱码久久久久久蜜桃| 久久精品九九亚洲精品| 理论片午午伦夜理片久久 | 9久久9久久精品| 欧美性大战久久久久久| 狠狠色丁香久久婷婷综合五月 | 国产精品一久久香蕉国产线看观看| 国产99久久久国产精免费| 国产aⅴ激情无码久久| 久久国产精品免费一区二区三区| 成人久久免费网站| 久久青青草原精品国产不卡| 久久久久免费看成人影片| yy6080久久| 久久人人爽人人爽人人片AV不 | 亚洲va久久久噜噜噜久久狠狠 | 久久人与动人物a级毛片| 精品久久久久久久久久中文字幕| 日韩人妻无码一区二区三区久久 | 色综合合久久天天综合绕视看| 久久久久高潮综合影院| 一本色道久久综合狠狠躁篇 | 久久精品国产亚洲AV蜜臀色欲| 久久亚洲国产成人精品无码区| 久久久久婷婷|