提交时间:2023-08-09 17:14:08
运行 ID: 81625
#include<bits/stdc++.h> using namespace std; int n; int t; int add_sqrt(int x){ unsigned long long k=0; for(int i=1;i<=x;i++){ unsigned long long k1; k1=i*i; k+=k1; } return k; } int to_edge(int x){ unsigned long long k=x+(x*(x-3))/2; return k; } int to_point(int x){ unsigned long long k=1; for(int i=x;i>=x-3;i--){ if(i) k*=i; } if(k%24==0) k/=24; else return 0; return k; } int to_area(int x){ unsigned long long k=2+add_sqrt(x-2); } int main(){ cin>>n>>t; if(n==1) cout<<to_edge(t); else if(n==2) cout<<to_point(t); else if(n==3) cout<<to_area(t); return 0; }