提交时间:2022-07-20 11:52:20

运行 ID: 52768

//shuffle #include <bits/stdc++.h> using namespace std; typedef long double ll; ll n,a,b,f[1005],check; inline ll A(int n,int m) { ll ans=1; for(ll i=m; i>=n; i--) ans*=i; return ans; } int main() { cin>>n>>a>>b; for(int i=1; i<=n; i++) { cin>>f[i]; if(f[i]!=i) check=1; } if(check==0) { cout<<0<<endl; exit(0); } ll s=A(1,n); if(s*b>a*n) cout<<a*n<<endl; else cout<<s*b<<endl; return 0; }