提交时间:2023-08-09 18:10:43
运行 ID: 81673
#include<bits/stdc++.h> using namespace std; int main(){ int t,n; cin>>t>>n; if(t==1) cout<<n*(n-1)/2; if(t==2){ if(n==2) cout<<0; else if(n==3) cout<<0; else if(n==4) cout<<1; else cout<<(n-3)*n/2; } if(t==3) cout<<pow(2,n-1); return 0; }