Pick公式:平面上以格子点为顶点的简单多边形的面积=边上的点数/2+内部的点数+1. 代码如下: ---------------------------------------------------------------------------------------------------------------------------- #include<iostream> #include<string.h> #include<stdio.h> #inclu…
Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5227   Accepted: 2342 Description Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new resear…
poj 2954 Triangle 题意 给出一个三角形的三个点,问三角形内部有多少个整点. 解法 pick's law 一个多边形如果每个顶点都由整点构成,该多边形的面积为\(S\),该多边形边上的整点为\(L\),内部的整点为\(N\),则有: $ N + L/2 - 1 = S $ 而对于两个点\(A(x_1,y_1)\)与\(B(x_2,y_2)\),其边内部的整点数为:(不包含端点) $ gcd ( abs(x_1 - x_2) , abs(y_1 - y_2) ) - 1 $ 代码如…
Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see a triangle ABC. Point D, E and F divides the sides BC, CA and AB into ratio 1:2 respectively. That is CD=2BD, AE=2CE and BF=2AF. A, D; B, E and C, F…
The Circumference of the Circle Time Limit: 2 Seconds      Memory Limit: 65536 KB To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't? You are given the cartesian coordinates of…
The Center of Gravity Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3971    Accepted Submission(s): 2280 Problem Description Everyone know the story that how Newton discovered the Universal Gr…
Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5811   Accepted: 2589 Description Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new resear…
描述 Background Hello Earthling. We're from the planet Regetni and need your help to make lots of money. Maybe we'll even give you some of it. You see, the problem is that in our world, everything is about integers. It's even enforced by law. No other…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 32071 Accepted Submission(s): 16490 Problem Description " 改革春风吹满地, 不会AC没关系; 实在不行回老家, 还有一亩三分地. 谢谢!(乐队奏乐)" 话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,…
围困 Time Limit: 1000 MS     Memory Limit: 65536 K Total Submit: 360(138 users) Total Accepted: 157(129 users)   Rating:  Special Judge: No Description Leyni是一名猎人,一天他在草原中散步,遇到了三只老狼,三只老狼围成了一个三角形,如果Leyni在这个三角形中,那么他必死无疑,否则他还有一线生机. 现在已知三只老狼的坐标和Leyni的坐标,请问,…