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

王之昊 2010-03-22 16:25 發(fā)表評論
]]>
3329 Twirl Aroundhttp://www.shnenglu.com/Wangzhihao/articles/110187.html王之昊王之昊Sat, 20 Mar 2010 16:36:00 GMThttp://www.shnenglu.com/Wangzhihao/articles/110187.htmlhttp://www.shnenglu.com/Wangzhihao/comments/110187.htmlhttp://www.shnenglu.com/Wangzhihao/articles/110187.html#Feedback0http://www.shnenglu.com/Wangzhihao/comments/commentRss/110187.htmlhttp://www.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://www.shnenglu.com/Wangzhihao/articles/109785.html王之昊王之昊Mon, 15 Mar 2010 15:12:00 GMThttp://www.shnenglu.com/Wangzhihao/articles/109785.htmlhttp://www.shnenglu.com/Wangzhihao/comments/109785.htmlhttp://www.shnenglu.com/Wangzhihao/articles/109785.html#Feedback0http://www.shnenglu.com/Wangzhihao/comments/commentRss/109785.htmlhttp://www.shnenglu.com/Wangzhihao/services/trackbacks/109785.html還有一種做法就是內切圓必然和多邊形的某些邊相切, 我們二分半徑, 然后枚舉兩條相切的邊(凹多邊形也可能是頂點), 確定圓心, 再看多邊形是否包含這個圓.
確定圓心的時候直接解方程就可以了.



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



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





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

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


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


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


王之昊 2010-03-03 15:44 發(fā)表評論
]]>
3347 Kadj Squareshttp://www.shnenglu.com/Wangzhihao/articles/108795.html王之昊王之昊Wed, 03 Mar 2010 07:29:00 GMThttp://www.shnenglu.com/Wangzhihao/articles/108795.htmlhttp://www.shnenglu.com/Wangzhihao/comments/108795.htmlhttp://www.shnenglu.com/Wangzhihao/articles/108795.html#Feedback0http://www.shnenglu.com/Wangzhihao/comments/commentRss/108795.htmlhttp://www.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://www.shnenglu.com/Wangzhihao/articles/108789.html王之昊王之昊Wed, 03 Mar 2010 07:00:00 GMThttp://www.shnenglu.com/Wangzhihao/articles/108789.htmlhttp://www.shnenglu.com/Wangzhihao/comments/108789.htmlhttp://www.shnenglu.com/Wangzhihao/articles/108789.html#Feedback0http://www.shnenglu.com/Wangzhihao/comments/commentRss/108789.htmlhttp://www.shnenglu.com/Wangzhihao/services/trackbacks/108789.html閱讀全文

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

王之昊 2010-02-27 19:03 發(fā)表評論
]]>
久久精品一本到99热免费| 国产2021久久精品| 色综合久久无码五十路人妻| 久久久久无码精品国产不卡| 亚洲国产精品久久久久婷婷老年 | 久久婷婷五月综合国产尤物app | 久久精品毛片免费观看| 国产午夜精品久久久久九九电影 | 久久久久国产精品麻豆AR影院| 久久精品国产清自在天天线| 久久精品国产精品青草app| 久久天天日天天操综合伊人av| 日韩人妻无码一区二区三区久久| 国产精品成人无码久久久久久| 无码人妻久久久一区二区三区| 久久99精品国产麻豆蜜芽| 国产午夜免费高清久久影院 | 囯产极品美女高潮无套久久久| 狠色狠色狠狠色综合久久| 久久九九兔免费精品6| 久久亚洲精品无码观看不卡| 国产成人久久精品麻豆一区| 久久综合88熟人妻| 久久久www免费人成精品| 香蕉aa三级久久毛片| 久久久久无码中| 色综合久久精品中文字幕首页| 精品免费久久久久久久| 日本强好片久久久久久AAA| 久久久www免费人成精品| 人妻无码αv中文字幕久久琪琪布| 久久精品无码一区二区app| 97精品伊人久久久大香线蕉| 久久婷婷国产麻豆91天堂| 久久青青草原国产精品免费| 久久久国产精品福利免费| 26uuu久久五月天| 久久婷婷人人澡人人| 久久亚洲欧洲国产综合| 婷婷久久综合九色综合绿巨人| 久久久黄色大片|