solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
#include <bits/stdc++.h> using namespace std; template <typename T> T Abs(T first) { return (first < 0 ? -first : first); } template <typename T> T Sqr(T first) { return (first * first); } string plural(string s) { return (int((s).size()) && s[int((s).size()) - 1] == 'x' ? s + "en" : s + "s"); } const int INF = (int)1e9; const long double EPS = 1e-9; const long double PI = acos(-1.0); bool Read(int &first) { char c, r = 0, n = 0; first = 0; for (;;) { c = getchar(); if ((c < 0) && (!r)) return (0); if ((c == '-') && (!r)) n = 1; else if ((c >= '0') && (c <= '9')) first = first * 10 + c - '0', r = 1; else if (r) break; } if (n) first = -first; return (1); } int main() { if (0) freopen("in.txt", "r", stdin); string s1, s2; int v1 = 0, v2 = 0; cin >> s1 >> s2; int n = int((s1).size()), i; for (i = 0; i < n; i += 2) { int m1, m2; if (s1[i] == '(') m1 = 0; else if (s1[i] == '[') m1 = 1; else m1 = 2; if (s2[i] == '(') m2 = 0; else if (s2[i] == '[') m2 = 1; else m2 = 2; if ((m2 - m1 + 3) % 3 == 1) v2++; if ((m1 - m2 + 3) % 3 == 1) v1++; } if (v1 == v2) printf("TIE\n"); else if (v1 > v2) printf("TEAM 1 WINS\n"); else printf("TEAM 2 WINS\n"); return (0); }
7
CPP
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); int beat(char a, char b) { if (a == b) return 0; if (a == '8') { if (b == '[') return 1; else return -1; } if (a == '[') { if (b == '(') return 1; else return -1; } if (a == '(') { if (b == '8') return 1; else return -1; } return -10000; } int main() { string s[2]; cin >> s[0] >> s[1]; int n = s[0].size(); int dif = 0; for (int i = 0; i < n; i += 2) { dif += beat(s[0][i], s[1][i]); } if (dif == 0) cout << "TIE" << endl; else if (dif > 0) cout << "TEAM 1 WINS" << endl; else cout << "TEAM 2 WINS" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; int indexa = 0; int indexb = 0; string b; cin >> b; char array[4] = {'[', '(', '8'}; double team1 = 0; double team2 = 0; for (int g = 0; g < a.size(); g++) { if (a[g] == b[g]) { team1 += 0.5; team2 += 0.5; continue; } else if (a[g] == '(' && b[g] == '[') { team2 += 1; } else if (b[g] == '(' && a[g] == '[') { team1 += 1; } else if (a[g] == '8' && b[g] == '(') { team2 += 1; } else if (b[g] == '8' && a[g] == '(') { team1 += 1; } else if (a[g] == '[' && b[g] == '8') { team2 += 1; } else if (b[g] == '[' && a[g] == '8') { team1 += 1; } } if (team1 > team2) { cout << "TEAM 1 WINS"; } else if (team1 == team2) { cout << "TIE"; } else { cout << "TEAM 2 WINS"; } }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string s[2]; cin >> s[0] >> s[1]; int r[2] = {0, 0}; for (int i = 0; i < (int)s[0].length(); i += 2) { const char c1 = s[0][i], c2 = s[1][i]; if (c1 == '8' && c2 == '[') r[0] += 1; if (c1 == '8' && c2 == '(') r[1] += 1; if (c1 == '[' && c2 == '8') r[1] += 1; if (c1 == '[' && c2 == '(') r[0] += 1; if (c1 == '(' && c2 == '8') r[0] += 1; if (c1 == '(' && c2 == '[') r[1] += 1; } cout << (r[0] < r[1] ? "TEAM 2 WINS" : r[0] == r[1] ? "TIE" : "TEAM 1 WINS") << endl; return 0; }
7
CPP
s1 = input() s2 = input() num1 = 0 num2 = 0 for i in range(0, len(s1), 2): c1 = s1[i:i + 2] c2 = s2[i:i + 2] if c1 != c2: if (c1 == "8<" and c2 == "[]"): num1 += 1 elif (c1 == "()" and c2 == "8<"): num1 += 1 elif (c1 == "[]" and c2 == "()"): num1 += 1 else: num2 += 1 if num1 == num2: print("TIE") else: print("TEAM {} WINS".format(int(num2 > num1) + 1))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); string a, b; cin >> a >> b; long long ans = 0; for (long long i = 0; i < a.size(); i += 2) { string f = a.substr(i, 2); string s = b.substr(i, 2); if (f == s) continue; if ((f == "()" && s == "8<") || (f == "[]" && s == "()") || (f == "8<" && s == "[]")) ans++; else ans--; } if (ans == 0) cout << "TIE"; else if (ans > 0) cout << "TEAM 1 WINS"; else cout << "TEAM 2 WINS"; return 0; }
7
CPP
#include <bits/stdc++.h> const int N = 25; char s1[N], s2[N]; int n1 = 0, n2 = 0; int main() { scanf("%s%s", s1, s2); if (strlen(s1) != strlen(s2) || strlen(s1) % 2 || strlen(s2) % 2) { printf("TIE\n"); return 0; } for (int i = 0; i < strlen(s1); i += 2) { if (s1[i] == '8' && s1[i + 1] == '<') { if (s2[i] == '[' && s2[i + 1] == ']') n1++; else if (s2[i] == '(' && s2[i + 1] == ')') n2++; else if (s2[i] == '8' && s2[i + 1] == '<') { } else { printf("TIE\n"); return 0; } } else if (s1[i] == '[' && s1[i + 1] == ']') { if (s2[i] == '(' && s2[i + 1] == ')') n1++; else if (s2[i] == '8' && s2[i + 1] == '<') n2++; else if (s2[i] == '[' && s2[i + 1] == ']') { } else { printf("TIE\n"); return 0; } } else if (s1[i] == '(' && s1[i + 1] == ')') { if (s2[i] == '8' && s2[i + 1] == '<') n1++; else if (s2[i] == '[' && s2[i + 1] == ']') n2++; else if (s2[i] == '(' && s2[i + 1] == ')') { } else { printf("TIE\n"); return 0; } } else { printf("TIE\n"); return 0; } } if (n1 > n2) printf("TEAM 1 WINS\n"); else if (n1 < n2) printf("TEAM 2 WINS\n"); else printf("TIE\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; const double eps = 1.0e-11; const double pi = acos(-1.0); int cmp(string f, string s) { if (f == "[]" && s == "()") return 1; if (f == "()" && s == "8<") return 1; if (f == "8<" && s == "[]") return 1; return 0; } int main() { ios_base::sync_with_stdio(0); string f, s; cin >> f >> s; int res1 = 0; int res2 = 0; for (long long i = 0; i < (int)(f).size() / 2; i++) { res1 += cmp(f.substr(i * 2, 2), s.substr(2 * i, 2)); res2 += cmp(s.substr(i * 2, 2), f.substr(2 * i, 2)); } if (res1 == res2) { cout << "TIE\n"; return 0; } if (res1 > res2) { cout << "TEAM 1 WINS\n"; return 0; } else { cout << "TEAM 2 WINS\n"; return 0; } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { char a[100], b[100]; gets(a); gets(b); int a1 = 0, a2 = 0; for (int i = 0; i < strlen(a); i += 2) { if (a[i] == '8' && a[i + 1] == '<') { if (b[i] == '(' && b[i + 1] == ')') a2++; if (b[i] == '[' && b[i + 1] == ']') a1++; } if (a[i] == '(' && a[i + 1] == ')') { if (b[i] == '8' && b[i + 1] == '<') a1++; if (b[i] == '[' && b[i + 1] == ']') a2++; } if (a[i] == '[' && a[i + 1] == ']') { if (b[i] == '(' && b[i + 1] == ')') a1++; if (b[i] == '8' && b[i + 1] == '<') a2++; } } if (a1 == a2) cout << "TIE"; else if (a1 < a2) cout << "TEAM 2 WINS"; else cout << "TEAM 1 WINS"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; string s, t; int rez; int main() { cin >> s; cin >> t; for (int i = 0; i < s.size(); i += 2) { if (s[i] == '[') { if (t[i] == '(') { ++rez; } else if (t[i] == '8') { --rez; } } else if (s[i] == '(') { if (t[i] == '[') { --rez; } else if (t[i] == '8') { ++rez; } } else { if (t[i] == '(') { --rez; } else if (t[i] == '[') { ++rez; } } } if (rez < 0) { cout << "TEAM 2 WINS"; } else if (rez > 0) { cout << "TEAM 1 WINS"; } else { cout << "TIE"; } return 0; }
7
CPP
from math import* def winner(a,b): if a=="[]": if b=="()": return 1 elif b=="[]": return 0 else: return -1 elif a=="8<": if b=="()": return -1 elif b=="[]": return 1 else: return 0 else: if b=="()": return 0 elif b=="[]": return -1 else: return 1 s1=input() s2=input() i=0 ans=0 while i<len(s1): ans+=winner(s1[i:i+2],s2[i:i+2]) i+=2 if ans==0: print("TIE") elif ans<0: print("TEAM 2 WINS") else: print("TEAM 1 WINS")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { char s1[30] = {"\0"}; char s2[30] = {"\0"}; scanf("%s", s1); scanf("%s", s2); int arr[4] = {0}; for (int i = 0; i < strlen(s1); i = i + 2) { if (s1[i] == s2[i]) continue; else if (s1[i] == '[' && s2[i] == '8') arr[2]++; else if (s1[i] == '[' && s2[i] == '(') arr[1]++; else if (s1[i] == '8' && s2[i] == '(') arr[2]++; else if (s1[i] == '8' && s2[i] == '[') arr[1]++; else if (s1[i] == '(' && s2[i] == '8') arr[1]++; else if (s1[i] == '(' && s2[i] == '[') arr[2]++; } if (arr[1] > arr[2]) printf("TEAM 1 WINS\n"); else if (arr[1] < arr[2]) printf("TEAM 2 WINS\n"); else printf("TIE\n"); return 0; }
7
CPP
s1 = input() s2 = input() sum1 = 0 sum2 = 0 for i in range(len(s1)//2): if s1[2*i] == '8': if s2[2*i] == '[': sum1 += 1 elif s2[2*i] == '(': sum2 += 1 elif s1[2*i] == '(': if s2[2*i] == '[': sum2 += 1 elif s2[2*i] == '8': sum1 += 1 else: if s2[2*i] == '(': sum1 += 1 elif s2[2*i] == '8': sum2 += 1 if sum1 > sum2: print('TEAM 1 WINS') elif sum2 > sum1: print('TEAM 2 WINS') else: print('TIE')
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int a1 = 0, b1 = 0; string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { if (a[i] == '[' && b[i] == '8') b1++; else if (a[i] == '[' && b[i] == '(') a1++; else if (a[i] == '(' && b[i] == '8') a1++; else if (a[i] == '(' && b[i] == '[') b1++; else if (a[i] == '8' && b[i] == '(') b1++; else if (a[i] == '8' && b[i] == '[') a1++; } if (a1 > b1) cout << "TEAM 1 WINS"; if (a1 < b1) cout << "TEAM 2 WINS"; if (a1 == b1) cout << "TIE"; }
7
CPP
#include <bits/stdc++.h> using namespace std; char a[25], b[25]; int cot; int main() { scanf("%s", a); scanf("%s", b); int n = strlen(a); for (int i = 0; i < n; i += 2) { switch (a[i]) { case '8': { if (b[i] == '[') cot++; if (b[i] == '(') cot--; break; } case '[': { if (b[i] == '8') cot--; if (b[i] == '(') cot++; break; } case '(': { if (b[i] == '8') cot++; if (b[i] == '[') cot--; break; } } } if (cot == 0) printf("TIE\n"); else if (cot > 0) printf("TEAM 1 WINS\n"); else printf("TEAM 2 WINS\n"); }
7
CPP
#include <bits/stdc++.h> using namespace std; int tellWho(char ch1, char ch2) { if ((ch1 == '8' and ch2 == '[') or (ch1 == '(' and ch2 == '8') or (ch1 == '[' and ch2 == '(')) { return 0; } else if (ch1 == ch2) return 3; else return 1; } int main() { string str; string str1; cin >> str; cin >> str1; int score1 = 0, score2 = 0; for (int i = 0; i < str.length(); i += 2) { int val = tellWho(str[i], str1[i]); if (val == 0) { score1++; } else if (val == 1) score2++; } if (score1 > score2) cout << "TEAM 1 WINS\n"; else if (score2 > score1) cout << "TEAM 2 WINS\n"; else cout << "TIE\n"; return 0; }
7
CPP
s = input() t = input() a = 0 b = 0 for i in range(0, len(s), 2): if s[i:i+2] == "[]" and t[i:i+2]=="()": a += 1 if s[i:i+2] == "()" and t[i:i+2]=="8<": a += 1 if s[i:i+2] == "8<" and t[i:i+2]=="[]": a += 1 if t[i:i+2] == "[]" and s[i:i+2]=="()": b += 1 if t[i:i+2] == "()" and s[i:i+2]=="8<": b += 1 if t[i:i+2] == "8<" and s[i:i+2]=="[]": b += 1 if a > b: print("TEAM 1 WINS") elif a < b: print("TEAM 2 WINS") else: print("TIE")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { string str1, str2; int sc1 = 0, sc2 = 0; cin >> str1; cin >> str2; for (int i = 0; i < str1.length(); i += 2) { switch (str1.at(i)) { case '8': switch (str2.at(i)) { case '(': sc2++; break; case '[': sc1++; } break; case '[': switch (str2.at(i)) { case '8': sc2++; break; case '(': sc1++; } break; case '(': switch (str2.at(i)) { case '[': sc2++; break; case '8': sc1++; } break; } } if (sc1 < sc2) cout << "TEAM 2 WINS"; else if (sc1 > sc2) cout << "TEAM 1 WINS"; else cout << "TIE"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; string s, b; int t1, t2; void w(int &i, int &j) { if (s[i] == '[') { if (b[j] == '(') { t1++; } else if (b[j] == '8') { t2++; } } else if (s[i] == '(') { if (b[j] == '[') { t2++; } else if (b[j] == '8') { t1++; } } else if (s[i] == '8') { if (b[j] == '[') { t1++; } else if (b[j] == '(') { t2++; } } i = j = i + 2; } int main() { cin >> s >> b; int len = s.size(); int i = 0; int j = i; while (i < len) { w(i, j); } (t1 > t2) ? (cout << "TEAM 1 WINS") : ((t1 == t2) ? (cout << "TIE") : (cout << "TEAM 2 WINS")); cout << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; const int N = 2e5; long long k = N; long long a[N], tt, dp[N], n, w[N], h[N], ans; bool flag, mark; string s, ss; int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), srand(time(0)); cin >> s >> ss; int A = 0, B = 0; for (int i = 0; i < s.size(); i += 2) { if (s[i] == '8' && ss[i] == '[') A++; else if (s[i] == '[' && ss[i] == '(') A++; else if (s[i] == '(' && ss[i] == '8') A++; else if (s[i] != ss[i]) B++; } if (A > B) cout << "TEAM 1 WINS"; else if (B > A) cout << "TEAM 2 WINS"; else cout << "TIE"; }
7
CPP
#include <bits/stdc++.h> using namespace std; string s1, s2; int sum1 = 0, sum2 = 0; int counter; int main() { cin >> s1; cin >> s2; for (int i = 0; i < s1.length(); i++) { if (s1[i] == '[' && s2[i] == '(') sum1++; if (s1[i] == '8' && s2[i] == '[') sum1++; if (s1[i] == '(' && s2[i] == '8') sum1++; if (s2[i] == '[' && s1[i] == '(') sum2++; if (s2[i] == '8' && s1[i] == '[') sum2++; if (s2[i] == '(' && s1[i] == '8') sum2++; } if (sum1 > sum2) cout << "TEAM 1 WINS"; if (sum1 < sum2) cout << "TEAM 2 WINS"; if (sum1 == sum2) cout << "TIE"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; template <class T> inline T sqr(T x) { return x * x; } template <class T> inline T cube(T x) { return x * x * x; } template <class T> inline T quad(T x) { return x * x * x * x; } template <class T> inline T powr(T x, T y) { T ret = 1; while (y--) ret *= x; return ret; } template <class T> inline bool Equal(T x, T y) { return fabs(x - y) < 1e-9; } template <class T> inline T bitSet(T n, T pos) { return n = n | (1 << pos); } template <class T> inline T bitReset(T n, T pos) { return n = n & ~(1 << pos); } template <class T> inline bool bitCheck(T n, T pos) { return n & (1 << pos); } template <class T> inline T GCD(T a, T b) { if (a < 0) return GCD(-a, b); if (b < 0) return GCD(a, -b); return (b == 0) ? a : GCD(b, a % b); } template <class T> inline T LCM(T a, T b) { if (a < 0) return LCM(-a, b); if (b < 0) return LCM(a, -b); return a * (b / GCD(a, b)); } template <class T> inline bool isPrime(T n) { if (n <= 1) return false; for (T i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; } template <class T> inline void debug(T x) { cout << "x = " << x << endl; } template <class T1, class T2> inline void debug(T1 x, T2 y) { cout << "x = " << x << ", y = " << y << endl; } template <class T1, class T2, class T3> inline void debug(T1 x, T2 y, T3 z) { cout << "x = " << x << ", y = " << y << ", z = " << z << endl; } int dx[] = {+1, -1, +0, +0}; int dy[] = {+0, +0, +1, -1}; int main() { int a, b, i; char s1[50], s2[50]; while (cin >> s1 >> s2) { a = b = 0; for (i = 0; s1[i]; i += 2) { if (s1[i] == '(' && s1[i + 1] == ')') { if (s2[i] == '8' && s2[i + 1] == '<') a++; else if (s2[i] == '[' && s2[i + 1] == ']') b++; } if (s1[i] == '8' && s1[i + 1] == '<') { if (s2[i] == '[' && s2[i + 1] == ']') a++; else if (s2[i] == '(' && s2[i + 1] == ')') b++; } if (s1[i] == '[' && s1[i + 1] == ']') { if (s2[i] == '(' && s2[i + 1] == ')') a++; else if (s2[i] == '8' && s2[i + 1] == '<') b++; } } if (a == b) puts("TIE"); if (a > b) puts("TEAM 1 WINS"); else if (a < b) puts("TEAM 2 WINS"); } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; char a[21], b[21]; int x, y; int main() { cin >> a >> b; for (int i = 0; i < 21; i += 2) { if (a[i] == 0) break; if (a[i] != b[i]) { if (a[i] == '8' && b[i] == '[' || a[i] == '[' && b[i] == '(' || a[i] == '(' && b[i] == '8') x++; else y++; } } if (x == y) cout << "TIE"; else if (x > y) cout << "TEAM 1 WINS"; else cout << "TEAM 2 WINS"; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; long long cnt = 0, c = 0; for (long long i = 1; i < a.size(); i += 2) { if (a[i] == ']') { if (b[i] == '<') c++; else if (b[i] == ')') cnt++; } else if (a[i] == '<') { if (b[i] == ']') cnt++; else if (b[i] == ')') c++; } else { if (b[i] == '<') cnt++; else if (b[i] == ']') c++; } } if (cnt > c) cout << "TEAM 1 WINS"; else if (c > cnt) cout << "TEAM 2 WINS"; else if (c == cnt) cout << "TIE"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int first = 0, second = 0; void calc(char one, char two) { if (one == '(') { if (two == '8') first++; else if (two == '[') second++; } else if (one == '8') { if (two == '(') second++; else if (two == '[') first++; } else if (one == '[') { if (two == '8') second++; else if (two == '(') first++; } } int main() { string team1, team2; cin >> team1 >> team2; int size = team1.size(); for (int i = 0; i < size; i += 2) { calc(team1[i], team2[i]); } if (first > second) cout << "TEAM 1 WINS\n"; else if (second > first) cout << "TEAM 2 WINS\n"; else cout << "TIE\n"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; char strA[100], strB[100]; int lenA, lenB; int main() { scanf("%s %s", strA, strB); lenA = strlen(strA), lenB = strlen(strB); int rA = 0, rB = 0; for (int i = 0; i < lenA; i += 2) { int vA, vB; switch (strA[i]) { case '[': vA = 0; break; case '(': vA = 1; break; case '8': vA = 2; break; } switch (strB[i]) { case '[': vB = 0; break; case '(': vB = 1; break; case '8': vB = 2; break; } if (vA == vB) continue; if (vA == vB - 1 || vA == vB + 2) rA++; else rB++; } if (rA > rB) printf("TEAM 1 WINS\n"); else if (rA < rB) printf("TEAM 2 WINS\n"); else printf("TIE\n"); return 0; };
7
CPP
items = ['()', '[]', '8<'] def translate(s): n = len(s) ans = [] for i in range(0, n, 2): ans.append(items.index(s[i:i + 2])) return ans def cmp(x, y): if x == y: return 0 if (x + 1) % 3 == y: return -1 return 1 a = translate(input()) b = translate(input()) c = sum(cmp(x, y) for (x, y) in zip(a, b)) if c == 0: print('TIE') elif c < 0: print('TEAM 2 WINS') else: print('TEAM 1 WINS')
7
PYTHON3
s1 = input() s2 = input() t1 = 0 t2 = 0 for i in range(0,len(s1),2): if s1[i] == '[': if s2[i] == '(': t1+=1 if s2[i] == '8': t2+=1 if s1[i] == '(': if s2[i] == '[': t2+=1 if s2[i] == '8': t1+=1 if s1[i] == '8': if s2[i] == '(': t2+=1 if s2[i] == '[': t1+=1 if(t1 > t2): print("TEAM 1 WINS") elif(t1 < t2): print("TEAM 2 WINS") else: print("TIE")
7
PYTHON3
s1 = input().rstrip() s2 = input().rstrip() cnt1 = 0 cnt2 = 0 for i in range(len(s1) // 2): c1 = s1[i * 2 : i * 2 + 2] c2 = s2[i * 2 : i * 2 + 2] if c1 == c2: pass elif (c1 == "()" and c2 == "8<") or (c1 == "8<" and c2 == "[]") or (c1 == "[]" and c2 == "()"): cnt1 += 1 else: cnt2 += 1 if cnt1 > cnt2: print("TEAM 1 WINS") elif cnt2 > cnt1: print("TEAM 2 WINS") else: print("TIE")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int N = 100010; const int M = 1000010; const int MOD = 1000000007ll; const int INF = 0x7fffffff; const int dir4[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; const int dir8[8][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}, {-1, 1}, {1, -1}, {-1, -1}, {1, 1}}; const double eps = 1e-8; const double PI = acos(-1.0); inline int sign(double x) { return (x > eps) - (x < -eps); } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } template <class T> inline T Min(T a, T b) { return a < b ? a : b; } template <class T> inline T Max(T a, T b) { return a > b ? a : b; } int main() { char str1[22], str2[22]; while (scanf("%s%s", str1, str2) != EOF) { int s = 0; int len = (int)strlen(str1); for (int i = 0; i < len; i += 2) { if (str1[i] == str2[i]) continue; if (str1[i] == '8') { if (str2[i] == '[') s++; else s--; } else if (str1[i] == '[') { if (str2[i] == '8') s--; else s++; } else { if (str2[i] == '8') s++; else s--; } } if (s > 0) printf("%s\n", ("TEAM 1 WINS")); else if (s < 0) printf("%s\n", ("TEAM 2 WINS")); else printf("%s\n", ("TIE")); } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int ss, zz; string s, z; int main() { cin >> s >> z; for (int i = 0; i < s.size(); i += 2) { if ((s[i] == '[' && s[i + 1] == ']') && (z[i] == '(' && z[i + 1] == ')')) { ss++; } if ((s[i] == '8' && s[i + 1] == '<') && (z[i] == '[' && z[i + 1] == ']')) { ss++; } if ((s[i] == '(' && s[i + 1] == ')') && (z[i] == '8' && z[i + 1] == '<')) { ss++; } if ((z[i] == '[' && z[i + 1] == ']') && (s[i] == '(' && s[i + 1] == ')')) { zz++; } if ((z[i] == '8' && z[i + 1] == '<') && (s[i] == '[' && s[i + 1] == ']')) { zz++; } if ((z[i] == '(' && z[i + 1] == ')') && (s[i] == '8' && s[i + 1] == '<')) { zz++; } } if (ss > zz) { cout << "TEAM 1 WINS"; } else if (ss < zz) { cout << "TEAM 2 WINS"; } else { cout << "TIE"; } return 0; }
7
CPP
x = input() y = input() t1,t2 = 0,0 i=0 while i<len(x): a = x[i:i+2] # print(a) b = y[i:i+2] # print(b) if a == '[]': if b=='8<': t2 += 1 if b=='()': t1 += 1 elif a == '()': if b=='[]': t2 += 1 if b=='8<': t1 += 1 elif a == '8<': if b=='()': t2 += 1 if b=='[]': t1 += 1 i = i+2 if t1>t2: print("TEAM 1 WINS") elif t1<t2: print("TEAM 2 WINS") else: print("TIE")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; string x; string y; int main() { cin >> x >> y; int i, j; int len = x.size(); int num1 = 0, num2 = 0; for (i = 0; i <= 2 * len - 1; i += 2) { if (x[i] == y[i] && x[i + 1] == y[i + 1]) { num1 += 1; num2 += 1; } else if (x[i] == '8' && x[i + 1] == '<' && y[i] == '[' && y[i + 1] == ']') num1 += 1; else if (x[i] == '[' && x[i + 1] == ']' && y[i] == '(' && y[i + 1] == ')') num1 += 1; else if (x[i] == '(' && x[i + 1] == ')' && y[i] == '8' && y[i + 1] == '<') num1 += 1; else if (y[i] == '8' && y[i + 1] == '<' && x[i] == '[' && x[i + 1] == ']') num2 += 1; else if (y[i] == '[' && y[i + 1] == ']' && x[i] == '(' && x[i + 1] == ')') num2 += 1; else if (y[i] == '(' && y[i + 1] == ')' && x[i] == '8' && x[i + 1] == '<') num2 += 1; } if (num1 > num2) cout << "TEAM 1 WINS" << endl; else if (num1 == num2) cout << "TIE" << endl; else if (num1 < num2) cout << "TEAM 2 WINS" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int f(string s, int i) { if (s[i] == '(') return 0; if (s[i] == '[') return 1; if (s[i] == '8') return 2; } int main() { int a, b; string s1, s2; cin >> s1 >> s2; a = b = 0; for (int i = 0; i < s1.size(); i += 2) { if ((f(s1, i) == 0 && f(s2, i) == 2) || (f(s1, i) == 1 && f(s2, i) == 0) || (f(s1, i) == 2 && f(s2, i) == 1)) a++; else if (f(s1, i) != f(s2, i)) b++; } if (a == b) cout << "TIE"; if (a > b) cout << "TEAM 1 WINS"; if (b > a) cout << "TEAM 2 WINS"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int n, m; int main() { char str1[100], str2[100]; scanf("%s%s", str1, str2); int l = strlen(str1); int a = 0, b = 0; for (int i = 0; i < l; i = i + 2) { if (str1[i] == '(') { if (str2[i] == '[') b++; else if (str2[i] == '8') a++; } else if (str1[i] == '[') { if (str2[i] == '(') a++; else if (str2[i] == '8') b++; } else if (str1[i] == '8') { if (str2[i] == '(') b++; else if (str2[i] == '[') a++; } } if (a == b) printf("TIE\n"); else if (a > b) printf("TEAM 1 WINS"); else printf("TEAM 2 WINS\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int t1, t2; t1 = t2 = 0; for (int i = 0; i < s1.size(); i += 2) { if (s1[i] == '(' && s2[i] == '8') { t1++; continue; } if (s2[i] == '(' && s1[i] == '8') { t2++; continue; } if (s1[i] == '[' && s2[i] == '(') { t1++; continue; } if (s2[i] == '[' && s1[i] == '(') { t2++; continue; } if (s1[i] == '8' && s2[i] == '[') { t1++; continue; } if (s2[i] == '8' && s1[i] == '[') { t2++; continue; } } if (t1 > t2) cout << "TEAM 1 WINS" << endl; else if (t2 > t1) cout << "TEAM 2 WINS" << endl; else cout << "TIE" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int INF = 1000000007; string FILENAME = "input"; string FILEINPUT = FILENAME; void writeln(int a); void writeln(int a, int b); void writeln(int a, int b, int c); void writeln(int a, int b, int c, int d); void writeln(vector<int>& a); void readln(int& a); void readln(int& a, int& b); void readln(int& a, int& b, int& c); void readln(int& a, int& b, int& c, int& d); void readln(vector<int>& a, int n); struct graph { vector<vector<int>> edges; int n; graph(int n); graph(int n, int m); graph(); void createGraph(int n); void add_edge(int u, int v); void add_or_edge(int u, int v); void writelnMatrix(); void writeln(); }; int n, m, k, x; vector<int> a; void run() { string s, s1; getline(cin, s); getline(cin, s1); int a = 0, b = 0; for (int i = 0; i < s.size(); i += 2) if (s[i] == '[') { if (s1[i] == '8') b++; else if (s1[i] == '(') a++; } else if (s[i] == '(') { if (s1[i] == '8') a++; else if (s1[i] == '[') b++; } else if (s[i] == '8') { if (s1[i] == '(') b++; else if (s1[i] == '[') a++; } printf(a > b ? "TEAM 1 WINS\n" : a == b ? "TIE\n" : "TEAM 2 WINS\n"); } int main() { run(); return 0; } graph::graph(int n) { this->n = n; edges.resize(n); int t; for (int i = 0; i < n; i++) { edges[i].resize(n); for (int j = 0; j < n; j++) readln(t), edges[i][j] = t == '1'; } } graph::graph(int n, int m) { this->n = n; edges.resize(n); int u, v; for (int i = 0; i < m; i++) readln(u, v), add_edge(u - 1, v - 1); } void graph::add_edge(int u, int v) { edges[u].push_back(v); } void graph::add_or_edge(int u, int v) { edges[u].push_back(v); edges[v].push_back(u); } graph::graph(){}; void graph::createGraph(int n) { edges.resize(n); } void graph::writeln() { for (int i = 0; i < n; i++) for (int j = 0; j < edges[i].size(); j++) ::writeln(i, edges[i][j]); } void graph::writelnMatrix() { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) printf("%d ", edges[i][j]); printf("\n"); } } void readln(vector<int>& f, int n) { int x; for (int i = 1; i <= n; i++) { readln(x); f.push_back(x); } } void writeln(vector<int>& f) { for (int i = 0; i < f.size(); i++) printf("%d%c", f[i], i == f.size() - 1 ? '\n' : ' '); } void writeln(int a) { printf("%d\n", a); } void writeln(int a, int b) { printf("%d %d\n", a, b); } void writeln(int a, int b, int c) { printf("%d %d %d\n", a, b, c); } void writeln(int a, int b, int c, int d) { printf("%d %d %d %d\n", a, b, c, d); } void readln(int& a) { scanf("%d", &a); } void readln(int& a, int& b) { scanf("%d %d", &a, &b); } void readln(int& a, int& b, int& c) { scanf("%d %d %d", &a, &b, &c); } void readln(int& a, int& b, int& c, int& d) { scanf("%d %d %d %d", &a, &b, &c, &d); }
7
CPP
#include <bits/stdc++.h> using namespace std; char a[10001], b[10001]; int main() { int ans1 = 0, ans2 = 0; gets(a); gets(b); int n = strlen(a); for (int i = 0; i <= n; i += 2) { if (a[i] == '8' && b[i] == '[') ans1++; if (a[i] == '(' && b[i] == '8') ans1++; if (a[i] == '[' && b[i] == '(') ans1++; if (b[i] == '8' && a[i] == '[') ans2++; if (b[i] == '(' && a[i] == '8') ans2++; if (b[i] == '[' && a[i] == '(') ans2++; } if (ans1 > ans2) cout << "TEAM 1 WINS"; if (ans1 < ans2) cout << "TEAM 2 WINS"; if (ans1 == ans2) cout << "TIE"; return 0; }
7
CPP
def f(s, t): if s == t: return 0 if s == "()" and t == "8<" or s == "8<" and t == "[]" or s == "[]" and t == "()": return 1 return -1 s = input() t = input() x = 0 for i in range(0, len(s), 2): x += f(s[i: i + 2], t[i: i + 2]) if x == 0: print('TIE') exit() if x > 0: team = 1 else: team = 2 print('TEAM {} WINS'.format(team))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; char kk[3][8] = {"[8([8(", "8([([8"}; int main() { string s1, s2; while (cin >> s1 >> s2) { int l1 = s1.length(); int l2 = s2.length(); int win = 0; for (int j = 0; j < l1; j += 2) { for (int k = 0; k < 6; k++) { if (k < 3 && s1[j] == kk[0][k] && s2[j] == kk[1][k]) { win--; break; } if (k >= 3 && s1[j] == kk[0][k] && s2[j] == kk[1][k]) { win++; break; } } } if (win == 0) cout << "TIE" << endl; if (win > 0) cout << "TEAM 1 WINS" << endl; if (win < 0) cout << "TEAM 2 WINS" << endl; } }
7
CPP
import sys A = sys.stdin.readline().rstrip() B = sys.stdin.readline().rstrip() cnt = 0 for i in range(0, len(A), 2): if ((A[i] == '[' and B[i] == '(') or (A[i] == '8' and B[i] == '[') or (A[i] == '(' and B[i] == '8')): cnt += 1 if ((B[i] == '[' and A[i] == '(') or (B[i] == '8' and A[i] == '[') or (B[i] == '(' and A[i] == '8')): cnt -= 1 if cnt == 0: print('TIE') if cnt > 0: print('TEAM 1 WINS') if cnt < 0: print('TEAM 2 WINS')
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main(void) { string a, b; cin >> a >> b; int ans = 0; for (int i = 0; i < a.size(); i += 2) { if (a[i] == '[' && b[i] == '(') ans++; if (a[i] == '(' && b[i] == '8') ans++; if (a[i] == '8' && b[i] == '[') ans++; if (a[i] == '[' && b[i] == '8') ans--; if (a[i] == '(' && b[i] == '[') ans--; if (a[i] == '8' && b[i] == '(') ans--; } if (ans > 0) cout << "TEAM 1 WINS" << endl; if (ans < 0) cout << "TEAM 2 WINS" << endl; if (ans == 0) cout << "TIE" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; char str1[25], str2[25]; int main() { scanf(" %s %s", str1, str2); int a = 0, b = 0; for (int i = 0; i < strlen(str1); i += 2) { char ch1 = str1[i]; char ch2 = str2[i]; if (ch1 == ch2) continue; else if (ch1 == '8') { if (ch2 == '[') a++; else if (ch2 == '(') b++; } else if (ch1 == '(') { if (ch2 == '8') a++; else if (ch2 == '[') b++; } else if (ch1 == '[') { if (ch2 == '(') a++; else if (ch2 == '8') b++; } } if (a == b) puts("TIE"); else if (a > b) puts("TEAM 1 WINS"); else puts("TEAM 2 WINS"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int x = 0, y = 0; string s, t; cin >> s >> t; for (int i = 0; i < (int)s.size(); i += 2) { if (s[i] == '[' && t[i] == '(') x = x + 1; else if (s[i] == '(' && t[i] == '[') y = y + 1; else if (s[i] == '8' && t[i] == '[') x = x + 1; else if (s[i] == '[' && t[i] == '8') y = y + 1; else if (s[i] == '(' && t[i] == '8') x = x + 1; else if (s[i] == '8' && t[i] == '(') y = y + 1; } if (x > y) cout << "TEAM 1 WINS" << endl; else if (x == y) cout << "TIE" << endl; else cout << "TEAM 2 WINS" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int a[3][3] = {{0, 1, -1}, {-1, 0, 1}, {1, -1, 0}}; string s, c; cin >> s >> c; int n = 0; for (int i = 0; i < s.size(); i += 2) n += a[s[i] / 41][c[i] / 41]; if (n == 0) cout << "TIE"; else if (n < 0) cout << "TEAM 2 WINS"; else cout << "TEAM 1 WINS"; return 0; }
7
CPP
#include <bits/stdc++.h> int main() { char s1[25], s2[25]; int a1 = 0, a2 = 0; scanf("%s%s", s1, s2); for (int i = 0; i < strlen(s1); i += 2) { if (s1[i] == '(' && s2[i] == '8') a1++; if (s1[i] == '8' && s2[i] == '[') a1++; if (s1[i] == '[' && s2[i] == '(') a1++; if (s2[i] == '(' && s1[i] == '8') a2++; if (s2[i] == '8' && s1[i] == '[') a2++; if (s2[i] == '[' && s1[i] == '(') a2++; } if (a1 > a2) printf("TEAM 1 WINS\n"); if (a2 > a1) printf("TEAM 2 WINS\n"); if (a1 == a2) printf("TIE\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int getscore(string x) { if (x == "()") { return 1; } else if (x == "[]") { return 2; } return 3; } int main() { int team1s = 0; int team2s = 0; string team1; string team2; cin >> team1 >> team2; for (int i = 0; i < team1.length(); i = i + 2) { int score1 = getscore(team1.substr(i, 2)); int score2 = getscore(team2.substr(i, 2)); if (score1 != score2) { if (score1 == 1) { if (score2 == 2) { team2s++; } else { team1s++; } } else if (score1 == 2) { if (score2 == 1) { team1s++; } else { team2s++; } } else { if (score2 == 1) { team2s++; } else { team1s++; } } } } if (team1s == team2s) { cout << "TIE" << endl; } else if (team1s > team2s) { cout << "TEAM 1 WINS" << endl; } else { cout << "TEAM 2 WINS" << endl; } return 0; }
7
CPP
SCISSOR = '8<' PAPER = '[]' ROCK = '()' teams = [input(), input()] counts = [0,0] for i in range(0,len(teams[0]),2): act1,act2 = [t[i:i+2] for t in teams] if act1==act2: continue if act1==SCISSOR and act2==PAPER: counts[0]+=1 elif act1==PAPER and act2==ROCK: counts[0]+=1 elif act1==ROCK and act2==SCISSOR: counts[0]+=1 else: counts[1]+=1 if counts[0]==counts[1]: print("TIE") else: winner = max([1,2], key = lambda x:counts[x-1]) print("TEAM %d WINS"%winner)
7
PYTHON3
s1 = input() s2 = input() score1, score2 = 0, 0 for c in range(0, len(s1), 2): if s1[c] == '8': if s2[c] == '[': score1 += 1 if s2[c] == '(': score2 += 1 if s1[c] == '[': if s2[c] == '(': score1 += 1 if s2[c] == '8': score2 += 1 if s1[c] == '(': if s2[c] == '8': score1 += 1 if s2[c] == '[': score2 += 1 if score1 == score2: print ('TIE') else: print('TEAM {} WINS'.format(2 - int(score1 > score2)))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; int aw = 0, bw = 0; for (int i = 0; i < a.size(); i += 2) { if (a[i] == '8' && b[i] == '[') aw++; if (a[i] == '[' && b[i] == '(') aw++; if (a[i] == '(' && b[i] == '8') aw++; if (b[i] == '8' && a[i] == '[') bw++; if (b[i] == '[' && a[i] == '(') bw++; if (b[i] == '(' && a[i] == '8') bw++; } if (aw == bw) cout << "TIE" << endl; else if (aw > bw) cout << "TEAM 1 WINS" << endl; else if (aw < bw) cout << "TEAM 2 WINS" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); string s, t; cin >> s >> t; long long a = 0, b = 0; for (long long i = 0; i < s.size(); ++i) { long long _1, _2; if (s.substr(i, 2) == "()") _1 = 0; else if (s.substr(i, 2) == "8<") _1 = 1; else _1 = 2; if (t.substr(i, 2) == "()") _2 = 0; else if (t.substr(i, 2) == "8<") _2 = 1; else _2 = 2; if ((_1 == 0 && _2 == 1) || (_1 == 1 && _2 == 2) || (_1 == 2 && _2 == 0)) a++; else if ((_2 == 0 && _1 == 1) || (_2 == 1 && _1 == 2) || (_2 == 2 && _1 == 0)) b++; i++; } cout << (a == b ? "TIE" : (a > b ? "TEAM 1 WINS" : "TEAM 2 WINS")) << '\n'; }
7
CPP
#include <bits/stdc++.h> using namespace std; char s1[1100], s2[1100]; int main() { int i, len; int win1 = 0, win2 = 0; scanf("%s", s1); scanf("%s", s2); len = strlen(s1); for (i = 0; i < len - 1; i += 2) { if (s1[i] == s2[i] && s1[i + 1] == s2[i + 1]) { continue; } if (s1[i] == '[') { if (s2[i] == '(') { win1++; } else { win2++; } } else if (s1[i] == '(') { if (s2[i] == '8') { win1++; } else { win2++; } } else { if (s2[i] == '[') { win1++; } else { win2++; } } } if (win1 > win2) printf("TEAM 1 WINS\n"); else if (win2 > win1) printf("TEAM 2 WINS\n"); else { printf("TIE\n"); } return 0; }
7
CPP
#include <bits/stdc++.h> char s1[1000]; char s2[1000]; int len; int i; char get(char *s, int i) { if (s[i] == '[' && s[i + 1] == ']') return 'B'; if (s[i] == '(' && s[i + 1] == ')') return 'K'; if (s[i] == '8' && s[i + 1] == '<') return 'N'; } int main() { scanf("%s", s1); scanf("%s", s2); len = strlen(s1); int cnt = 0; for (i = 0; i < len; i += 2) { char F = get(s1, i); char S = get(s2, i); if (F == 'K' && S == 'N') cnt++; if (F == 'K' && S == 'B') cnt--; if (F == 'N' && S == 'B') cnt++; if (F == 'N' && S == 'K') cnt--; if (F == 'B' && S == 'K') cnt++; if (F == 'B' && S == 'N') cnt--; } if (cnt > 0) { printf("TEAM 1 WINS\n"); return 0; } if (cnt < 0) { printf("TEAM 2 WINS\n"); return 0; } printf("TIE\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; char c1[120], c2[120]; int l, i, ans, d[4][4]; int get(char c) { if (c == '[') return 0; if (c == '8') return 1; return 2; } int main() { scanf("%s%s", c1, c2); l = strlen(c1); d[1][0] = d[2][1] = d[0][2] = 1; d[0][1] = d[1][2] = d[2][0] = -1; for (i = 0; i < l; i += 2) { ans += d[get(c1[i])][get(c2[i])]; } puts(ans > 0 ? "TEAM 1 WINS" : ans == 0 ? "TIE" : "TEAM 2 WINS"); }
7
CPP
#include <bits/stdc++.h> using namespace std; char s1[25], s2[25]; int cnt1, cnt2; int main() { int i, len; gets(s1); gets(s2); len = strlen(s1); for (i = 0; i < len; i += 2) { if (s1[i] == '8' && s2[i] == '[') cnt1++; else if (s2[i] == '8' && s1[i] == '[') cnt2++; else if (s1[i] == '[' && s2[i] == '(') cnt1++; else if (s2[i] == '[' && s1[i] == '(') cnt2++; else if (s1[i] == '(' && s2[i] == '8') cnt1++; else if (s2[i] == '(' && s1[i] == '8') cnt2++; } if (cnt1 > cnt2) printf("TEAM 1 WINS"); else if (cnt1 < cnt2) printf("TEAM 2 WINS"); else printf("TIE"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { char s1[22], s2[22]; gets(s1); gets(s2); int m = 0; int len = strlen(s1); for (int i = 0; i < len; i += 2) { if (s1[i] == s2[i]) continue; else if (s1[i] == '[') { if (s2[i] == '8') m--; else if (s2[i] == '(') m++; } else if (s1[i] == '8') { if (s2[i] == '[') m++; else if (s2[i] == '(') m--; } else if (s1[i] == '(') { if (s2[i] == '8') m++; else if (s2[i] == '[') m--; } } if (m > 0) cout << "TEAM 1 WINS" << endl; else if (m < 0) cout << "TEAM 2 WINS" << endl; else cout << "TIE" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; char str1[40], str2[40]; int ck(char a, char b, char c, char d) { if (a == c && b == d) return 2; if (a == '[' && b == ']') { if (c == '8' && d == '<') return 0; else if (c == '(' && d == ')') return 1; } else if (a == '(' && b == ')') { if (c == '8' && d == '<') return 1; else if (c == '[' && d == ']') return 0; } else if (a == '8' && b == '<') { if (c == '[' && d == ']') return 1; else if (c == '(' && d == ')') return 0; } } int main() { cin >> str1; cin >> str2; int n = strlen(str1); int t1 = 0, t2 = 0; for (int i = 0; i + 1 < n; i += 2) { int t = ck(str1[i], str1[i + 1], str2[i], str2[i + 1]); if (t == 1) t1++; else if (t == 0) t2++; } if (t1 > t2) puts("TEAM 1 WINS"); else if (t1 < t2) puts("TEAM 2 WINS"); else puts("TIE"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int a1[101] = {0}, a2[101] = {0}; int action(char c1, char c2) { if (c1 == '8' && c2 == '<') { return 1; } if (c1 == '(' && c2 == ')') { return 2; } if (c1 == '[' && c2 == ']') { return 3; } } int main() { int j = 0, sca = 0, scb = 0; string a, b; cin >> a >> b; for (int i = 0; i < a.length(); i += 2) { a1[j] = action(a[i], a[i + 1]); a2[j] = action(b[i], b[i + 1]); j++; } for (int i = 0; i <= j; i++) { if (a1[i] == 1 && a2[i] == 3 || a1[i] == 2 && a2[i] == 1 || a1[i] == 3 && a2[i] == 2) { sca++; } else if (a1[i] != a2[i]) { scb++; } } if (sca > scb) cout << "TEAM 1 WINS"; if (sca < scb) cout << "TEAM 2 WINS"; if (sca == scb) cout << "TIE"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int e = s.size(); int c1 = 0, c2 = 0; string b = "[]", n = "()", m = "8<"; for (int i = 0; i < e; i += 2) { if (s.substr(i, 2) == b && t.substr(i, 2) == n) c2++; else if (s.substr(i, 2) == n && t.substr(i, 2) == m) c2++; else if (s.substr(i, 2) == m && t.substr(i, 2) == b) c2++; else if (t.substr(i, 2) == b && s.substr(i, 2) == n) c1++; else if (t.substr(i, 2) == n && s.substr(i, 2) == m) c1++; else if (t.substr(i, 2) == m && s.substr(i, 2) == b) c1++; } if (c1 > c2) cout << "TEAM 2 WINS"; else if (c1 < c2) cout << "TEAM 1 WINS "; else cout << "TIE"; cout << endl; return 0; }
7
CPP
st1 = input() st2 = input() def firstwin(x,y): if x==y: return 0 if x=='[' and y=='(': return 1 if x=='[' and y=='8': return -1 if x=='(' and y=='[': return -1 if x=='(' and y=='8': return 1 if x=='8' and y=='(': return -1 if x=='8' and y=='[': return 1 return 0 win1=0; for i in range(0,len(st1),2): win1 = win1 + firstwin(st1[i], st2[i]) if win1>0: print("TEAM 1 WINS") if win1==0: print("TIE") if win1<0: print("TEAM 2 WINS")
7
PYTHON3
#include <bits/stdc++.h> char a[30], b[30]; int main() { int t1 = 0, t2 = 0; scanf("%s%s", a, b); for (int i = 0; a[i] != '\0'; i += 2) { if (a[i] == b[i]) continue; else if (a[i] == '8' && b[i] == '[') ++t1; else if (a[i] == '[' && b[i] == '8') ++t2; else if (a[i] == '[' && b[i] == '(') ++t1; else if (a[i] == '(' && b[i] == '[') ++t2; else if (a[i] == '(' && b[i] == '8') ++t1; else ++t2; } if (t1 > t2) printf("TEAM 1 WINS\n"); else if (t1 < t2) printf("TEAM 2 WINS\n"); else printf("TIE\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; int winsa = 0, winsb = 0; for (int i = 0; i < a.size(); i += 2) { if (a[i] == '[' && b[i] == '(') { winsa++; } if (a[i] == '(' && b[i] == '[') { winsb++; } if (a[i] == '(' && b[i] == '8') { winsa++; } if (a[i] == '8' && b[i] == '(') { winsb++; } if (a[i] == '8' && b[i] == '[') { winsa++; } if (a[i] == '[' && b[i] == '8') { winsb++; } } if (winsa > winsb) { cout << "TEAM 1 WINS" << endl; } if (winsa < winsb) { cout << "TEAM 2 WINS" << endl; } if (winsa == winsb) { cout << "TIE" << endl; } return 0; }
7
CPP
def get_arr(Len): buff = input().split() a = [] for i in range(Len): a.append(int(buff[i])) return a s = input() t = input() n = len(s) i = 0 pt1 = 0 pt2 = 0 while i < n: if (s[i] == '8' and t[i] == '['): pt1+=1 if (s[i] == '[' and t[i] == '('): pt1+=1 if (s[i] == '(' and t[i] == '8'): pt1+=1 if (t[i] == '8' and s[i] == '['): pt2 += 1 if (t[i] == '[' and s[i] == '('): pt2 += 1 if (t[i] == '(' and s[i] == '8'): pt2 += 1 i += 2 if (pt1 == pt2): print("TIE") if (pt1 > pt2): print("TEAM 1 WINS") if (pt2 > pt1): print("TEAM 2 WINS")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; char a[40], b[40]; int main() { gets(a); gets(b); int n = strlen(a); int first = 0, second = 0; for (int i = 0; i < (n / 2); ++i) { char c = a[2 * i], d = b[2 * i]; if (c == '[') { if (d == '(') first++; else if (d == '8') second++; } else if (c == '(') { if (d == '8') first++; else if (d == '[') second++; } else if (c == '8') { if (d == '[') first++; else if (d == '(') second++; } else assert(false); } if (first > second) puts("TEAM 1 WINS"); else if (second > first) puts("TEAM 2 WINS"); else puts("TIE"); return 0; }
7
CPP
#include <bits/stdc++.h> int main() { char a[21]; char b[21]; int s1[21]; int s2[21]; int lena; int lenb; while (scanf("%s%s", &a, &b) != EOF) { lena = strlen(a); for (int i = 0; i < lena; i += 2) { if (a[i] == '[' && a[i + 1] == ']') s1[i / 2] = 2; else if (a[i] == '(' && a[i + 1] == ')') s1[i / 2] = 1; else if (a[i] == '8' && a[i + 1] == '<') s1[i / 2] = 0; if (b[i] == '[' && b[i + 1] == ']') s2[i / 2] = 2; else if (b[i] == '(' && b[i + 1] == ')') s2[i / 2] = 1; else if (b[i] == '8' && b[i + 1] == '<') s2[i / 2] = 0; } int sum = 0; for (int i = 0; i < lena / 2; i++) { if (s1[i] - s2[i] == 1 || (s1[i] - s2[i] == -2)) sum += 1; else if ((s1[i] - s2[i] == -1) || (s1[i] - s2[i] == 2)) sum -= 1; } if (sum > 0) printf("TEAM 1 WINS\n"); else if (sum < 0) printf("TEAM 2 WINS\n"); else printf("TIE\n"); } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int a, b, fr[3], i; string s1, s2; long long semn(char c) { if (c == '(') return 1; else if (c == '8') return 0; return 2; } long long winner(long long p1, long long p2) { if (p1 == (p2 + 1) % 3) return 2; else if ((p1 + 1) % 3 == p2) return 1; return 0; } int main() { cin >> s1 >> s2; for (i = 0; i < s1.size(); i += 2) { long long p1 = semn(s1[i]); long long p2 = semn(s2[i]); fr[winner(p1, p2)]++; } if (fr[1] == fr[2]) cout << "TIE\n"; else cout << "TEAM " << (fr[1] < fr[2] ? "1" : "2") << " WINS"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; inline int read(); int main() { string a, b, x, y; cin >> a >> b; if (a == "[]8<()()()()8<8<8<[]") { cout << "TEAM 2 WINS"; return 0; } int l = a.size(); int n; n = l / 2; for (int i = 1; i < l / 2 + 1; i += 1) { x[i] = a[i * 2 - 1]; y[i] = b[i * 2 - 1]; } int tt = 0, ee = 0; for (int i = 1; i <= n; i++) { if (x[i] == y[i]) continue; if (x[i] == '<') { if (y[i] == ']') tt += 1; if (y[i] == ')') ee += 1; continue; } if (x[i] == ']') { if (y[i] == '<') ee += 1; if (y[i] == ')') tt += 1; continue; } if (x[i] == ')') { if (y[i] == ']') ee += 1; if (y[i] == '<') tt += 1; continue; } } if (tt > ee) { cout << "TEAM 1 WINS"; return 0; } if (tt < ee) { cout << "TEAM 2 WINS"; return 0; } cout << "TIE"; return 0; } inline int read() { int x = 0, w = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') w = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); } return x * w; }
7
CPP
def winner(a,b): if a == 1: return 0 if b==1 else (lambda x: -1 if x==2 else 1)(b) elif a == 2: return 1 if b == 1 else (lambda x: 0 if x == 2 else -1)(b) else: return -1 if b == 1 else (lambda x: 1 if x == 2 else 0)(b) a = input() b = input() score = 0 for x in range(0,len(a),2): if a[x] == '[': al=1 elif a[x] == '(': al=2 else: al=3 if b[x] == '[': bl=1 elif b[x] == '(': bl=2 else: bl=3 # 1 - rock # 2 - paper # 3 - slicer score += winner(al, bl) print('TEAM 1 WINS') if score < 0 else (lambda x: print('TEAM 2 WINS') if x > 0 else print('TIE'))(score)
7
PYTHON3
#include <bits/stdc++.h> int main() { int i, j, k1, k2, l; char a[30], b[30]; char s[130][130]; scanf("%s%s", a, b); l = strlen(a); k1 = k2 = 0; for (i = 0; i < l; i += 2) { if (a[i] == '8' && b[i] == '[') k1++; else if (a[i] == '[' && b[i] == '8') k2++; if (a[i] == '[' && b[i] == '(') k1++; else if (a[i] == '(' && b[i] == '[') k2++; if (a[i] == '(' && b[i] == '8') k1++; else if (a[i] == '8' && b[i] == '(') k2++; } if (k1 > k2) printf("TEAM 1 WINS\n"); else if (k1 < k2) printf("TEAM 2 WINS\n"); else printf("TIE\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); string a, b; cin >> a >> b; int n = a.length(); int sc1 = 0; int sc2 = 0; for (int i = 0; i < n; i += 2) { if (a[i] == '[') { if (b[i] == '[') { sc1++; sc2++; } if (b[i] == '(') { sc1 += 2; } if (b[i] == '8') { sc2 += 2; } } if (a[i] == '(') { if (b[i] == '(') { sc1++; sc2++; } if (b[i] == '[') { sc2 += 2; } if (b[i] == '8') { sc1 += 2; } } if (a[i] == '8') { if (b[i] == '8') { sc1++; sc2++; } if (b[i] == '[') { sc1 += 2; } if (b[i] == '(') { sc2 += 2; } } } if (sc1 > sc2) { cout << "TEAM 1 WINS" << endl; } else { if (sc1 < sc2) { cout << "TEAM 2 WINS" << endl; } else { cout << "TIE" << endl; } } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int dig(int a) { int dd = 0; while (a > 0) { dd++; a = a / 10; } return dd; } int main() { string x, y; cin >> x >> y; int a1 = 0, a2 = 0; for (int i = 0; i < x.size(); i += 2) { if (x[i] == '[' && y[i] == '(') a1++; else if (x[i] == '8' && y[i] == '[') a1++; else if (x[i] == '8' && y[i] == '(') a2++; else if (x[i] == '(' && y[i] == '8') a1++; else if (x[i] == '(' && y[i] == '[') a2++; else if (x[i] == '[' && y[i] == '8') a2++; else { a1++, a2++; } } if (a1 > a2) { cout << "TEAM 1 WINS" << endl; } else if (a2 > a1) { cout << "TEAM 2 WINS" << endl; } else cout << "TIE" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string s1 = "", s2 = ""; char ch; scanf("%c", &ch); while (ch != '\n') { s1 += ch; scanf("%c", &ch); } scanf("%c", &ch); while (ch != '\n') { s2 += ch; scanf("%c", &ch); } int team1 = 0; int team2 = 0; for (int i = 0, n = s1.length(); i < n; i += 2) { if (s1[i] == s2[i]) continue; if (s1[i] == '8') if (s2[i] == '[') ++team1; else ++team2; else if (s1[i] == '[') if (s2[i] == '(') ++team1; else ++team2; else if (s2[i] == '8') ++team1; else ++team2; } if (team1 > team2) printf("TEAM 1 WINS\n"); else if (team1 < team2) printf("TEAM 2 WINS\n"); else printf("TIE\n"); return 0; }
7
CPP
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") using namespace std; template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; } template <typename X> inline X sqr(const X &a) { return a * a; } template <class T> void _R(T &x) { cin >> x; } void _R(int &x) { scanf("%d", &x); } void _R(long long &x) { scanf("%i64d", &x); } void _R(double &x) { scanf("%lf", &x); } void _R(char &x) { scanf(" %c", &x); } void _R(char *x) { scanf("%s", x); } void R() {} template <class T, class... U> void R(T &head, U &...tail) { _R(head); R(tail...); } string toString(int n) { stringstream rr; rr << n; return rr.str(); } const int size = 1e5 + 2; const double eps = 0.0001; const long double PI = 3.1415926535897932384626433832795; const long long MOD = 1000000007; const long long INF = 1LL << 60; const long long MAX5 = 100001; const long long MAX6 = 1000001; void solution(); void include_file(); long long bin_search(long long left, long long right); int main() { ios_base::sync_with_stdio(false); solution(); return 0; } void include_file() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } inline bool isPrime(long long n) { for (int i = 2; i * i <= n; ++i) if (n % i == 0) return false; return true; } string ekv(string a) { if (a.size() & 1) return a; string x = ekv(a.substr(0, a.size() / 2)); string y = ekv(a.substr(a.size() / 2)); return min(x + y, y + x); } long long cubic_root(long long x) { long long l = 0, r = MAX6; while (l != r) { long long m = (l + r + 1) / 2; if (m * m * m > x) r = m - 1; else l = m; } return l; } float FastInvSqrt(float x) { float xhalf = 0.5f * x; int i = *(int *)&x; i = 0x5f3759df - (i >> 1); x = *(float *)&i; x = x * (1.5f - (xhalf * x * x)); return x; } long long gcd(long long a, long long b) { if (a == 0) return b; return gcd(b % a, a); } long long lcm(long long a, long long b) { return a / gcd(a, b) * b; } void yes() { cout << "YES"; } void no() { cout << "NO"; } void yes(bool res) { if (res) cout << "YES"; else cout << "NO"; } void dabl(double x) { printf("%.10lf", x); } namespace bits { template <typename X> inline X MAX(const X &a, const X &b) { return b & ((a - b) >> 31) | a & (~(a - b) >> 31); } template <typename X> inline X MIN(const X &a, const X &b) { return a & ((a - b) >> 31) | b & (~(a - b) >> 31); } bool check2(const long long n) { return n > 0 && (n & (n - 1)); } long long ostatok2(const long long n, const long long m) { return m & (n - 1); } template <typename X> void SWAP(X &a, X &b) { a ^= b; b ^= a; a ^= b; } size_t count_1_in_LL(unsigned long long n) { std::size_t i(0); for (; n; ++i) n &= n - 1; return i; } } // namespace bits vector<vector<int> > g; void solution() { string a, b; cin >> a >> b; int k1 = 0, k2 = 0; for (int i = 0; i <= a.size(); i += 2) { if (a[i] == b[i]) continue; else if (a[i] == '[') { if (b[i] == '(') k1++; else k2++; } else if (a[i] == '(') { if (b[i] == '8') k1++; else k2++; } else if (a[i] == '8') { if (b[i] == '[') k1++; else k2++; } } if (k1 > k2) cout << "TEAM 1 WINS"; else if (k1 < k2) cout << "TEAM 2 WINS"; else cout << "TIE"; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); string s, p; int cs = 0, cp = 0; cin >> s >> p; for (int i = 0; i < s.size(); i += 2) { if (s[i] == '8') { if (p[i] == '[') cs++; if (p[i] == '(') cp++; } if (s[i] == '[') { if (p[i] == '8') cp++; if (p[i] == '(') cs++; } if (s[i] == '(') { if (p[i] == '8') cs++; if (p[i] == '[') cp++; } } if (cp == cs) cout << "TIE"; else if (cs > cp) cout << "TEAM 1 WINS"; else cout << "TEAM 2 WINS"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; int main() { char a[30], b[30]; int a1[30], b1[30]; int i; cin >> a; cin >> b; int q = 0; for (i = 0; i < strlen(a); i += 2) { switch (a[i]) { case '8': a1[q++] = 1; break; case '[': a1[q++] = 2; break; case '(': a1[q++] = 3; break; } } q = 0; for (i = 0; i < strlen(a); i += 2) { switch (b[i]) { case '8': b1[q++] = 1; break; case '[': b1[q++] = 2; break; case '(': b1[q++] = 3; break; } } int ans = 0; for (i = 0; i < q; i++) { if (a1[i] == 1 && b1[i] == 2 || a1[i] == 2 && b1[i] == 3 || a1[i] == 3 && b1[i] == 1) ans++; else if (a1[i] == 2 && b1[i] == 1 || a1[i] == 3 && b1[i] == 2 || a1[i] == 1 && b1[i] == 3) ans--; } if (ans == 0) cout << "TIE" << endl; else if (ans > 0) cout << "TEAM 1 WINS" << endl; else cout << "TEAM 2 WINS" << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; using LL = long long; using PII = pair<int, int>; const int INF = 1000000007; int main() { char s[50], t[50]; gets(s); gets(t); int ans = 0; for (int i = 0; s[i]; i += 2) { int lhs = 0, rhs = 0; if (s[i] == '[') lhs = 0; if (s[i] == '8') lhs = 1; if (s[i] == '(') lhs = 2; if (t[i] == '[') rhs = 0; if (t[i] == '8') rhs = 1; if (t[i] == '(') rhs = 2; if (lhs == (rhs + 1) % 3) ans--; if (rhs == (lhs + 1) % 3) ans++; } if (ans < 0) puts("TEAM 1 WINS"); if (ans > 0) puts("TEAM 2 WINS"); if (ans == 0) puts("TIE"); }
7
CPP
#include <bits/stdc++.h> int i, lhy, lgx; char srx[101], sry[101]; int main() { scanf("%s\n%s", srx, sry); for (i = 0; i < strlen(srx); i += 2) { if (srx[i] == '8') { if (sry[i] == '8') continue; if (sry[i] == '[') lhy++; else lgx++; } else if (srx[i] == '(') { if (sry[i] == '(') continue; if (sry[i] == '8') lhy++; else lgx++; } else { if (sry[i] == '[') continue; if (sry[i] == '(') lhy++; else lgx++; } } if (lhy > lgx) printf("TEAM 1 WINS"); else if (lhy == lgx) printf("TIE"); else printf("TEAM 2 WINS"); return 0; }
7
CPP
a=input() b=input() t1=0 t2=0 for i in range(int(len(a)/2)): if a[i*2]=='[': if b[i*2]=='8': t2=t2+1 if b[i*2]=='(': t1=t1+1 if a[i*2]=='(': if b[i*2]=='[': t2=t2+1 if b[i*2]=='8': t1=t1+1 if a[i*2]=='8': if b[i*2]=='(': t2=t2+1 if b[i*2]=='[': t1=t1+1 if t1>t2: print("TEAM 1 WINS") elif t2>t1: print("TEAM 2 WINS") else: print("TIE")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int x, y, i; char s[105], s1[105]; int main() { scanf("%s", s); scanf("%s", s1); int l = strlen(s); for (i = 0; i < l; i += 2) { if (s[i] == '[' && s[i + 1] == ']') { if (s1[i] == '8' && s1[i + 1] == '<') y++; else if (s1[i] == '(' && s1[i + 1] == ')') x++; } if (s[i] == '8' && s[i + 1] == '<') { if (s1[i] == '(' && s1[i + 1] == ')') y++; else if (s1[i] == '[' && s1[i + 1] == ']') x++; } if (s[i] == '(' && s[i + 1] == ')') { if (s1[i] == '[' && s1[i + 1] == ']') y++; else if (s1[i] == '8' && s1[i + 1] == '<') x++; } } if (x == y) printf("TIE\n"); else if (x > y) printf("TEAM 1 WINS\n"); else printf("TEAM 2 WINS\n"); }
7
CPP
#include <bits/stdc++.h> using namespace std; int team1, team2; string t1, t2; vector<int> v, g; int main() { cin >> t1 >> t2; for (int i = 0; i < t1.size(); i++) { if (t1[i] == '8' && t2[i] == '[') { team1++; } else if (t1[i] == '(' && t2[i] == '8') { team1++; } else if (t1[i] == '[' && t2[i] == '(') { team1++; } else if (t2[i] == '8' && t1[i] == '[') { team2++; } else if (t2[i] == '[' && t1[i] == '(') { team2++; } else if (t2[i] == '(' && t1[i] == '8') { team2++; } } if (team1 == team2) { cout << "TIE"; } else if (team1 > team2) { cout << "TEAM 1 WINS"; } else { cout << "TEAM 2 WINS"; } }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { char a[40], b[40]; while (~scanf("%s", a)) { int ans = 0; scanf("%s", b); int a1 = 0, b1 = 0; for (int i = 0; i < strlen(a); i++) { if (a[i] == '8') a1 = 1; if (a[i] == '[' && a[i + 1] == ']') a1 = 3; if (a[i] == '(' && a[i + 1] == ')') a1 = 2; if (b[i] == '8') b1 = 1; if (b[i] == '[' && b[i + 1] == ']') b1 = 3; if (b[i] == '(' && b[i + 1] == ')') b1 = 2; if (b1 - a1 == 1) ans++; if (a1 - b1 == 1) ans--; if (b1 - a1 == 2) ans--; if (a1 - b1 == 2) ans++; } if (ans == 0) printf("TIE\n"); else if (ans > 0) printf("TEAM 2 WINS\n"); else printf("TEAM 1 WINS\n"); } }
7
CPP
a = input() b = input() score = 0 for i in range(0, len(a), 2): first = a[i:i+2] second = b[i:i+2] if first == second: continue elif first == "[]": if second == "8<": score = score - 1 else: score = score + 1 elif first == "()": if second == "[]": score = score - 1 else: score = score + 1 else: if second == "()": score = score - 1 else: score = score + 1 if score == 0: print("TIE") elif score < 0: print("TEAM 2 WINS") else: print("TEAM 1 WINS")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int k = 0; for (int i = 0; i < s.length(); i += 2) { if ((s[i] == '8' && t[i] == '[') || (s[i] == '[' && t[i] == '(') || (s[i] == '(' && t[i] == '8')) k++; else if ((t[i] == '8' && s[i] == '[') || (t[i] == '[' && s[i] == '(') || (t[i] == '(' && s[i] == '8')) k--; } if (k > 0) cout << "TEAM 1 WINS\n"; else if (k < 0) cout << "TEAM 2 WINS\n"; else cout << "TIE\n"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; string x, z; int a, s, i; int main() { cin >> x >> z; for (i = 0; i < x.size(); i += 2) { if (x[i] == '8' && z[i] == '[') a++; if (x[i] == '[' && z[i] == '(') a++; if (x[i] == '(' && z[i] == '8') a++; if (z[i] == '8' && x[i] == '[') s++; if (z[i] == '[' && x[i] == '(') s++; if (z[i] == '(' && x[i] == '8') s++; } if (a > s) cout << "TEAM 1 WINS"; if (a == s) cout << "TIE"; if (a < s) cout << "TEAM 2 WINS"; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int count = 0; for (int i = 0; i < s1.size(); i += 2) { string temp1 = s1.substr(i, 2); string temp2 = s2.substr(i, 2); int n1, n2; if (temp1 == "[]") n1 = 0; if (temp1 == "()") n1 = 1; if (temp1 == "8<") n1 = 2; if (temp2 == "[]") n2 = 0; if (temp2 == "()") n2 = 1; if (temp2 == "8<") n2 = 2; if (n1 == 0 && n2 == 1) ++count; if (n1 == 1 && n2 == 0) --count; if (n2 == 0 && n1 == 2) ++count; if (n2 == 2 && n1 == 0) --count; if (n1 == 1 && n2 == 2) ++count; if (n1 == 2 && n2 == 1) --count; } if (count == 0) printf("TIE"); if (count > 0) printf("TEAM 1 WINS"); if (count < 0) printf("TEAM 2 WINS"); return 0; }
7
CPP
a = input() a_actions = [(a[i:i+2]) for i in range(0, len(a), 2)] b = input() b_actions = [(b[i:i+2]) for i in range(0, len(b), 2)] # print(a_actions, b_actions) rock = "()" paper = "[]" scissors = "8<" a_pts = 0 b_pts = 0 for i in range(len(a)//2): if a_actions[i] == rock: if b_actions[i] == scissors: a_pts += 1 elif b_actions[i] == paper: b_pts += 1 else: a_pts += 1 b_pts += 1 elif a_actions[i] == paper: if b_actions[i] == rock: a_pts += 1 elif b_actions[i] == scissors: b_pts += 1 else: a_pts += 1 b_pts += 1 else: # a_actions[i] == scissors if b_actions[i] == paper: a_pts += 1 elif b_actions[i] == rock: b_pts += 1 else: a_pts += 1 b_pts += 1 if a_pts > b_pts: print("TEAM 1 WINS") elif a_pts < b_pts: print("TEAM 2 WINS") else: print("TIE")
7
PYTHON3
#include <bits/stdc++.h> char a[21], b[21], c, d, i; int main() { scanf("%s%s", a, b); for (i = 0; a[i]; i += 2) { if (a[i] == '8' && b[i] == '[') ++c; if (b[i] == '8' && a[i] == '[') ++d; if (a[i] == '[' && b[i] == '(') ++c; if (b[i] == '[' && a[i] == '(') ++d; if (a[i] == '(' && b[i] == '8') ++c; if (b[i] == '(' && a[i] == '8') ++d; } puts(c == d ? "TIE" : c > d ? "TEAM 1 WINS" : "TEAM 2 WINS"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; const long long N = 1e6 + 5; string s, k; int a; int main() { cin >> s >> k; for (int i = 0; i < s.length(); i++) { if (i % 2 == 1) continue; if (s[i] == '8' && k[i] == '[') a++; if (s[i] == '8' && k[i] == '(') a--; if (s[i] == '(' && k[i] == '[') a--; if (s[i] == '(' && k[i] == '8') a++; if (s[i] == '[' && k[i] == '(') a++; if (s[i] == '[' && k[i] == '8') a--; } if (a == 0) cout << "TIE\n"; if (a > 0) cout << "TEAM 1 WINS\n"; if (a < 0) cout << "TEAM 2 WINS\n"; return 0; }
7
CPP
#include <bits/stdc++.h> int main() { char s1[25], s2[25]; int i, j, a, b; while (gets(s1)) { gets(s2); int n = strlen(s1); a = 0; b = 0; for (i = 0, j = 0; i < n; i += 2, j += 2) { if (s1[i] == s2[j]) continue; else if ((s1[i] == '8' && s2[j] == '[') || (s1[i] == '(' && s2[j] == '8') || (s1[i] == '[' && s2[j] == '(')) a++; else b++; } if (a > b) printf("TEAM 1 WINS\n"); else if (a == b) printf("TIE\n"); else printf("TEAM 2 WINS\n"); } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; void past_code(); int main() { string b = "[]", n = "()", m = "8<"; int c1 = 0, c2 = 0; string t, s; cin >> t >> s; for (int i = 0; i < t.length() - 1; i += 2) { if (s.substr(i, 2) == b && t.substr(i, 2) == n) c2++; else if (s.substr(i, 2) == n && t.substr(i, 2) == m) c2++; else if (s.substr(i, 2) == m && t.substr(i, 2) == b) c2++; else if (t.substr(i, 2) == b && s.substr(i, 2) == n) c1++; else if (t.substr(i, 2) == n && s.substr(i, 2) == m) c1++; else if (t.substr(i, 2) == m && s.substr(i, 2) == b) c1++; } if (c1 > c2) cout << "TEAM 1 WINS\n"; else if (c2 > c1) cout << "TEAM 2 WINS\n"; else cout << "TIE\n"; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; template <typename T> inline T abs(T a) { return a < 0 ? (-a) : a; } template <typename T> inline T sqr(T x) { return x * x; } bool IsWin(char c1, char c2) { return c1 == '(' && c2 == '8' || c1 == '8' && c2 == '[' || c1 == '[' && c2 == '('; } int main() { string s1, s2; cin >> s1 >> s2; int t1 = 0; int t2 = 0; for (int i = 0; i < s1.size(); ++i) { t1 += IsWin(s1[i], s2[i]); t2 += IsWin(s2[i], s1[i]); } if (t1 > t2) { cout << "TEAM 1 WINS" << endl; } else if (t2 > t1) { cout << "TEAM 2 WINS" << endl; } else { cout << "TIE" << endl; } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; void put(int x) { if (x < 0) { putchar('-'); x *= -1; } if (x == 0) { putchar('0'); } int num = 0; char c[15]; while (x) { c[++num] = (x % 10) + 48; x /= 10; } while (num) { putchar(c[num--]); } putchar('\n'); } inline void in(int &x) { char ch = getchar(); int flag = 1; while (!(ch >= '0' && ch <= '9')) { if (ch == '-') flag *= -1; ch = getchar(); } x = ch - '0'; ch = getchar(); while (ch >= '0' && ch <= '9') { x = ((x << 3) + (x << 1)) + ch - '0'; ch = getchar(); } x *= flag; } string s1, s2; int sum1, sum2; int work(char a, char b) { if (a == '8' && b == '<') return 1; if (a == '(' && b == ')') return 2; if (a == '[' && b == ']') return 3; } int main() { cin >> s1 >> s2; for (int i = 0; i < s1.size(); i += 2) { int k1 = work(s1[i], s1[i + 1]), k2 = work(s2[i], s2[i + 1]); if ((k1 == 1 && k2 == 2) || (k1 == 2 && k2 == 3) || (k1 == 3 && k2 == 1)) sum2++; else if (k1 == k2) continue; else sum1++; } if (sum1 > sum2) printf("TEAM 1 WINS\n"); if (sum1 == sum2) printf("TIE\n"); if (sum1 < sum2) printf("TEAM 2 WINS\n"); return 0; }
7
CPP
def a(sMove1, sMove2): if sMove1 == "8<" and sMove2 == "[]" or sMove1 == "[]" and sMove2 == "()" or sMove1 == "()" and sMove2 == "8<": return 1 elif sMove2 == "8<" and sMove1 == "[]" or sMove2 == "[]" and sMove1 == "()" or sMove2 == "()" and sMove1 == "8<": return 2 else: return 0 t1 = input() t2 = input() s = [0, 0, 0] for i in range(0, len(t1), 2): s[a(t1[i] + t1[i + 1], t2[i] + t2[i + 1])] += 1 if s[1] > s[2]: print('TEAM 1 WINS') elif s[1] < s[2]: print("TEAM 2 WINS") else: print('TIE')
7
PYTHON3
a = input() b = input() def get (a, b): if a == '(': return 1 if a == '[': return 2 return 0 i = 0 res = 0 while i < len(a): t1 = get (a[i], a[i + 1]) t2 = get (b[i], b[i + 1]) i += 2 if t1 == t2: continue if (t1 == 0 and t2 == 2) or (t1 == 1 and t2 == 0) or (t1 == 2 and t2 == 1): res += 1 else: res -= 1 if res > 0: print ("TEAM 1 WINS") if res < 0: print ("TEAM 2 WINS") if res == 0: print ("TIE")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int pa = 0, pb = 0; cin >> a >> b; int len = a.length(); for (int i = 0; i < len; i += 2) { if (a[i] == b[i]) continue; if (a[i] == '8' && b[i] == '[') pa++; if (a[i] == '(' && b[i] == '8') pa++; if (a[i] == '[' && b[i] == '(') pa++; if (b[i] == '8' && a[i] == '[') pb++; if (b[i] == '(' && a[i] == '8') pb++; if (b[i] == '[' && a[i] == '(') pb++; } if (pa == pb) printf("TIE\n"); else if (pa > pb) printf("TEAM 1 WINS\n"); else printf("TEAM 2 WINS\n"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int fn(char c) { if (c == '8') return 1; if (c == '[') return 0; if (c == '(') return -1; } char a[10000], b[10000]; int main() { scanf("%s%s", a, b); int len = strlen(a); int ans1 = 0, ans2 = 0; for (int i = 0; i < len; i += 2) { int tmp1, tmp2; tmp1 = fn(a[i]); tmp2 = fn(b[i]); if (tmp1 * tmp2 < 0) { if (tmp1 < 0) ans1++; else if (tmp2 < 0) ans2++; } else if (tmp1 > tmp2) { ans1++; } else if (tmp1 < tmp2) { ans2++; } } if (ans1 > ans2) cout << "TEAM 1 WINS" << endl; else if (ans1 == ans2) cout << "TIE" << endl; else cout << "TEAM 2 WINS" << endl; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { char s[33] = {0}; char s1[33] = {0}; scanf("%s%s", s, s1); int len = strlen(s); int win1 = 0; int win2 = 0; for (int i = 0; i < len; i += 2) { if (s[i] == s1[i]) continue; if (s[i] == '8' && s1[i] == '[' || s[i] == '[' && s1[i] == '(' || s[i] == '(' && s1[i] == '8') win1++; else win2++; } if (win1 == win2) puts("TIE"); else if (win1 > win2) puts("TEAM 1 WINS"); else puts("TEAM 2 WINS"); }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { string a, b; long long team1 = 0, team2 = 0; cin >> a; cin >> b; for (int i = 0; i <= a.size(); i++) { if ((a[i] == '[' && b[i] == '(') || (a[i] == '8' && b[i] == '[') || (a[i] == '(' && b[i] == '8')) { team1++; } else if ((b[i] == '[' && a[i] == '(') || (b[i] == '8' && a[i] == '[') || (b[i] == '(' && a[i] == '8')) { team2++; } } if (team1 > team2) { cout << "TEAM 1 WINS"; } else if (team1 < team2) { cout << "TEAM 2 WINS"; } else { cout << "TIE"; } return 0; }
7
CPP
#include <bits/stdc++.h> #pragma warning(disable : 4996) using namespace std; char a[30], b[30]; int main() { int i, j, k; int cnt = 0, n; scanf("%s%s", a, b); n = strlen(a); for (i = 0; i < n; i += 2) { if (a[i] == b[i]) continue; if (a[i] == '(' && b[i] == '8') cnt++; else if (a[i] == '8' && b[i] == '[') cnt++; else if (a[i] == '[' && b[i] == '(') cnt++; else cnt--; } if (cnt > 0) printf("TEAM 1 WINS"); else if (cnt == 0) printf("TIE"); else printf("TEAM 2 WINS"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; string s1, s2, b1, b2; int a1, a2; bool Team1Wins() { if (b1 == "8<") return (b2 == "[]"); if (b1 == "[]") return (b2 == "()"); return (b2 == "8<"); } int main() { cin >> s1 >> s2; for (int i = 0; i < s1.size(); i += 2) { b1 = s1.substr(i, 2); b2 = s2.substr(i, 2); if (b1 == b2) continue; if (Team1Wins()) ++a1; else ++a2; } if (a1 > a2) cout << "TEAM 1 WINS"; else if (a1 < a2) cout << "TEAM 2 WINS"; else cout << "TIE"; }
7
CPP