malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long n, k, m, x[500010], y[500010], xx[500010], yy[500010], zz[500010];   const long long N = 2e6 + 10;   struct link {     long long top, fi[N], to[N], la[N], ne[N];     void clear() {       top = 0, memset(fi, 0, sizeof fi), memset(la, 0, sizeof la),       memset(to, 0, sizeof to), memset(ne, 0, sizeof ne);     }     void add(long long x, long long y) {       top++, to[top] = y;       if (fi[x] == 0)         fi[x] = top;       else         ne[la[x]] = top;       la[x] = top;     }   } L;   long long fa[N], vis[N], FA[N], dep[N], need[N], cost[N], out;   long long find(long long x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }   void dfs(long long x) {     vis[x] = 1;     for (long long i = L.fi[x]; i; i = L.ne[i])       if (L.to[i] != FA[x]) {         dep[L.to[i]] = dep[x] + 1;         need[L.to[i]] = (i <= (k * 2));         FA[L.to[i]] = x;         dfs(L.to[i]);       }   }   signed main() {     scanf( %lld%lld%lld , &n, &k, &m);     L.clear();     for (long long i = 1; i <= n; i++) fa[i] = i;     for (long long i = 1; i <= k; i++) {       scanf( %lld%lld , &x[i], &y[i]);       long long fx = find(x[i]), fy = find(y[i]);       fa[fx] = fy;       L.add(x[i], y[i]);       L.add(y[i], x[i]);     }     for (long long i = 1; i <= m; i++) {       scanf( %lld%lld%lld , &xx[i], &yy[i], &zz[i]);       long long fx = find(xx[i]), fy = find(yy[i]);       if (fx != fy) {         L.add(xx[i], yy[i]);         L.add(yy[i], xx[i]);         fa[fx] = fy;       }     }     dfs(1);     for (long long i = 1; i <= n; i++) fa[i] = i;     for (long long i = 1; i <= m; i++) {       long long fx = find(xx[i]), fy = find(yy[i]);       while (fx != fy) {         if (dep[fx] < dep[fy]) swap(fx, fy);         cost[fx] = zz[i];         fa[fx] = FA[fx];         fx = find(fx);       }     }     for (long long i = 1; i <= n; i++)       if (need[i]) {         if (!cost[i]) {           puts( -1 );           return 0;         }         out += cost[i];       }     printf( %lld , out);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x1, y1, x2, y2, x3, y3, x4, y4;     cin >> x1 >> y1 >> x2 >> y2;     int x_diff = x1 - x2;     int y_diff = y1 - y2;     if (x_diff != 0 and y_diff != 0) {       x3 = x1;       y3 = y2;       x4 = x2;       y4 = y1;     } else if (x_diff != 0) {       x3 = x1;       y3 = y1 + abs(x_diff);       x4 = x2;       y4 = y2 + abs(x_diff);     } else {       x3 = x1 + abs(y_diff);       y3 = y1;       x4 = x2 + abs(y_diff);       y4 = y2;     }     if (x_diff != 0 and y_diff != 0 and abs(x_diff) != abs(y_diff))       cout << -1 << endl;     else       cout << x3 <<     << y3 <<     << x4 <<     << y4 << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 3e5 + 7;   const int mod = 1e9 + 7;   int n;   long long p[N];   long long sz[N];   vector<pair<int, int> > v[N];   void dfs(int x, int pp) {     sz[x] = 1;     for (auto y : v[x]) {       if (y.first != pp) {         dfs(y.first, x);         p[y.first] = y.second;         sz[x] += sz[y.first];       }     }   }   void solve1() {     cin >> n;     for (int i = 1; i <= 2 * n; i++) {       v[i].clear();       sz[i] = 0;       p[i] = 0;     }     vector<pair<int, pair<int, int> > > g;     for (int i = 1; i < 2 * n; i++) {       int x, y, z;       cin >> x >> y >> z;       v[x].push_back({y, z});       v[y].push_back({x, z});       g.push_back({x, {y, z}});     }     dfs(1, 1);     long long mn = 0;     long long mx = 0;     for (int i = 2; i <= 2 * n; i++) {       mx = mx + min(sz[i], n + n - sz[i]) * p[i];       if ((sz[i] & 1)) {         mn += p[i];       }     }     cout << mn <<     << mx <<   n ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     srand(time(0));     int cghf = 1;     cin >> cghf;     while (cghf--) {       solve1();     }   }
#include <bits/stdc++.h>   #pragma warning(disable : 4996 4018)   using namespace std;   int n, k, p, pep[1000], key[2000];   int main() {     cin.tie(0);     ios_base::sync_with_stdio(0);     cin >> n >> k >> p;     for (int i = 0; i < n; i++) cin >> pep[i];     for (int i = 0; i < k; i++) cin >> key[i];     int ans = INT_MAX;     sort(pep, pep + n);     sort(key, key + k);     for (int i = 0; i < k && k - i >= n; i++) {       int mx = 0;       for (int e = 0; e + i < k && e < n; e++)         mx = max(mx, abs(pep[e] - key[i + e]) + abs(p - key[i + e]));       ans = min(ans, mx);     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int ans[1 << 20];   void go(vector<int> Q) {     if (Q.empty()) return;     if (Q.size() == 1) {       cout << Q[0] <<    ;       return;     }     int hi = (int)Q.size() - 1;     int p = 0;     while ((1 << p) - 1 < hi) p++;     if ((1 << p) - 1 > hi) {       p--;       for (int j = (1 << p); j < (int)Q.size(); j++) swap(Q[j], Q[j - (1 << p)]);     }     for (int i = 0; i < (1 << p); i++) cout << Q[i ^ ((1 << p) - 1)] <<    ;     vector<int> QQ;     for (int i = (1 << p); i < (int)Q.size(); i++) QQ.push_back(Q[i]);     go(QQ);   }   int main() {     ios_base::sync_with_stdio(false);     cin >> n;     cout << ((long long)n * (n + 1)) << endl;     vector<int> Q;     for (int i = 0; i <= n; i++) Q.push_back(i);     go(Q);     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX_N = 1e6;   char s[MAX_N + 1];   int len;   vector<int> ans;   void go(int i) {     if (i == len) return;     if (s[i] ==  l ) {       go(i + 1);       ans.push_back(i + 1);     } else {       ans.push_back(i + 1);       go(i + 1);     }   }   int main() {     scanf( %s , s);     len = strlen(s);     go(0);     for (int x : ans) {       printf( %d n , x);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 5;   map<int, pair<char, int> > m;   int main() {     long long n, q;     scanf( %lld%lld , &n, &q);     m[0] = make_pair( U , 0);     m[n + 1] = make_pair( L , 0);     while (q--) {       long long x, y;       string s;       scanf( %lld%lld , &x, &y);       cin >> s;       auto it = m.lower_bound(x);       if (it->first == x) {         puts( 0 );         continue;       }       if (s[0] ==  L ) it--;       long long ans = abs((it->first) - x);       if (it->second.first == s[0]) ans += it->second.second;       printf( %lld n , ans);       m[x] = make_pair(s[0], ans);     }     return 0;   }
#include <bits/stdc++.h>   const int N = 200 + 10, MOD = 1000000007;   int n;   std::pair<int, int> poly[N];   long long sum[N];   inline long long Cross(const std::pair<int, int> &a,                          const std::pair<int, int> &b) {     return (long long)a.first * b.second - (long long)a.second * b.first;   }   int mem[N][N];   inline long long Area(int l, int r) {     return llabs(sum[r - 1] - sum[l - 1] + Cross(poly[r], poly[l]));   }   inline long long Area(const std::pair<int, int> &a,                         const std::pair<int, int> &b,                         const std::pair<int, int> &c) {     return llabs(Cross(a, b) + Cross(b, c) + Cross(c, a));   }   int Solve(int l, int r) {     int &res = mem[l][r];     if (~res) return res;     if (r - l < 2) return res = 1;     res = 0;     for (int i = l + 1; i < r; ++i) {       long long temp = Area(poly[l], poly[i], poly[r]);       if (temp && Area(l, i) + Area(i, r) + temp == Area(l, r))         (res += (long long)Solve(l, i) * Solve(i, r) % MOD) %= MOD;     }     return res;   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) scanf( %d%d , &poly[i].first, &poly[i].second);     for (int i = 1; i <= n; ++i)       sum[i] = sum[i - 1] + Cross(poly[i], poly[i % n + 1]);     memset(mem, -1, sizeof mem);     printf( %d n , Solve(1, n));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int nax = 2e6 + 7;   long long n, x, l, r, db, m;   long long temp[nax];   vector<pair<long long, long long> > v;   long long calculate(long long n, long long db) {     long long r = 1;     for (int i = 1; i <= n; i++) {       temp[i] = i;     }     for (int i = 1; i <= n; i++) {       while (db > 0 && temp[i] % 2 == 0) {         db--;         temp[i] /= 2;       }     }     for (int i = 1; i <= n; i++) {       r = (r * temp[i]) % m;     }     return r;   }   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> x;       v.push_back({x, i});     }     for (int i = 1; i <= n; i++) {       cin >> x;       v.push_back({x, i});     }     sort(v.begin(), v.end());     cin >> m;     l = 1, r = 1, db = 0;     for (int i = 1; i < v.size(); i++) {       if (v[i].first != v[i - 1].first) {         r = r * calculate(l, db) % m;         l = 1;         db = 0;       } else {         l++;         if (v[i].second == v[i - 1].second) db++;       }     }     r = r * calculate(l, db) % m;     cout << r << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-10;   const int INF = 0x7fffffff;   const long long oo = 1e18;   const int N = 106;   const double pi = acos(-1.0);   int n, ans = 1, now;   char c;   int main() {     scanf( %d , &n);     for (int i = 1; i < n; i++) {       scanf(  %c , &c);       now = c -  0 ;       if (now)         ans++;       else         break;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x;     cin >> x;     vector<int> used(1000000, 0);     vector<int> len(1000000, 5);     queue<int> q;     q.push(x);     used[x] = 1;     len[x] = 0;     while (!q.empty()) {       int v = q.front(), v1 = v;       q.pop();       vector<int> res(6);       for (int i = 5; i >= 0; i--) {         res[i] = v1 % 10;         v1 /= 10;       }       if (res[0] + res[1] + res[2] == res[3] + res[4] + res[5]) {         cout << len[v];         return 0;       }       for (int i = 0; i < 6; ++i) {         for (int j = 0; j <= 9; ++j) {           if (j != res[i]) {             int to = 0;             for (int i1 = 0; i1 < 6; ++i1) {               if (i1 != i)                 to = to * 10 + res[i1];               else                 to = to * 10 + j;             }             if (used[to] == 0) {               used[to] = 1;               q.push(to);               len[to] = len[v] + 1;             }           }         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char buf[10001], buf2[1000001];   int tab[100001][26];   int main() {     scanf( %s %s , buf, buf2);     int len = strlen(buf), len2 = strlen(buf2);     for (int i = 0; i < 26; i++) tab[len - 1][i] = -1;     for (int ti = 2 * len - 2; ti >= 0; ti--) {       int i = ti % len;       for (int j = 0; j < 26; j++)         tab[i][j] = buf[i] ==  a  + j ? i : tab[(i + 1) % len][j];     }     for (int i = 0; i < len; i++) {       for (int j = 0; j < 26; j++)         if (tab[i][j] != -1)           ;       ;     }     int ind = len - 1, loop = 0;     for (int i = 0; i < len2; i++) {       int c = buf2[i] -  a ;       int newind = tab[(ind + 1) % len][c];       ;       if (newind <= ind) loop++;       if (newind == -1) {         printf( -1 n );         return 0;       }       ind = newind;     }     printf( %d n , loop);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a, b, x;     cin >> a >> b >> x;     string s;     if (x > 1) {       for (int i = 0; i < x / 2; i++) {         if (a > b) {           s +=  0 ;           b--;           s +=  1 ;           a--;         } else {           s +=  1 ;           a--;           s +=  0 ;           b--;         }       }     }     if (x > 1 && x % 2 == 1 && s[s.size() - 1] ==  0 ) {       s +=  1 ;       b--;     } else if (x > 1 && x % 2 == 1 && s[s.size() - 1] ==  1 ) {       s +=  0 ;       a--;     }     if (s.size() != 0 && s.size() != 0) {       if (s[s.size() - 1] ==  0 ) {         while (a > 0) {           s +=  0 ;           a--;         }         while (b > 0) {           s +=  1 ;           b--;         }       } else {         while (b > 0) {           s +=  1 ;           b--;         }         while (a > 0) {           s +=  0 ;           a--;         }       }     } else {       if (a >= b) {         while (a > 0) {           s +=  0 ;           a--;         }         while (b > 0) {           s +=  1 ;           b--;         }       } else {         while (b > 0) {           s +=  1 ;           b--;         }         while (a > 0) {           s +=  0 ;           a--;         }       }     }     cout << s;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /stack:16777216 )   using namespace std;   const int INF = 1000000000;   const int MAX = 1000006;   const int MAX2 = 207;   const int BASE = 1000000000;   const int CNT = 500;   const int MOD = 1000000007;   vector<int> g[MAX];   int sz[MAX];   double ans[MAX];   void dfs(int v, int p) {     sz[v] = 1;     for (int i = (0); i < (g[v].size()); ++i) {       int to = g[v][i];       if (to == p) {         continue;       }       dfs(to, v);       sz[v] += sz[to];     }   }   void dfs2(int v, int p) {     if (p == -1) {       ans[v] = 1;     } else {       int ps = sz[p] - 1;       int mysz = sz[v];       ans[v] = ans[p] + 1 + (ps - mysz) * 0.5;     }     for (int i = (0); i < (g[v].size()); ++i) {       int to = g[v][i];       if (to == p) {         continue;       }       dfs2(to, v);     }   }   int main() {     int n;     cin >> n;     for (int i = (1); i < (n); ++i) {       int v;       cin >> v;       --v;       g[v].push_back(i);       g[i].push_back(v);     }     dfs(0, -1);     dfs2(0, -1);     for (int i = (0); i < (n); ++i) printf( %.8lf  , ans[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     map<char, string> mp = {{ > ,  1000 }, { < ,  1001 }, { + ,  1010 },                             { - ,  1011 }, { . ,  1100 }, { , ,  1101 },                             { [ ,  1110 }, { ] ,  1111 }};     string in;     cin >> in;     string s;     for (int i = 0; i < in.length(); i++) {       s += mp[in[i]];     }     int sum = 0;     int p = 1;     for (int i = s.length() - 1; i >= 0; i--) {       sum += (p * (s[i] -  0 )) % (int)(1e6 + 3);       sum %= (int)(1e6 + 3);       p *= 2;       p %= (int)(1e6 + 3);     }     cout << sum << endl;   }
#include <bits/stdc++.h>   using namespace std;   #pragma comment(linker,  /STACK:102400000,102400000 )   const int N = 205;   int n;   long long a[N];   map<long long, int> mp;   vector<int> G[N], ans;   bool vis[N];   bool dfs(int u, int step) {     if (step == n) {       ans.push_back(u);       return true;     }     vis[u] = true;     for (int to : G[u])       if (!vis[to]) {         if (dfs(to, step + 1)) {           ans.push_back(u);           return true;         }       }     vis[u] = false;     return false;   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) scanf( %lld , &a[i]), mp[a[i]] = i;     for (int i = 1; i <= n; ++i) {       if (a[i] % 3 == 0) {         if (mp.find(a[i] / 3) != mp.end()) G[mp[a[i] / 3]].push_back(i);       }       if (mp.find(a[i] * 2) != mp.end()) G[mp[a[i] * 2]].push_back(i);     }     for (int i = 1; i <= n; ++i) {       memset(vis, false, sizeof(vis));       if (dfs(i, 1)) {         for (int v : ans) printf( %lld  , a[v]);         break;       }     }     return 0;   }
#include <cstdio>   #include <iostream>   using namespace std;   const int M = 20005;   const int N = 31;   #define make make_pair   #define pii pair<int,int>   int read()   {    int x=0,f=1;char c;    while((c=getchar())< 0  || c> 9 ) {if(c== - ) f=-1;}    while(c>= 0  && c<= 9 ) {x=(x<<3)+(x<<1)+(c^48);c=getchar();}    return x*f;   }   int n,q,a[M],lg[M],f[M][20][N],g[N],tmp[N];pii dp[M][20];   //f[i][j][k]:stand for the max (l+al) can reach from i through 2^j jumps and k delete    int ask(int l,int r)//ask the l of max (l+al)    {    int k=lg[r-l+1];    return max(dp[l][k],dp[r-(1<<k)+1][k]).second;   }   void init()   {    for(int j=1;(1<<j)<=n;j++)//st     for(int i=1;i+(1<<j)-1<=n;i++)      dp[i][j]=max(dp[i][j-1],dp[i+(1<<j-1)][j-1]);    for(int i=1;i<=n;i++)     for(int j=0;j<N;j++)      f[i][0][j]=min(n,i+a[i]+j);//this  min  is necessary    for(int j=1;(1<<j)<=n;j++)     for(int i=1;i<=n;i++)//please don t limit the range of i      for(int k=0;k<N;k++)       for(int x=0;x<=k;x++)       {        int t=ask(i,f[i][j-1][x]);//find the position        f[i][j][k]=max(f[i][j][k],f[t][j-1][k-x]);       }   }   signed main()   {    n=read();q=read();    for(int i=1;i<=n;i++)    {     a[i]=read();     dp[i][0]=make(min(n,a[i]+i),i);     if(i>1) lg[i]=lg[i>>1]+1;    }    init();    while(q--)    {     int l=read(),r=read(),k=read(),ans=0;     if(l==r) {puts( 0 );continue;}     if(l+a[l]+k>=r) {puts( 1 );continue;}     for(int i=0;i<=k;i++) g[i]=l;     for(int x=15;x>=0;x--)     {      if((1<<x)>n) continue;      for(int i=0;i<=k;i++) tmp[i]=g[i];      for(int i=0;i<=k;i++)      {       int t=ask(l,g[i]);       for(int j=0;i+j<=k;j++)        tmp[i+j]=max(tmp[i+j],f[t][x][j]);      }      int fl=0;      for(int i=0;i<=k;i++)       if(tmp[i]>=r) fl=1;      if(fl) continue;      for(int i=0;i<=k;i++) g[i]=tmp[i];      ans+=(1<<x);     }     printf( %d n ,ans+1);    }   }
#include <bits/stdc++.h>   using namespace std;   int now[5 * 100010], after[5 * 100010], mx[5 * 100010];   int lft[5 * 100010], rgt[5 * 100010], vi[5 * 100010], timer = 0, comp = 0;   long long Add[5 * 100010];   vector<int> g[5 * 100010];   stack<int> stk;   inline void dfs(int c, int p) {     vi[c] = 1;     now[c] = after[c] = ++timer;     stk.push(c);     for (auto x : g[c]) {       if (x != p) {         if (!vi[x]) {           dfs(x, c);           now[c] = min(now[c], now[x]);         } else           now[c] = min(now[c], now[x]);       }     }     if (now[c] == after[c]) {       lft[comp] = rgt[comp] = c;       while (1) {         int node = stk.top();         lft[comp] = min(lft[comp], node);         rgt[comp] = max(rgt[comp], node);         if (node == c) break;         stk.pop();       }       stk.pop();       comp++;     }   }   int main() {     int n, m;     scanf( %d , &n);     ;     scanf( %d , &m);     ;     memset(vi, 0, sizeof(vi));     ;     for (int x = 1; x <= m; x++) {       int u, v;       scanf( %d , &u);       ;       scanf( %d , &v);       ;       g[u].emplace_back(v);       g[v].emplace_back(u);     }     for (int x = 1; x <= n; x++)       if (!vi[x]) dfs(x, 0);     for (int x = 1; x <= n; x++) mx[x] = n;     for (int x = 0; x < comp; x++)       if (lft[x] != rgt[x]) mx[lft[x]] = rgt[x] - 1;     for (int x = n - 1; x >= 1; x--) mx[x] = min(mx[x + 1], mx[x]);     for (int x = 1; x <= n; x++) Add[x] = Add[x - 1] + mx[x] - x + 1;     int q;     scanf( %d , &q);     ;     while (q--) {       int from, to;       scanf( %d , &from);       ;       scanf( %d , &to);       ;       int l = from - 1, r = to + 1, chk = from;       while (l + 1 < r) {         int m = l + r >> 1;         if (mx[m] > to)           r = m;         else           chk = max(chk, m), l = m;       }       chk = l;       printf( %lld n ,              Add[chk] - Add[from - 1] + 1LL * (to - chk) * (to - chk + 1LL) / 2);     }   }
#include <bits/stdc++.h>   using namespace std;   int n, x, v[110];   int main() {     cin >> n;     for (int i = 1; i <= n; i++) cin >> v[i];     for (int i = 2; i <= n; i++) {       if (v[i] == 1) {         if (v[i - 1] == 1) cout <<  Infinite , exit(0);         if (v[i - 1] == 2) x += 3;         if (v[i - 1] == 3) x += 4;       }       if (v[i] == 2) {         if (v[i - 1] == 1) x += (v[i - 2] == 3 ? 2 : 3);         if (v[i - 1] == 2) cout <<  Infinite , exit(0);         if (v[i - 1] == 3) cout <<  Infinite , exit(0);       }       if (v[i] == 3) {         if (v[i - 1] == 1) x += 4;         if (v[i - 1] == 2) cout <<  Infinite , exit(0);         if (v[i - 1] == 3) cout <<  Infinite , exit(0);       }     }     cout <<  Finite n  << x;   }
#include <bits/stdc++.h>   using namespace std;   ifstream fin( in.in );   ofstream fout( out.out );   const int N = 1e5 + 10;   int n, m, erased[N], cnt[N], rem[N];   vector<int> a[N], v[N];   deque<vector<int> > ind[N];   queue<int> q;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         int x;         cin >> x;         a[i].push_back(x);         if (x != -1)           v[i].push_back(x);         else           erased[j]++;       }       sort(v[i].begin(), v[i].end());       v[i].resize(unique(v[i].begin(), v[i].end()) - v[i].begin());       vector<int> vec;       for (int j = 0; j < v[i].size(); j++) ind[i].push_back(vec);       for (int j = 0; j < m; j++)         if (a[i][j] != -1)           ind[i][lower_bound(v[i].begin(), v[i].end(), a[i][j]) - v[i].begin()]               .push_back(j);     }     vector<int> res;     for (int i = 0; i < m; i++)       if (erased[i] == n) res.push_back(i + 1);     while (res.size() < m) {       for (int i = 0; i < n; i++) {         if (rem[i] || ind[i].empty()) continue;         rem[i] = ind[i][0].size();         for (int j = 0; j < ind[i][0].size(); j++) {           int k = ind[i][0][j];           cnt[k]++;           if (cnt[k] == n - erased[k]) q.push(k);         }         ind[i].pop_front();       }       if (q.empty()) break;       while (!q.empty()) {         int j = q.front();         q.pop();         res.push_back(j + 1);         for (int i = 0; i < n; i++)           if (a[i][j] != -1) rem[i]--;       }     }     if (res.size() < m)       cout << -1;     else       for (int i = 0; i < res.size(); i++) cout << res[i] <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a, b;     cin >> a >> b;     int ans = 1;     if (a > b) {       for (int i = b; i >= 1; i--) {         ans *= i;       }     } else {       for (int i = a; i >= 1; i--) {         ans *= i;       }     }     cout << ans;     return 0;   }