malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int n;   long long a[200100];   long long t[800800];   long long d[800800];   void build(int v, int tl, int tr) {     if (tl == tr) {       t[v] = a[tl];     } else {       int tm = (tl + tr) / 2;       build(2 * v, tl, tm);       build(2 * v + 1, tm + 1, tr);       t[v] = t[2 * v] + t[2 * v + 1];     }   }   int ind(int v, int tl, int tr, int pos) {     if (tl == tr) {       return v;     } else {       int tm = (tl + tr) / 2;       if (pos <= tm) {         return ind(2 * v, tl, tm, pos);       } else {         return ind(2 * v + 1, tm + 1, tr, pos);       }     }   }   void push(int v, int tl, int tr) {     if (d[v] != 0 && 2 * v + 1 < 800800) {       d[2 * v] += d[v];       d[2 * v + 1] += d[v];       int tm = (tl + tr) / 2;       t[2 * v] += (tm - tl + 1) * d[v];       t[2 * v + 1] += (tr - tm) * d[v];       d[v] = 0;     }   }   long long sum(int v, int tl, int tr, int l, int r) {     if (l <= tl && tr <= r) {       return t[v];     }     if (l > tr || tl > r) {       return 0;     }     int tm = (tl + tr) / 2;     push(v, tl, tr);     return sum(2 * v, tl, tm, l, r) + sum(2 * v + 1, tm + 1, tr, l, r);   }   void update(int v, int tl, int tr, int l, int r, int x) {     if (l <= tl && tr <= r) {       d[v] += x;       t[v] += (tr - tl + 1) * x;       return;     }     if (l > tr || tl > r) {       return;     }     int tm = (tl + tr) / 2;     push(v, tl, tr);     update(2 * v, tl, tm, l, r, x);     update(2 * v + 1, tm + 1, tr, l, r, x);     t[v] = t[2 * v] + t[2 * v + 1];   }   void update_new_val(int v, int tl, int tr, int pos, int new_val) {     if (tl == tr) {       t[v] = new_val;     } else {       int tm = (tl + tr) / 2;       push(v, tl, tr);       if (pos <= tm) {         update_new_val(2 * v, tl, tm, pos, new_val);       } else {         update_new_val(2 * v + 1, tm + 1, tr, pos, new_val);       }       t[v] = t[2 * v] + t[2 * v + 1];     }   }   int main() {     for (int i = 0; i < 200100; i++) {       a[i] = 0;     }     scanf( %d , &n);     long long l = 1;     for (int i = 0; i < 800800; i++) {       d[i] = 0;     }     build(1, 0, 200099);     for (int i = 0; i < n; i++) {       int z;       scanf( %d , &z);       if (z == 1) {         int k;         long long x;         cin >> k >> x;         if (x != 0) {           update(1, 0, 200099, 0, k - 1, x);         }       }       if (z == 2) {         long long new_val;         cin >> new_val;         update_new_val(1, 0, 200099, l, new_val);         l++;       }       if (z == 3) {         update_new_val(1, 0, 200099, l - 1, 0);         l--;       }       long long s = sum(1, 0, 200099, 0, 200099);       double q = l * 1.0;       double sr = (1.0 * s) / q;       printf( %.10f n , sr);     }     return 0;   }
#include <bits/stdc++.h>   const long long N = 100100;   const long long Q = 10100;   const long long mod = 1e9 + 7;   const long long block = sqrt(N);   using namespace std;   int n;   int a[N];   int t[4 * N];   int rl[4 * N];   int lz[4 * N];   void push(int x) {     if (lz[x]) {       t[x * 2] += lz[x];       lz[x * 2] += lz[x];       rl[x * 2] += lz[x];       t[x * 2 + 1] += lz[x];       lz[x * 2 + 1] += lz[x];       rl[x * 2 + 1] += lz[x];       lz[x] = 0;     }   }   void up(int x) {     t[x] = min(t[x * 2], t[x * 2 + 1]);     rl[x] = min(rl[x * 2], rl[x * 2 + 1]);   }   void build(int x, int l, int r) {     if (l == r) {       t[x] = a[l] - l;       rl[x] = a[l];       return;     }     int m = (l + r) / 2;     build(x * 2, l, m);     build(x * 2 + 1, m + 1, r);     up(x);   }   void upd(int x, int l, int r, int tl, int tr, int g) {     if (tl > tr) {       return;     }     if (tl == l && r == tr) {       t[x] += g;       lz[x] += g;       rl[x] += g;       return;     }     push(x);     int m = (l + r) / 2;     upd(x * 2, l, m, tl, min(m, tr), g);     upd(x * 2 + 1, m + 1, r, max(m + 1, tl), tr, g);     up(x);   }   int get(int x, int l, int r) {     if (t[x] >= 0) {       return n + 1;     }     if (l == r) {       return l;     }     push(x);     int m = (l + r) / 2;     if (t[x * 2] < 0) {       return get(x * 2, l, m);     } else {       return get(x * 2 + 1, m + 1, r);     }   }   int get_real(int x, int l, int r, int tl, int tr) {     if (tl > tr) {       return 1e9;     }     if (l == tl && r == tr) {       return rl[x];     }     push(x);     int m = (l + r) / 2;     return min(get_real(x * 2, l, m, tl, min(m, tr)),                get_real(x * 2 + 1, m + 1, r, max(m + 1, tl), tr));   }   void solve() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];       a[i] += i - 1;     }     build(1, 1, n);     int ans = 1e9;     for (int i = 1; i <= n; i++) {       int g = get(1, 1, n);       if (g <= n) {         ans = min(ans, max(get_real(1, 1, n, g, n), get_real(1, 1, n, 1, g - 1)));       }       upd(1, 1, n, 1, i, 1);       upd(1, 1, n, i + 1, n, -1);     }     if (ans == 1e9) {       ans = -1;     }     cout << ans <<   n ;   }   bool mtest = false;   int main() {     ios_base::sync_with_stdio(0);     int TE = 1;     if (mtest) cin >> TE;     while (TE--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   int i, j, k, n, m, s, t, ans1, ans2, ans;   int dp[1005][1 << 12];   struct Tree {     int head[1005];     struct edge {       int vet, next;     } E[2005];     int son[1005];     int num[1005];     int a[1005][1005];     int n, tot;     Tree() {       memset(head, -1, sizeof(head));       tot = -1;     }     void add(int u, int v) {       E[++tot] = (edge){v, head[u]};       head[u] = tot;     }     void read() {       scanf( %d , &n);       for (int i = 1; i < n; i++) {         int x, y;         scanf( %d%d , &x, &y);         add(x, y);         add(y, x);       }     }     void dfs(int u, int dad) {       son[u] = 0;       for (int e = head[u]; e != -1; e = E[e].next)         if (e != dad) {           son[u] |= 1 << (E[e].vet - 1);           dfs(E[e].vet, e ^ 1);         }     }     void getsize(int u, int dad) {       num[u] = 0;       for (int e = head[u]; e != -1; e = E[e].next)         if (e != dad) {           a[u][++num[u]] = E[e].vet;           getsize(E[e].vet, e ^ 1);         }     }   } S, T;   int powmod(const int &x, int y) {     if (y == 0) return 1;     int ret = powmod(x, y >> 1);     if (y & 1)       ret = (long long)ret * ret % mod * x % mod;     else       ret = (long long)ret * ret % mod;     return ret;   }   int dfs(int u, int num, int opt) {     if (num == 0) return opt == 0;     int x = S.a[u][num];     if (dp[x][opt] != -1) return dp[x][opt];     dp[x][opt] = dfs(u, num - 1, opt);     for (int i = 0; i < T.n; i++)       if ((1 << i) & opt) {         dp[x][opt] += (long long)dfs(u, num - 1, opt ^ (1 << i)) *                       dfs(x, S.num[x], T.son[i + 1]) % mod;         if (dp[x][opt] >= mod) dp[x][opt] -= mod;       }     return dp[x][opt];   }   int main() {     S.read();     T.read();     S.getsize(1, -1);     for (int j = 1; j <= T.n; j++) {       memset(dp, -1, sizeof(dp));       T.dfs(j, -1);       for (int i = 1; i <= S.n; i++) {         ans1 += dfs(i, S.num[i], T.son[j]);         if (ans1 >= mod) ans1 -= mod;       }     }     S = T;     S.getsize(1, -1);     for (int j = 1; j <= T.n; j++) {       memset(dp, -1, sizeof(dp));       T.dfs(j, -1);       ans2 += dfs(1, S.num[1], T.son[j]);       if (ans2 >= mod) ans2 -= mod;     }     ans = (long long)ans1 * powmod(ans2, mod - 2) % mod;     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(0);     long long no_of_input;     long long input;     cin >> no_of_input;     vector<long long> vect1;     for (long long i = 0; i < no_of_input; i++) {       cin >> input;       vect1.push_back(input);     }     stack<long long> stack1;     vector<long long> l(no_of_input + 1, -1);     vector<long long> r(no_of_input + 1, no_of_input);     vector<long long> ans(no_of_input + 1,                           *min_element(vect1.begin(), vect1.end()));     for (long long i = 0; i < no_of_input; i++) {       while (stack1.size() != 0 && vect1[stack1.top()] >= vect1[i]) {         stack1.pop();       }       if (stack1.size() != 0) {         l[i] = stack1.top();       }       stack1.push(i);     }     while (stack1.size() != 0) {       stack1.pop();     }     for (long long i = vect1.size() - 1; i >= 0; i--) {       while (stack1.size() != 0 && vect1[stack1.top()] >= vect1[i]) {         stack1.pop();       }       if (stack1.size() != 0) {         r[i] = stack1.top();       }       stack1.push(i);     }     for (long long i = 0; i < vect1.size(); i++) {       long long idk = r[i] - l[i] - 1;       ans[idk] = max(ans[idk], vect1[i]);     }     long long temp = ans[ans.size() - 1];     for (long long i = ans.size() - 1; i >= 1; i--) {       temp = max(temp, ans[i]);       ans[i] = max(ans[i], temp);     }     for (long long i = 1; i <= no_of_input; i++) {       cout << ans[i] <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 100100;   int n, a[N], b[N], aa[N], bb[N];   long long ans;   void go(int i, int x) {     if (ans == 0) return;     if (x == 1) {       if (a[i + 1] == 9) go(i + 1, -1);       if (ans == 0) return;       cout << i + 1 <<     << 1 <<   n ;       --ans;       ++a[i];       ++a[i + 1];     } else {       if (a[i + 1] == 0) go(i + 1, 1);       if (ans == 0) return;       cout << i + 1 <<     << -1 <<   n ;       --ans;       --a[i];       --a[i + 1];     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n;     int sum1 = 0, sum2 = 0;     for (int i = 0; i < n; i++) {       char c;       cin >> c;       a[i] = c -  0 ;     }     for (int i = 0; i < n; i++) {       char c;       cin >> c;       b[i] = c -  0 ;       aa[i] = a[i];       bb[i] = b[i];       if (i % 2 == 0) {         sum1 += a[i];         sum2 += b[i];       } else {         sum1 -= a[i];         sum2 -= b[i];       }     }     if (sum1 != sum2) return cout << -1, 0;     ans = 0;     for (int i = 0; i + 1 < n; i++) {       if (aa[i] < bb[i]) {         ans += bb[i] - aa[i];         aa[i + 1] += bb[i] - aa[i];       } else {         ans += aa[i] - bb[i];         aa[i + 1] -= aa[i] - bb[i];       }     }     cout << ans <<   n ;     ans = min(ans, 100000ll);     for (int i = 0; i + 1 < n; i++) {       while (ans > 0 && a[i] < b[i]) {         go(i, 1);       }       while (ans > 0 && a[i] > b[i]) {         go(i, -1);       }     }   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1000000007;   const double EXP = 2.7182818284590452;   const double Pi = 3.14159265;   const double EPS = 1e-13;   const int INF = 1000 * 1000 * 1000;   const long long INFL = (long long)INF * (long long)INF;   long long n;   long long res;   void accept() {     cin >> n;     for (long long i = 1, j = 1; i <= INF; i *= 10, ++j) {       res += ((0 < (((n - i + 1) < 9L * i) ? ((n - i + 1)) : (9L * i)))                   ? ((((n - i + 1) < 9L * i) ? ((n - i + 1)) : (9L * i)))                   : (0)) *              j;     }     cout << res;   }   int main(void) {     accept();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int M = 1e9 + 7;   int incr(string &s) {     int i, n = s.length();     for (i = n - 1; i >= 0; --i) {       if (s[i] !=  9 ) {         s[i]++;         return 0;       }       s[i] =  0 ;     }     for (i = n - 1; i >= 0; --i) {       s[i] =  0 ;     }     s =  1  + s;     return 0;   }   int incr2(string &s, int t) {     while (t > 0) {       for (int i = s.length() - 1; i >= 0; --i) {         if (s[i] !=  9 ) {           s[i]++;           --t;           if (s[i] ==  5 ) {             if (i == 0) {               return 1;             }             s.pop_back();             break;           } else {             return 0;           }         } else {           s[i] =  0 ;           s.pop_back();           if (i == 0) {             return 1;           }         }       }     }     for (int i = s.length() - 1; i >= 0; --i) {       if (s[i] !=  9 ) {         s[i]++;         return 0;       }     }   }   int main() {     int i, n, t;     cin >> n >> t;     string s;     cin >> s;     int di = s.find( . );     string dpart = s.substr(0, di);     s = s.substr(di + 1, n - di - 1);     if (s[0] >=  5 ) {       incr(dpart);       cout << dpart;       return 0;     }     for (i = 0; i < s.length(); i++) {       if (s[i] >=  5 ) {         break;       }     }     if (i == s.length()) {       cout << dpart <<  .  << s;       return 0;     }     s = s.substr(0, i);     int c4 = 0;     for (i = s.length() - 1; i >= 0; --i) {       if (s[i] ==  4 ) {         c4++;       } else {         break;       }     }     if (c4 == 0) {       incr2(s, 0);       cout << dpart <<  .  << s;       return 0;     }     if (c4 == s.length() && t > c4) {       incr(dpart);       cout << dpart;       return (0);     }     cout << dpart <<  . ;     if (t <= c4) {       cout << s.substr(0, s.length() - t) <<  5 ;       return 0;     }     s[s.length() - c4 - 1]++;     cout << s.substr(0, s.length() - c4);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   ifstream fin( B.in );   ofstream fout( B.out );   long long n, a[100001], v[100001], heap[100001], pending[100001], s1, s2, ok,       ideal, current, maxv, nr;   string s;   int main() {     cin >> n;     for (int i = 1; i <= 2 * n; ++i) {       cin >> a[i];       v[a[i]]++;     }     for (int i = 10; i <= 99; ++i) {       if (v[i] < 2) continue;       nr = v[i] / 2;       if (nr != 0) {         ++s1;         ++s2;       }       int j;       for (j = 1; j <= 2 * n && nr > 0; ++j) {         if (a[j] == i) {           --nr;           heap[j] = 1;         }       }       nr = v[i] / 2;       for (j = 1; j <= 2 * n && nr > 0; ++j) {         if (a[j] == i && heap[j] != 1) {           --nr;           heap[j] = 2;         }       }     }     ok = 0;     for (int i = 10; i <= 99; ++i) {       if (v[i] != 1) continue;       if (!ok)         s1++;       else         s2++;       for (int j = 1; j <= 2 * n; ++j) {         if (a[j] == i && !heap[j]) {           if (!ok)             heap[j] = 1;           else             heap[j] = 2;         }       }       ok = 1 - ok;     }     for (int i = 10; i <= 99; ++i) {       if (v[i] % 2 != 1 || v[i] == 1) continue;       for (int j = 1; j <= 2 * n; ++j) {         if (a[j] == i && !heap[j]) {           if (!ok)             heap[j] = 1;           else             heap[j] = 2;         }       }       ok = 1 - ok;     }     cout << s1 * s2 <<   n ;     ok = 0;     for (int i = 1; i <= 2 * n; ++i) {       cout << heap[i];       cout <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   int i, ans, f;   long long n, l, r, mid, x;   long long check(long long mid) {     if ((mid - 1) / 2 > n / mid) return n + 1;     return mid * ((1ll << i) - 1) + mid * (mid - 1) / 2;   }   int main() {     scanf( %I64d , &n);     x = (int)(sqrt(n * 2) + 1e-11);     if (x * (x + 1) == n * 2 && (x + 1) & 1) printf( %I64d n , x + 1), f = 1;     for (i = 1; (1ll << i) - 1 <= n; ++i) {       l = 1;       r = n / ((1ll << i) - 1);       while (l <= r) {         mid = (l + r) / 2;         if (check(mid) <= n)           l = mid + 1;         else           r = mid - 1;       }       if ((l - 1) & 1 && check(l - 1) == n)         printf( %I64d n , (l - 1) * 1 << i), f = 1;     }     if (!f) printf( -1 n );   }
#include <bits/stdc++.h>   using namespace std;   long long int pwr(long long int a, long long int n, long long int m) {     long long int p = 1;     while (n > 0) {       if (n % 2 == 1) p = (p * a) % m;       a = (a * a) % m;       n = n / 2;     }     return p;   }   char str[1000000];   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long int n, a, b, k, s = 0, i, j;     cin >> n >> a >> b >> k;     long long int f = pwr(b, k, (long long int)(1e9 + 9));     long long int g = pwr(a, k, (long long int)(1e9 + 9));     long long int r =         (f * pwr(g, (long long int)(1e9 + 9) - 2, (long long int)(1e9 + 9))) %         (long long int)(1e9 + 9);     r = ((pwr(r, (n + 1) / k, (long long int)(1e9 + 9)) - 1 +           (long long int)(1e9 + 9)) %          (long long int)(1e9 + 9) *          pwr(r - 1, (long long int)(1e9 + 9) - 2, (long long int)(1e9 + 9))) %         (long long int)(1e9 + 9);     if (r == 0) r = (n + 1) / k;     cin >> str;     for (i = 0; i < k; i++) {       if (str[i] ==  + )         s = (s +              (pwr(a, n - i, (long long int)(1e9 + 9)) *               pwr(b, i, (long long int)(1e9 + 9))) %                  (long long int)(1e9 + 9) +              (long long int)(1e9 + 9)) %             (long long int)(1e9 + 9);       else         s = (s -              (pwr(a, n - i, (long long int)(1e9 + 9)) *               pwr(b, i, (long long int)(1e9 + 9))) %                  (long long int)(1e9 + 9) +              (long long int)(1e9 + 9)) %             (long long int)(1e9 + 9);     }     cout << ((s * r) % (long long int)(1e9 + 9) + (long long int)(1e9 + 9)) %                 (long long int)(1e9 + 9)          << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1000;   int main(int argc, char *argv[]) {     string s;     vector<pair<char, int> > count;     int n;     cin >> s;     n = s.size();     for (int i = 0; i < n;) {       int cnt = 0;       int prev = s[i];       while (s[i] == prev) {         cnt++;         i++;       }       count.push_back(make_pair(prev, cnt));     }     for (int i = 0; i < count.size(); i++) {       if (count[i].second >= 3) count[i].second = 2;     }     for (int i = 0; i < count.size() - 1; i++) {       if (count[i].second == 2 && count[i + 1].second == 2)         count[i + 1].second = 1;     }     for (int i = 0; i < count.size(); i++) {       for (int j = 0; j < count[i].second; j++) cout << count[i].first;     }   }
#include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     long long n, a, b, p, q;     cin >> n >> a >> b >> p >> q;     long long someGcd = gcd(a, b);     long long lcm = a * b / someGcd;     long long max = (p > q) ? p : q;     if (p > q) {       long long counta = p * (n / a);       long long countb = q * (n / b) - q * (n / lcm);       cout << counta + countb;     } else {       long long counta = p * (n / a) - p * (n / lcm);       long long countb = q * (n / b);       cout << counta + countb;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string second;     cin >> second;     bool check = 0;     string tmp(1, second[0]);     for (int i = 1; i < second.size(); i++) {       if (second[i] ==  d  && second[i + 1] ==  o  && second[i + 2] ==  t  &&           i < second.size() - 3)         tmp +=  . , i += 2;       else if (second[i] ==  a  && second[i + 1] ==  t  && !check &&                i < second.size() - 2)         tmp +=  @ , check = 1, i++;       else         tmp += second[i];     }     cout << tmp << endl;   }
#include <bits/stdc++.h>   using namespace std;   int k;   long long ans[10009];   bool chk(long long n) {     int m = 0;     while (n) {       m += (n % 10);       n /= 10;       if (m > 10) return 0;     }     return (m == 10);   }   int main() {     cin >> k;     ans[0] = 19;     for (int i = 1; i <= 10000; i++) {       ans[i] = ans[i - 1] + 9;       while (!chk(ans[i])) ans[i] += 9;     }     cout << ans[k - 1];     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s;   void solve() {     long long n = s.length(), i, j, k;     long long piv = 0;     for (i = 0; i < n; i++)       if (s[i] ==  ^ ) {         piv = i;         break;       }     long long l = piv;     long long r = n - piv - 1;     long long c1 = 0, c2 = 0;     for (i = 0; i < l; i++) {       if (s[i] ==  = ) continue;       j = (piv - i) * (s[i] -  0 );       c1 += j;     }     for (i = piv + 1; i < n; i++) {       if (s[i] ==  = ) continue;       j = (i - piv) * (s[i] -  0 );       c2 += j;     }     if (c1 == c2) cout <<  balance n ;     if (c1 > c2) cout <<  left n ;     if (c1 < c2) cout <<  right n ;   }   int main(int argc, char const *argv[]) {     cin >> s;     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 200;   int h[maxn];   long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }   int main() {     long long n, m, sx, sy, ex, ey;     int q;     scanf( %lld%lld%d , &n, &m, &q);     long long gc = gcd(n, m);     long long stp1 = n / gc, stp2 = m / gc;     long long num1, num2;     while (q--) {       scanf( %lld%lld%lld%lld , &sx, &sy, &ex, &ey);       num1 = num2 = 0;       if (sx == 1) {         num1 = sy / stp1;         if (sy % stp1 != 0) num1++;       } else {         num1 = sy / stp2;         if (sy % stp2 != 0) num1++;       }       if (ex == 1) {         num2 = ey / stp1;         if (ey % stp1 != 0) num2++;       } else {         num2 = ey / stp2;         if (ey % stp2 != 0) num2++;       }       if (num1 == num2)         printf( YES n );       else         printf( NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int k[10] = {2, 7, 2, 3, 3, 4, 2, 5, 1, 2};   int main(void) {     int n;     scanf( %d , &n);     int x = n / 10, y = n % 10;     printf( %d n , k[x] * k[y]);   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   void printContainer(T& a, int n = -1) {     if (n == -1) n = a.size();     cout <<  { ;     int i = 0;     for (auto it : a) {       cout << (it) <<  ,  ;       if (++i == n) break;     }     cout <<  } n ;   }   int main() {     string s[2];     cin >> s[0] >> s[1];     int typ[2];     int score = 0;     int c = 0;     for (int p = 0; p < s[0].size(); p += 2) {       for (int i = 0; i < (int)(2); ++i) {         int r = 2;         if (s[i][p] ==  [ )           r = 0;         else if (s[i][p] ==  ( )           r = 1;         typ[i] = r;       }       if (typ[0] == typ[1]) continue;       for (int i = 0; i < (int)(3); ++i)         if (((typ[0] + 1) % 3) == typ[1]) {           ++score;           goto final;         }       --score;     final:       ++c;     }     if (score == 0) {       cout <<  TIE  << endl;     } else {       cout << (score > 0 ?  TEAM 1 WINS  :  TEAM 2 WINS ) << endl;       ;     }   }