题意:给一个a,b,求 gcd(a!,b!),输出min(a,b)! 就可以了
AC代码:
#include<bits/stdc++.h> #include "iostream" #include "string.h" #include "stack" #include "queue" #include "string" #include "vector" #include "set" #include "map" #include "algorithm" #include "stdio.h" #include "math.h" #define ll long long #define bug(x) cout<<x<<" "<<"UUUUU"<<endl; #define mem(a) memset(a,0,sizeof(a)) #define mp(x,y) make_pair(x,y) #define pb push_back const long long INF = 1e18+1LL; const int inf = 1e9+1e8; using namespace std; const int N=1e5+100; ll a,b,ans=1; int main(){ cin>>a>>b; for(int i=2; i<=min(a,b); ++i){ ans*=i; } cout<<ans<<endl; return 0; }
时间: 2024-10-30 03:16:17