2284: W-LINE
| Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
|---|---|---|---|---|---|
| 3s | 8192K | 221 | 129 | Standard |
There are n W-LINEs in the plane(see the picture). Now i want to ask what's the maximal possible areas can these W-LINEs separate the plane.Suppose the middle part of W-LINE is big enough and the two ends can extend infinete.
Input
The input contains several test cases. For each test case it contains a positive integer n (0 <= n <= 50). The end of input is indicated by end-of-file.Ouput
For each test case, output K, here K is the maximal possible areas W-LINEs can separate the plane.Sample Input
1 2 10
Sample Output
2 19 731

Problem Source: sharang
This problem is used for contest: 43 153
#include<stdio.h>
int main()
{
int i,n;
int a[60]={1};
a[1]=2;
for(i=2;i<=55;i++) a[i]=a[i-1]+16*(i-1)+1;
while(scanf("%d",&n)==1)
{
printf("%d/n",a[n]);
}
return 0;
}
本文探讨了使用W-LINE在平面上进行最大区域分割的问题,通过递推公式计算不同W-LINE数量下所能产生的最大区域数。输入为W-LINE的数量,输出则为最大可能的分割区域数。

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



