解题思路:

刚开始看到这个题的时候就想列举出前几种数据,后来发现不知道公式的前提下很难推出下一个数是什么,其实这个公式并不好找,后来在离散数学中看到这样一个公式   F(平面的区域数)  =E(边数)-V(点数)+2

 

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long int LL;
LL C(LL n)
{
    return (n*(n-1)*(n-2)*(n-3))/24;
}
int main()
{
    LL n,flag;
    while(scanf("%lld",&n)!=EOF)
    {
        flag=C(n)+n*(n-1)/2+1;
        printf("%lld\n",flag);
    }
    return 0;
}