SGU 110. Dungeon 计算几何 难度:3】的更多相关文章

110. Dungeon time limit per test: 0.25 sec. memory limit per test: 4096 KB The mission of space explorers found on planet M the vast dungeon. One of the dungeon halls is fill with the bright spheres. The explorers find out that the light rays reflect…
这道题是计算几何,这是写的第一道计算几何,主要是难在如何求入射光线的反射光线. 我们可以用入射光线 - 入射光线在法线(交点到圆心的向量)上的投影*2 来计算反射光线,自己画一个图,非常清晰明了. 具体到程序里,我们可以 v2 = v1 - fa / Length(fa) * 2 * ( Dot(v1, fa) / Length(fa)) 来求,简单来说就是用内积(点积)求出入射光线在法线上的长度,然后用法线的单位向量乘这个长度就可以了. #include <cstdio> #include…
129. Inheritance time limit per test: 0.25 sec. memory limit per test: 4096 KB The old King decided to divide the Kingdom into parts among his three sons. Each part is a polygonal area. Taking into account the bad temper of the middle son the King ga…
124. Broken line time limit per test: 0.25 sec. memory limit per test: 4096 KB There is a closed broken line on a plane with sides parallel to coordinate axes, without self-crossings and self-contacts. The broken line consists of K segments. You have…
125. Shtirlits time limit per test: 0.25 sec. memory limit per test: 4096 KB There is a checkered field of size N x N cells (1 Ј N Ј 3). Each cell designates the territory of a state (i.e. N2 states). Each state has an army. Let A [i, j] be the numbe…
In geometry the Fermat point of a triangle, also called Torricelli point, is a point such that the total distance from the three vertices of the triangle to the point is the minimum. It is so named because this problem is first raised by Fermat in a…
F - Rotational Painting Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3685 Appoint description:  System Crawler  (2014-11-09) Description Josh Lyman is a gifted painter. One of his great works…
Cows Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7038   Accepted: 3242 Description Your friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are f…
http://acm.sgu.ru/problemset.php?contest=0&volume=1 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traffic Lights 最短路 104 Little Shop of Flowers 动态规划 105 Div 3 找规律 106 The Equation 扩展欧几里德 107 987654321 Problem 找规律 108 Self-numbers II 枚举+筛法递推 109 Magic of Dav…
传送门 话说去年的省选计算几何难度跟前几年比起来根本不能做啊(虽然去年考的时候并没有学过计算几何) 这题就是推个式子然后上半平面交就做完了. 什么? 怎么推式子? 先把题目的概率转换成求出可行区域. 然后用可行区域的面积比上总面积就是答案了. 我们设0号点(x1,y1)(x1,y1)(x1,y1),1号点(x2,y2)(x2,y2)(x2,y2),i号点(x3,y3)(x3,y3)(x3,y3),i+1号点(x4,y4)(x4,y4)(x4,y4) 然后由题可知cross(p0,p1)<cros…