题意:给定一个正n多边形,从它的顶点1引出一条射线,当碰到边、顶点反弹光线,问最后可以把多边形分成多少个区域。
规律 -> (n-2) * (n-2)
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#define LL long long
#define INF 0x3f3f3f3f
#define debug printf("1\n")
using namespace std;
int main()
{
LL n;
while(scanf("%lld", &n) != EOF)
{
printf("%lld\n", (n-2)*(n-2));
}
return 0;
}
探讨了在一个正多边形内部通过特定规则绘制射线,将多边形分割成多个区域的问题。目标是最小化从一个区域到另一个区域所需的跳跃次数。

437

被折叠的 条评论
为什么被折叠?



