malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   inline long long MAX2(long long a, long long int b) {     return (a) > (b) ? (a) : (b);   }   inline long long MAX3(long long a, long long b, long long c) {     return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));   }   inline long long MIN2(long long a, long long b) {     return (a) < (b) ? (a) : (b);   }   inline long long MIN3(long long a, long long b, long long c) {     return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));   }   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int q;     cin >> q;     while (q--) {       int b, w;       cin >> b >> w;       vector<pair<int, int> > co;       if (b > w) {         if (b > 3 * w + 1) {           cout <<  NO n ;           continue;         }         int x = 1e5 + 1, y = 1e5 + 1;         int i = 0;         while (i < w - 1) {           co.push_back(pair<int, int>(x, y));           y++;           co.push_back(pair<int, int>(x, y));           y++;           i++;         }         co.push_back(pair<int, int>(x, y));         y++;         int si = co.size();         int req = b - w + 1;         i = 0;         while (i < si && req > 0) {           co.push_back(pair<int, int>(co[i].first - 1, co[i].second));           req--;           if (req == 0) break;           co.push_back(pair<int, int>(co[i].first + 1, co[i].second));           req--;           i += 2;         }         if (req > 0) {           co.push_back(pair<int, int>(co[0].first, co[0].second - 1));           req--;         }         if (req > 0) {           co.push_back(               pair<int, int>(co[2 * (w - 1)].first, co[2 * (w - 1)].second + 1));           req--;         }       } else {         if (w > 3 * b + 1) {           cout <<  NO n ;           continue;         }         int x = 1e5, y = 1e5 + 1;         int i = 0;         while (i < b - 1) {           co.push_back(pair<int, int>(x, y));           y++;           co.push_back(pair<int, int>(x, y));           y++;           i++;         }         co.push_back(pair<int, int>(x, y));         y++;         int si = co.size();         int req = w - b + 1;         i = 0;         while (i < si && req > 0) {           co.push_back(pair<int, int>(co[i].first - 1, co[i].second));           req--;           if (req == 0) break;           co.push_back(pair<int, int>(co[i].first + 1, co[i].second));           req--;           i += 2;         }         if (req > 0) {           co.push_back(pair<int, int>(co[0].first, co[0].second - 1));           req--;         }         if (req > 0) {           co.push_back(               pair<int, int>(co[2 * (b - 1)].first, co[2 * (b - 1)].second + 1));           req--;         }       }       cout <<  YES n ;       int i, si = co.size();       for (i = 0; i < si; i++) cout << co[i].first <<     << co[i].second <<   n ;     }     cerr <<   n           <<  Time elapsed :   << clock() * 1000.0 / CLOCKS_PER_SEC <<   ms           <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 200005;   inline int read() {     register int x = 0, w = 1, ch = getchar();     for (; ch <  0  || ch >  9 ; ch = getchar())       if (ch ==  - ) w = -1;     for (; ch >=  0  && ch <=  9 ; ch = getchar()) x = x * 10 + ch - 48;     return w * x;   }   int n, m, k, tot1, tot2, tot3, cnt;   long long s[maxn];   struct node {     int opt, id, x;     long long v, w;   } m1[maxn], m2[maxn], m3[maxn], ans[maxn];   inline bool cmp1(node a, node b) {     return (a.x != b.x) ? (a.x < b.x) : (a.v < b.v);   }   inline bool cmp2(node a, node b) {     return (a.x != b.x) ? (a.x < b.x) : (a.v > b.v);   }   inline bool cmp3(node a, node b) { return a.opt < b.opt; }   inline bool cmp4(node a, node b) { return a.v * b.w > a.w * b.v; }   int main() {     n = read(), m = read(), k = read();     for (int i = 1; i <= n; i++) s[i] = read();     for (int i = 1; i <= m; i++) {       int a = read(), b = read(), c = read();       if (a == 1 && c > s[b])         m1[++tot1] = (node){1, i, b, c, 1};       else if (a == 2)         m2[++tot2] = (node){2, i, b, c, 1};       else if (a == 3)         m3[++tot3] = (node){3, i, b, c, 1};     }     sort(m1 + 1, m1 + tot1 + 1, cmp1);     int tmp = 0;     for (int i = 1; i <= tot1; i++)       if (m1[i].x != m1[i + 1].x) m1[++tmp] = m1[i];     tot1 = tmp;     for (int i = 1; i <= tot1; i++)       m1[i].v = m1[i].v - s[m1[i].x], m2[++tot2] = m1[i];     sort(m2 + 1, m2 + tot2 + 1, cmp2);     long long sum = 0;     for (int i = 1; i <= tot2; i++) {       if (m2[i].x != m2[i - 1].x) sum = s[m2[i].x];       m2[i].w = sum, sum += m2[i].v;     }     for (int i = 1; i <= tot3; i++) m3[i].v--;     for (int i = 1; i <= tot2; i++) m3[++tot3] = m2[i];     sort(m3 + 1, m3 + tot3 + 1, cmp4);     tmp = min(tot3, k);     for (int i = 1; i <= tmp; i++) ans[++cnt] = m3[i];     printf( %d n , cnt);     sort(ans + 1, ans + cnt + 1, cmp3);     for (int i = 1; i <= cnt; i++) printf( %d  , ans[i].id);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, k;   struct kni {     int p, c, id;     long long ans;   } a[100005];   long long s[100005];   inline char nc() {     static char buf[10001], *p1 = buf, *p2 = buf;     return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 10000, stdin), p1 == p2)                ? EOF                : *p1++;   }   inline int read() {     register int s = 0, w = 1;     register char c = nc();     while (c <  0  || c >  9 ) {       if (c ==  - ) w = -1;       c = nc();     }     while (c >=  0  && c <=  9 ) s = (s << 1) + (s << 3) + c - 48, c = nc();     return s * w;   }   inline void print(long long x) {     if (x < 0) putchar( - ), x = -x;     if (x > 9) print(x / 10);     putchar(x % 10 + 48);   }   inline bool cmp(const kni &a, const kni &b) { return a.p < b.p; }   inline bool cmp2(const kni &a, const kni &b) { return a.id < b.id; }   int main() {     n = read();     k = read();     for (int i = 1; i <= n; ++i) a[i].p = read(), a[i].id = i;     for (int i = 1; i <= n; ++i) a[i].c = read();     sort(a + 1, a + n + 1, cmp);     priority_queue<long long, vector<long long>, greater<long long> > q;     for (int i = 1; i <= n; ++i) {       if (i <= k)         q.push(a[i].c), s[i] = s[i - 1] + a[i].c;       else if (k) {         if (q.top() < a[i].c) {           s[i] = s[i - 1] + a[i].c - q.top();           q.pop();           q.push(a[i].c);         } else           s[i] = s[i - 1];       }       a[i].ans = a[i].c + s[i - 1];     }     sort(a + 1, a + n + 1, cmp2);     for (int i = 1; i <= n; ++i) print(a[i].ans), putchar(   );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   namespace TYC {   const int N = 17, MX = (1 << 13) + 100, Q = 110;   int n, m, q, edge[N][N], a[Q], b[Q], lca[Q], bin[N], from[N], to[N];   long long dp[N][MX];   bool intree(int tree, int node) { return tree & bin[node]; }   long long dfs(int root, int tree) {     long long &ans = dp[root][tree];     if (~ans) return ans;     ans = 0;     int sub = tree ^ bin[root];     int x = 1;     for (; x <= n; x++)       if (intree(sub, x)) break;     for (int Subtree = sub; Subtree; Subtree = (Subtree - 1) & sub) {       if (!intree(Subtree, x)) continue;       bool flag = false;       for (int i = 1; i <= m; i++)         if (from[i] != root && to[i] != root &&             intree(Subtree, from[i]) != intree(Subtree, to[i])) {           flag = true;           break;         }       if (flag) continue;       for (int i = 1; i <= q; i++) {         if (lca[i] == root && intree(Subtree, a[i]) && intree(Subtree, b[i])) {           flag = true;           break;         }         if (intree(Subtree, lca[i]) &&             (!intree(Subtree, a[i]) || !intree(Subtree, b[i]))) {           flag = true;           break;         }       }       if (flag) continue;       int num = 0, son;       for (int i = 1; i <= n; i++)         if (intree(Subtree, i) && edge[root][i]) num++, son = i;       if (num > 1) continue;       if (!num) {         for (int i = 1; i <= n; i++)           if (intree(Subtree, i))             ans += dfs(i, Subtree) * dfs(root, tree ^ Subtree);       } else         ans += dfs(son, Subtree) * dfs(root, tree ^ Subtree);     }     return ans;   }   void work() {     ios::sync_with_stdio(false);     cin.tie(0);     cin >> n >> m >> q;     int u, v;     for (int i = 1; i <= m; i++) {       cin >> u >> v;       edge[u][v] = edge[v][u] = 1;       from[i] = u, to[i] = v;     }     for (int i = 1; i <= q; i++) cin >> a[i] >> b[i] >> lca[i];     bin[1] = 1;     for (int i = 2; i <= n; i++) bin[i] = bin[i - 1] << 1;     memset(dp, -1, sizeof(dp));     for (int i = 1; i <= n; i++) dp[i][bin[i]] = 1;     cout << dfs(1, (1 << n) - 1);   }   }  // namespace TYC   int main() {     TYC::work();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = (int)1e5 + 100;   long long a[N];   int ansL[N], ansR[N];   int st[N];   long long diff[N];   long long solve(int x, int y) {     long long ans = 0;     int r = 0;     for (int i = x; i <= y - 1; i++) {       while (r > 0 && diff[st[r - 1]] < diff[i]) r--;       ansL[i] = (r == 0 ? x : st[r - 1] + 1);       st[r++] = i;     }     r = 0;     for (int i = y - 1; i >= x; i--) {       while (r > 0 && diff[st[r - 1]] <= diff[i]) r--;       ansR[i] = (r == 0 ? y : st[r - 1]);       st[r++] = i;     }     for (int i = x; i < y; i++) {       ans += 1LL * (i - ansL[i] + 1) * (ansR[i] - i) * diff[i];     }     return ans;   }   int main() {     int n, q;     scanf( %d%d , &n, &q);     for (int i = 0; i < n; i++) scanf( %lld , &a[i]);     for (int i = 0; i < n - 1; i++) diff[i] = llabs(a[i + 1] - a[i]);     for (int i = 0; i < q; i++) {       int l, r;       scanf( %d%d , &l, &r);       printf( %lld n , solve(l - 1, r - 1));     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double r1, x, A, B, p1, p2, ans, t, y[5002], z[5002], r2;   int n, m, k;   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> x;       r1 = (((r1) > (x)) ? (r1) : (x));     }     cin >> m;     for (int i = 1; i <= m; i++) cin >> y[i];     cin >> k;     for (int i = 1; i <= k; i++) cin >> z[i];     cin >> A >> B;     for (int i = 1; i <= m; i++)       for (int j = 1; j <= k; j++) {         p1 = y[i];         p2 = z[j];         t = (p2 * A) / (p1 * B);         r2 = sqrt((r1 * r1) / (t + 1));         ans = (((ans) > (r2)) ? (ans) : (r2));       }     printf( %.9f n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int64_t M = 1e2 + 5;   int64_t n, t[M], w[M], dp[M][20005], totalW;   int64_t solve(int64_t idx, int64_t wt) {     if (idx > n) {       if (wt >= 0) return 0;       return 1e9;     }     if (dp[idx][1001 + wt] != -1) return dp[idx][1001 + wt];     int64_t ans = t[idx] + solve(idx + 1, wt + t[idx]);     ans = min(ans, solve(idx + 1, wt - w[idx]));     return dp[idx][1001 + wt] = ans;   }   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int64_t i = 1; i <= n; i++) cin >> t[i] >> w[i];     memset(dp, -1, sizeof(dp));     cout << solve(1, 0);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     pair<int, pair<int, int> > k[n];     for (int i = 0; i < n; i++) {       cin >> k[i].second.first >> k[i].second.second;       k[i].first = abs(k[i].second.first) + abs(k[i].second.second);     }     sort(k, k + n);     int j = 0;     j += 2 * n;     for (int i = 0; i < n; i++) {       if (k[i].second.first != 0) {         j += 2;       }       if (k[i].second.second != 0) {         j += 2;       }     }     cout << j << endl;     for (int i = 0; i < n; i++) {       if (k[i].second.first > 0) {         cout <<  1   << k[i].second.first <<   R  << endl;       } else if (k[i].second.first < 0) {         cout <<  1   << -k[i].second.first <<   L  << endl;       }       if (k[i].second.second > 0) {         cout <<  1   << k[i].second.second <<   U  << endl;       } else if (k[i].second.second < 0) {         cout <<  1   << -k[i].second.second <<   D  << endl;       }       cout << 2 << endl;       if (k[i].second.first > 0) {         cout <<  1   << k[i].second.first <<   L  << endl;       } else if (k[i].second.first < 0) {         cout <<  1   << -k[i].second.first <<   R  << endl;       }       if (k[i].second.second > 0) {         cout <<  1   << k[i].second.second <<   D  << endl;       } else if (k[i].second.second < 0) {         cout <<  1   << -k[i].second.second <<   U  << endl;       }       cout << 3 << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 200000;   int n;   string s1, s2;   int main() {     cin >> n >> s1 >> s2;     int K = 7;     long long H = 0, HH = 0, D = 1;     n--;     for (int(i) = (1); i < (n + 1); ++(i)) {       int p = 0, pp = 0;       if (s1[n - i] ==  N ) p = 1;       if (s1[n - i] ==  S ) p = 4;       if (s1[n - i] ==  E ) p = 2;       if (s1[n - i] ==  W ) p = 3;       H = H * K + p;       if (s2[n - i] ==  N ) pp = 4;       if (s2[n - i] ==  S ) pp = 1;       if (s2[n - i] ==  E ) pp = 3;       if (s2[n - i] ==  W ) pp = 2;       HH += D * (pp);       D *= 7;       if (H == HH) {         cout <<  NO ;         return 0;       }     }     cout <<  YES ;   }
#include <bits/stdc++.h>   #pragma GCC optimize( O3 )   #pragma GCC optimize( Ofast )   using namespace std;   long long n, c[2005], dp[2005], ans[2005], pos = 0;   vector<long long> v[2005];   void dfs1(long long nod) {     for (auto it : v[nod]) {       dfs1(it);       dp[nod] += dp[it] + 1;     }   }   void dfs2(long long node) {     for (auto it : v[node]) {       dfs2(it);     }     if (c[node] == dp[node]) {       ans[node] = ++pos;     } else {       ans[node] = pos - (dp[node] - c[node]) + 1;       pos++;       for (long long i = 1; i <= n; i++) {         if (ans[i] >= ans[node] && i != node) {           ans[i]++;         }       }     }   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     cin >> n;     long long root = -1;     for (long long i = 1; i <= n; i++) {       long long x;       cin >> x >> c[i];       if (x) {         v[x].push_back(i);       } else         root = i;     }     dfs1(root);     for (long long i = 1; i <= n; i++) {       if (dp[i] < c[i]) {         cout <<  NO  <<   n ;         return 0;       }     }     dfs2(root);     cout <<  YES  <<   n ;     for (long long i = 1; i <= n; i++) {       cout << ans[i] <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 100005;   vector<int> level[MAXN];   vector<pair<int, int>> adj[MAXN];   vector<pair<int, pair<int, int>>> edges;   int dp[MAXN], d[MAXN], prv[MAXN];   bool OnPath[MAXN];   int main() {     int n, m, a, b, c, cnt = 0;     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) {       scanf( %d%d%d , &a, &b, &c);       adj[a].push_back(make_pair(b, c));       adj[b].push_back(make_pair(a, c));       edges.push_back({a, {b, c}});       cnt += c;     }     memset(d, -1, sizeof(d));     memset(dp, -1, sizeof(dp));     memset(prv, -1, sizeof(prv));     queue<int> q;     d[1] = dp[1] = 0;     q.push(1);     while (!q.empty()) {       int cur = q.front();       q.pop();       for (auto p : adj[cur]) {         if (d[p.first] == -1) {           d[p.first] = d[cur] + 1;           q.push(p.first);         }       }     }     for (int i = 1; i <= n; i++) level[d[i]].push_back(i);     for (int i = 1; i <= d[n]; i++) {       for (int node : level[i]) {         for (auto p : adj[node]) {           int child = p.first;           if (d[child] == i - 1 && dp[child] + p.second > dp[node]) {             dp[node] = p.second + dp[child];             prv[node] = child;           }         }       }     }     int cur = n;     while (cur != -1) {       OnPath[cur] = 1;       cur = prv[cur];     }     int k = d[n] - dp[n] + cnt - dp[n];     printf( %d n , k);     for (int i = 0; i < m; i++) {       a = edges[i].first, b = edges[i].second.first, c = edges[i].second.second;       if (OnPath[a] && OnPath[b] && !c) printf( %d %d 1 n , a, b);       if ((!OnPath[a] || !OnPath[b]) && c) printf( %d %d 0 n , a, b);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, k, t, t1 = 0;     cin >> n >> k;     cin >> t1;     for (int i = 2; i <= n; i++) {       cin >> t;       t1 += t + 1;     }     if (t1 == k)       cout <<  YES ;     else       cout <<  NO ;   }
#include <bits/stdc++.h>   using namespace std;   const int inf = 2147483647;   template <typename T>   inline T read() {     T sum = 0, fl = 1;     char ch = getchar();     for (; !isdigit(ch); ch = getchar())       if (ch ==  - ) fl = -1;     for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch -  0 ;     return sum * fl;   }   const int maxn = 65;   int ans = 0;   long long v[200005];   vector<long long> vec[maxn];   map<long long, int> M;   void Solve() {     int n = read<int>();     for (int i = 0; i <= 62; ++i) M[1ll << i] = i;     for (int i = 1; i <= n; ++i) {       v[i] = read<long long>();       vec[M[v[i] & -v[i]]].push_back(v[i]);     }     for (int i = 0; i <= 62; ++i)       if (vec[ans].size() < vec[i].size()) ans = i;     printf( %d n , n - vec[ans].size());     for (int i = 1; i <= n; ++i)       if (M[v[i] & -v[i]] != ans) printf( %I64d n , v[i]);   }   int main() {     Solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main(void) {     stack<int> tmpRes;     string S;     cin >> S;     for (int i = 0; i < S.length(); i++) {       if (S[i] ==  r )         printf( %d n , i + 1);       else         tmpRes.emplace(i + 1);     }     while (!tmpRes.empty()) {       printf( %d n , tmpRes.top());       tmpRes.pop();     }     return (0);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int hh, mm, i;     while (~scanf( %d:%d , &hh, &mm)) {       mm = mm - 1;       for (i = 0;; i++) {         mm++;         if (mm >= 60) {           mm = mm - 60;           hh++;           if (hh >= 24) hh = 0;         }         if (hh / 10 == mm % 10 && hh % 10 == mm / 10) {           cout << i << endl;           return 0;         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   void solve();   int main(int argc, char const *argv[]) {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     solve();   }   int const MAX = 1e6 + 7;   int cnt[MAX];   void solve() {     int n, k;     cin >> n >> k;     int val[n];     for (int i = 0; i < n; i++) cin >> val[i];     int x, y;     int ans = 0;     int l = 0;     int diff = 0;     for (int r = 0; r < n; r++) {       if (++cnt[val[r]] == 1) {         diff++;       }       while (diff > k) {         if (--cnt[val[l]] == 0) diff--;         l++;       }       if (r - l + 1 > ans) {         ans = r - l + 1;         x = l;         y = r;       }     }     cout << x + 1 <<     << y + 1 << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1003, INF = 0x3f3f3f3f;   long long qpow(long long a, long long b) {     long long ans = 1;     while (b) {       if (b & 1) ans = ans * a;       a = a * a;       b >>= 1;     }     return ans;   }   int n, m, k;   int a[N][N];   int ans = 0;   void dfs(int first, int second, int xx, int yy) {     if (first == n + 1) {       ans = yy;       return;     }     if (a[first][second] == 1) {       a[first][second] = 2;       dfs(first, second + 1, first, second);     } else if (a[first][second] == 2) {       dfs(first + 1, second, first, second);     } else {       a[first][second] = 2;       dfs(first, second - 1, first, second);     }   }   int main() {     ios::sync_with_stdio;     cin.tie(0);     cout.tie(0);     cin >> n >> m >> k;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         cin >> a[i][j];       }     }     for (int i = 1; i <= k; i++) {       int first;       cin >> first;       ans = 0;       dfs(1, first, 0, 0);       cout << ans <<    ;     }     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   template <typename T>   T sqr(T x) {     return x * x;   }   template <typename T>   bool exmax(T &a, T b) {     return (b > a) ? (a = b) || 1 : 0;   }   template <typename T>   bool exmin(T &a, T b) {     return (b < a) ? (a = b) || 1 : 0;   }   using namespace std;   int a[510], b[510], l;   void print() {     for (int i = l - 1; i >= 0; i--) cout << a[i];     cout << endl;   }   int getsum(int s, int t) {     int ret = 0;     for (int i = s; i < t; i++) ret += b[i];     return ret;   }   int main() {     memset(a, 0x00, sizeof(a));     int n;     cin >> n;     n--;     int m;     cin >> m;     l = 0;     int t = m;     while (m) {       if (m > 9)         a[l++] = 9, m -= 9;       else         a[l++] = m, m = 0;     }     print();     while (n--) {       cin >> m;       if (t < m) {         for (int i = 0, j = m - t; j; i++) {           if (j > 9 - a[i])             j -= 9 - a[i], a[i] = 9;           else             a[i] += j, j = 0;           exmax(l, i + 1);         }         t = m;       } else {         t = m;         for (int i = 0; true; i++) {           memcpy(b, a, sizeof(a));           b[i]++;           while (b[i] > 9) b[i] = 0, b[++i] += 1;           for (int j = 0; j < i; j++) b[j] = 0;           exmax(l, i + 1);           int s = getsum(i, l);           if (s > m) continue;           if (i * 9 < m - s) continue;           int k = 0;           m -= s;           while (m) {             if (m > 9)               b[k++] = 9, m -= 9;             else               b[k++] = m, m = 0;           }           break;         }         memcpy(a, b, sizeof(a));       }       print();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     double x, y, z;     cin >> x >> y >> z;     double a[12] = {-200, -200, -200, -200, -200, -200,                     -200, -200, -200, -200, -200, -200};     string b[12] = { x^y^z ,  x^z^y ,  (x^y)^z ,  (x^z)^y ,                      y^x^z ,  y^z^x ,  (y^x)^z ,  (y^z)^x ,                      z^x^y ,  z^y^x ,  (z^x)^y ,  (z^y)^x };     if ((x > 1 && y > 1 && z > 1) || (x > 1 && y > 1 && z <= 1) ||         (x > 1 && y <= 1 && z > 1) || (x <= 1 && y > 1 && z > 1) ||         (x <= 1 && y <= 1 && z > 1) || (x <= 1 && y > 1 && z <= 1) ||         (x > 1 && y <= 1 && z <= 1)) {       if (x > 1) {         a[2] = log(log(x) * y * z);         a[3] = log(log(x) * y * z);         a[0] = log(log(x)) + z * log(y);         a[1] = log(log(x)) + y * log(z);       }       if (y > 1) {         a[6] = log(log(y) * x * z);         a[7] = log(log(y) * x * z);         a[4] = log(log(y)) + z * log(x);         a[5] = log(log(y)) + x * log(z);       }       if (z > 1) {         a[10] = log(log(z) * y * x);         a[11] = log(log(z) * y * x);         a[9] = log(log(z)) + x * log(y);         a[8] = log(log(z)) + y * log(x);       }     } else {       a[0] = pow(x, pow(y, z));       a[1] = pow(x, pow(z, y));       a[2] = pow(x, y * z);       a[3] = pow(x, y * z);       a[4] = pow(y, pow(x, z));       a[5] = pow(y, pow(z, x));       a[6] = pow(y, z * x);       a[7] = pow(y, z * x);       a[8] = pow(z, pow(x, y));       a[9] = pow(z, pow(y, x));       a[10] = pow(z, x * y);       a[11] = pow(z, x * y);     }     double max = -10.0;     string str =  nothing bitch ;     for (int i = 0; i < 12; i++) {       if (a[i] > max) {         max = a[i];         str = b[i];       }     }     cout << str << endl;   }