提交时间:2023-08-09 17:33:12

运行 ID: 81632

#include<bits/stdc++.h> using namespace std; int n; int t; 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=1; for(int i=2;i<=x;i++){ k*=2; } return k; } 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; }