⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pku1106.cpp

📁 这是ACM 方面的资料 是PKU的 北京大学的出来的
💻 CPP
字号:
#include <stdio.h>
#include <stdlib.h>

typedef struct 
{
	int x, y;
} Point;

int main()
{
	int i, j;
	int x0, y0, x, y, n, p, max, q;
	double r, PI;
	Point po[151];
	
	PI = acos(-1);
	while (scanf("%d %d %lf", &x0, &y0, &r) != -1 && r > 0)
	{
		scanf("%d", &n);

		for (i = 0, j = 0; i < n; i++)
		{
			scanf("%d%d", &x, &y);
			if ((x - x0) * (x - x0) + (y - y0) * (y - y0) <= r * r)
			{
				po[j].x = x - x0;
				po[j].y = y - y0;
				j++;
			}
		}
		p = j;
		
		for (i = 0, max = 0; i < p; i++)
		{
			for (j = 0, q = 0; j < p; j++)
			{
				if (po[i].x * po[j].y >= po[j].x * po[i].y)
				{
					q++;
				}
			}
			if (q > max)
			{
				max = q;
			}
		}
		printf("%d\n", max);
	}
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -