BestCoder Round #50 (div.2) HDU 5365 Run(简单几何)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5365


题面:(严重吐槽,看着真不舒服,还是改一下吧)


Run

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 549    Accepted Submission(s): 245


Problem Description
    AFA is a girl who like s run ning. Today, she download ed an app about run ning .The app can record the trace of her run ning. AFA will start run ning in the park. There are many chairs in the park, and AFA will start his( her) run ning in a chair and end in this( another) chair. Between two chairs,she running( runs) in a line. she( She) want s the( /) the trace can ( to) be a regular triangle or a square or a regular pentagon or a regular hexagon.
Please tell her how many ways can her( she) find.
Two ways are same if the set of chair that they contains are same.
Two ways are same if chairs that two sets contains are the same.

Input
There are multiply( multiple) case s.
In each case,there is a n integer n(1 < = n < = 20)in a line.
In next n lines,there are two integers xi,yi(0 < = xi,yi < 9) in each line.
 

Output
Output the number of ways.
 

Sample Input
 
   
4 0 0 0 1 1 0 1 1
 

Sample Output
 
   
1
 

Source
BestCoder Round #50 (div.2)


题目大意:
    再给定的9*9方格线上有一些点,问能找到多少个正三角形,正方形,正五边形,正六边形。

解题:
    做的时候,已经猜到可能只有正方形才是可以的,只是来不及了,题解却说地球人都知道,无爱了....
    数据量这么小,怎么暴力怎么来咯!

代码:
#include   
#include 
#include 
using namespace std;
struct point
{
	int x,y;
}store[25];
//该位置是否有点标记
bool status[10][10];
//判断是否出界
bool inside(int x,int y)
{
	if(x>=0&&x<9&&y>=0&&y<9)
		return true;
	else
		return false;
}
int main()
{
    int t,tx1,ty1,tx2,ty2,tx3,ty3,ans,xd,yd;
	while(~scanf("%d",&t))
	{
		memset(status,0,sizeof(status));
		ans=0;
		for(int i=0;i




你可能感兴趣的:(编程题——几何)