随笔分类 -  计算几何

摘要:DescriptionYour friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are forced to save money on buying fence posts by using trees as fence posts wherever possible. Given the locations of some trees, you are to he 阅读全文
posted @ 2013-11-09 20:58 Oyking 阅读(292) 评论(0) 推荐(0)
摘要:DescriptionBeing the only living descendant of his grandfather, Kamran the Believer inherited all of the grandpa's belongings. The most valuable one was a piece of convex polygon shaped farm in the grandpa's birth village. The farm was originally separated from the neighboring farms by a thi 阅读全文
posted @ 2013-11-09 20:40 Oyking 阅读(331) 评论(0) 推荐(0)
摘要:DescriptionIt's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two wooden boards on the wall of his barn. Shown in the pictures below, the two boards on the wall just look like two segments on the plane, as they have the same width.Your mission is 阅读全文
posted @ 2013-11-09 17:49 Oyking 阅读(268) 评论(0) 推荐(0)
摘要:DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) intersect in a line because they are on top of one another (i.e. they are the same line), 3) inter 阅读全文
posted @ 2013-11-08 22:39 Oyking 阅读(250) 评论(0) 推荐(0)
摘要:DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that there is no stick on top of them. Stan has noticed that the last thrown stick is always on top but he 阅读全文
posted @ 2013-11-08 20:45 Oyking 阅读(271) 评论(0) 推荐(0)
摘要:DescriptionThe most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y1999 and called it M11. It has only one eye on the left side of its head and just three feet all on the right side of its body and suffers from th 阅读全文
posted @ 2013-11-08 17:34 Oyking 阅读(316) 评论(0) 推荐(0)
摘要:DescriptionThere are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the largest distance between any two points would be minimum. And also, we require you to calculate that minimum distance. We guarantee that no two points will move in 阅读全文
posted @ 2013-09-12 22:57 Oyking 阅读(274) 评论(0) 推荐(0)
摘要:Input: Standard Input Output: Standard Output� There is a rectangle on the cartesian plane, with bottom-left corner at (0,0) and top-right corner at(L,W). There is a ball centered at(x,y), with radius=R, shown belowAt time 0, the ball starts to move along a ray with polar anglea(the angle from posit 阅读全文
posted @ 2013-08-23 21:19 Oyking 阅读(361) 评论(0) 推荐(0)
摘要:1、凸包 1 inline bool cmp(const POINT &a, const POINT &b) { 2 if(a.y == b.y) return a.x = 0; 8 } 9 10 inline double dist(POINT &a, POINT &b) {11 return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));12 }13 14 void Graham_scan() {15 std::sort(p, p + n, cmp);16 top = 1;17... 阅读全文
posted @ 2013-08-19 23:32 Oyking 阅读(398) 评论(0) 推荐(0)
摘要:DescriptionThe city of M is a famous shopping city and its open-air shopping malls are extremely attractive. During the tourist seasons, thousands of people crowded into these shopping malls and enjoy the vary-different shopping.Unfortunately, the climate has changed little by little and now rainy d 阅读全文
posted @ 2013-08-16 22:52 Oyking 阅读(294) 评论(0) 推荐(0)
摘要:一、代码: 1、求逆元(原理貌似就是拓展欧几里得,要求MOD是素数): 2、底层优化(正确性未验证): 3、扩栈,这玩意儿在OJ上用能防爆? 4、神速读入fread 二、神牛blog matrix67 ZKW watashi 三、专题 动态规划系列: 数位dp模板 字符串系列: 【专辑】AC自动机 阅读全文
posted @ 2013-08-14 23:48 Oyking 阅读(1316) 评论(0) 推荐(0)
摘要:DescriptionOnce upon a time, in a faraway land, there lived a king. This king owned a small collection of rare and valuable trees, which had been gathered by his ancestors on their travels. To protect his trees from thieves, the king ordered that a high fence be built around them. His wizard was put 阅读全文
posted @ 2013-07-23 12:55 Oyking 阅读(330) 评论(0) 推荐(0)
摘要:DescriptionDuring a voyage of the starship Hakodate-maru (see Problem 1406), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of "super stars". Do not take this term as a description of actors or singers. It is a revo 阅读全文
posted @ 2013-07-22 18:17 Oyking 阅读(629) 评论(0) 推荐(0)
摘要:Problem DescriptionEach person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would rather not happened.The world king Sconbin is not the exception.One day,Sconbin was sleep 阅读全文
posted @ 2013-07-21 22:50 Oyking 阅读(323) 评论(0) 推荐(0)
摘要:Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircl... 阅读全文
posted @ 2013-07-18 18:39 Oyking 阅读(283) 评论(0) 推荐(0)
摘要:DescriptionAfter successive failures in the battles against the Union, the Empire retreated to its last stronghold. Depending on its powerful defense system, the Empire repelled the six waves of Union's attack. After several sleepless nights of thinking, Arthur, General of the Union, noticed tha 阅读全文
posted @ 2013-07-17 23:27 Oyking 阅读(1819) 评论(3) 推荐(1)
摘要:DescriptionThousands of thousands years ago there was a small kingdom located in the middle of the Pacific Ocean. The territory of the kingdom consists two separated islands. Due to the impact of the ocean current, the shapes of both the islands became convex polygons. The king of the kingdom wanted 阅读全文
posted @ 2013-07-17 21:53 Oyking 阅读(286) 评论(0) 推荐(0)
摘要:DescriptionFeng shui is the ancient Chinese practice of placement and arrangement of space to achieve harmony with the environment. George has recently got interested in it, and now wants to apply it to his home and bring harmony to it.There is a practice which says that bare floor is bad for living 阅读全文
posted @ 2013-07-17 12:37 Oyking 阅读(497) 评论(0) 推荐(0)
摘要:DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he would not listen to his Architect's proposals to build a beautiful brick wall with a perfect shape and nice tall towers. Instead, he o 阅读全文
posted @ 2013-07-16 13:58 Oyking 阅读(256) 评论(0) 推荐(0)
摘要:DescriptionGivennsegments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at least one point in common.InputInput begins with a numberTshowing the number of test cases and then,Ttest c 阅读全文
posted @ 2013-07-14 21:13 Oyking 阅读(279) 评论(0) 推荐(0)