malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int nvertices, nedges;   vector<vector<pair<int, int>>> adjList(110);   vector<bool> visited;   void dfs(int u, int c) {     visited[u] = true;     for (auto e : adjList[u]) {       if (!visited[e.first] && (e.second == c)) {         dfs(e.first, c);       }     }   }   int main() {     cin >> nvertices >> nedges;     for (int i = 0; i < nedges; i++) {       int u, v, c;       cin >> u >> v >> c;       adjList[u].push_back({v, c});       adjList[v].push_back({u, c});     }     int m;     cin >> m;     while (m--) {       int u, v;       cin >> u >> v;       set<int> ans;       for (auto e : adjList[u]) {         visited.assign(110, false);         visited[u] = true;         dfs(e.first, e.second);         if (visited[v] == true) ans.insert(e.second);       }       cout << ans.size() << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int readint() {     char c;     while (c = getchar(), (c <  0  || c >  9 ) && c !=  - )       ;     bool flag = (c ==  - );     if (flag) c = getchar();     int x = 0;     while (c >=  0  && c <=  9 ) {       x = x * 10 + c - 48;       c = getchar();     }     return flag ? -x : x;   }   char readchar() {     char c;     while (c = getchar(),            c !=  A  && c !=  C  && c !=  <  && c !=  >  && c !=  ^ )       ;     return c;   }   const int maxn = 100005;   const int maxm = 15;   const int block = 300;   int n, m, q, x, y;   pair<int, int> pos;   char t[maxn][maxm];   pair<int, int> nxt[maxn][maxm], go[maxn][maxm];   inline bool on(pair<int, int> pos) {     return pos.first >= 1 && pos.first <= n && pos.second >= 1 && pos.second <= m;   }   void calc(int x, int y) {     if (!on(make_pair(x, y))) {       nxt[x][y] = make_pair(x, y);       return;     }     if (nxt[x][y].first != -2) return;     if (t[x][y] ==  < ) {       if (t[x][y - 1] ==  > )         nxt[x][y] = make_pair(-1, -1);       else         calc(x, y - 1), nxt[x][y] = nxt[x][y - 1];     } else if (t[x][y] ==  > ) {       if (t[x][y + 1] ==  < )         nxt[x][y] = make_pair(-1, -1);       else         calc(x, y + 1), nxt[x][y] = nxt[x][y + 1];     } else       nxt[x][y] = make_pair(x - 1, y);   }   void jump(int start, int finish) {     for (int i = start; i <= finish && i <= n; i++) {       if (i % block == 1) {         for (int j = 1; j <= m; j++) go[i][j] = nxt[i][j];       } else {         for (int j = 1; j <= m; j++) {           if (!on(nxt[i][j]))             go[i][j] = nxt[i][j];           else             go[i][j] = go[nxt[i][j].first][nxt[i][j].second];         }       }     }   }   int main() {     n = readint();     m = readint();     q = readint();     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         t[i][j] = readchar(), nxt[i][j] = make_pair(-2, -2);     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++) calc(i, j);     jump(1, n);     while (q--) {       char type = readchar();       if (type ==  A ) {         pos.first = readint();         pos.second = readint();         while (on(pos)) {           pos = go[pos.first][pos.second];         }         printf( %d %d n , pos.first, pos.second);       } else {         x = readint();         y = readint();         char op = readchar();         t[x][y] = op;         for (int j = 1; j <= m; j++) nxt[x][j] = make_pair(-2, -2);         for (int j = 1; j <= m; j++) calc(x, j);         jump(x, x);         jump(x + 1, (x / block + (x % block == 0 ? 0 : 1)) * block);       }     }     return 0;   }
#include <bits/stdc++.h>   using std::cerr;   using std::cin;   using std::cout;   using std::deque;   using std::endl;   using std::fixed;   using std::ios_base;   using std::list;   using std::make_pair;   using std::make_tuple;   using std::map;   using std::nth_element;   using std::pair;   using std::queue;   using std::reverse;   using std::set;   using std::sort;   using std::stack;   using std::string;   using std::tuple;   using std::unordered_map;   using std::unordered_set;   using std::vector;   const int MAXN = 100000;   const int INF = 1e9;   const int MOD = 1e9 + 7;   const int64_t L_INF = 4e18;   int n;   vector<int64_t> numbers[64];   list<int64_t> ans;   int get_top(int64_t num) {     for (int i = 62; i >= 0; i--) {       if (num & (1ll << i)) {         return i;       }     }     return -1;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout.precision(10);     cout << fixed;     cin >> n;     for (int i = 0; i < n; i++) {       int64_t b;       cin >> b;       numbers[get_top(b)].push_back(b);     }     for (int i = 62; i >= 0; i--) {       if (numbers[i].empty()) {         continue;       }       if (numbers[i].size() > ans.size() + 1) {         cout <<  No n ;         exit(0);       }       auto iter = ans.begin();       iter = ans.insert(iter, numbers[i][0]);       iter++;       int j = 1;       int64_t sum = numbers[i][0];       while (j < (int)numbers[i].size() && iter != ans.end()) {         sum ^= *iter;         iter++;         if ((sum ^ numbers[i][j]) > sum) {           iter = ans.insert(iter, numbers[i][j]);           sum ^= *iter;           iter++;           j++;         }       }       if (j != (int)numbers[i].size()) {         cout <<  No n ;         exit(0);       }     }     cout <<  Yes n ;     for (int64_t b : ans) {       cout << b <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long a[101][101];   long long b[101];   int main() {     int m, n;     cin >> m >> n;     for (int i = 0; i < m; i++)       for (int j = 0; j < n; j++) cin >> a[i][j];     for (int i = 0; i < m; i++) {       long long minn = 100000000000000;       for (int j = 0; j < n; j++) {         if (a[i][j] < minn) minn = a[i][j];       }       b[i] = minn;     }     long long maxx = 0;     for (int i = 0; i < m; i++) {       if (b[i] > maxx) maxx = b[i];     }     cout << maxx;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     scanf( %d , &(n));     scanf( %d , &(k));     int A[101];     for (int(i) = 0; (i) < (n); (i)++) {       scanf( %d , &(A[i]));     }     int x, y, ans = 0;     for (int(i) = 0; (i) < (k); (i)++) {       x = 0;       y = 0;       for (int(j) = 0; (j) < (n / k); (j)++) {         if (A[j * k + i] == 2)           y++;         else           x++;       }       ans += min(x, y);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   const int MAX_VAL = 1000000;   struct AInt {     int sum;     int minSum;   };   AInt aInt[1 << 21];   void update(int index, int left, int right, int addIndex, int addValue) {     if (left == right) {       aInt[index].sum += addValue;       aInt[index].minSum += addValue;     } else {       int avg = (left + right) / 2;       if (addIndex <= avg) {         update(2 * index + 0, left, avg, addIndex, addValue);       } else {         update(2 * index + 1, avg + 1, right, addIndex, addValue);       }       aInt[index].sum = aInt[2 * index].sum + aInt[2 * index + 1].sum;       aInt[index].minSum =           std::min(aInt[2 * index].minSum + aInt[2 * index + 1].sum,                    aInt[2 * index + 1].minSum);     }   }   int query(int index, int suffSum, int left, int right) {     if (aInt[index].minSum + suffSum >= 0) {       return -1;     } else if (left == right) {       return left;     } else {       int avg = (left + right) / 2;       int q2 = query(2 * index + 1, suffSum, avg + 1, right);       if (q2 == -1) {         int q1 =             query(2 * index + 0, aInt[2 * index + 1].sum + suffSum, left, avg);         return q1;       } else {         return q2;       }     }   }   void update(int value, int sign) { update(1, 1, MAX_VAL, value, sign); }   int query() { return query(1, 0, 1, MAX_VAL); }   int main() {     int n, m;     scanf( %d%d , &n, &m);     int a[n];     int b[m];     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       update(a[i], -1);     }     for (int i = 0; i < m; i++) {       scanf( %d , &b[i]);       update(b[i], +1);     }     int q;     scanf( %d , &q);     for (int z = 0; z < q; z++) {       int t, i, x;       scanf( %d%d%d , &t, &i, &x);       i--;       if (t == 1) {         update(a[i], +1);         a[i] = x;         update(a[i], -1);       } else {         update(b[i], -1);         b[i] = x;         update(b[i], +1);       }       printf( %d n , query());     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long t;     cin >> t;     for (int i = 0; i <= t / (1234567); i++) {       for (int j = 0; j <= t / 123456; j++) {         if (t - (i * 1234567) - (j * 123456) >= 0 &&             ((t - (i * 1234567) - (j * 123456)) % 1234 == 0)) {           cout <<  YES ;           return 0;         }       }     }     cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long findGCD(long long a, long long b) {     return ((b == 0) ? a : findGCD(b, a % b));   }   map<long long, long long> width;   long long wit = 0;   vector<pair<long long, long long> > rect[200005];   int main() {     long long n;     scanf( %lld , &n);     for (long long i = (1); i <= (n); i += (1)) {       long long w, h, f;       scanf( %lld %lld %lld , &h, &w, &f);       if (width.find(w) == width.end()) {         width[w] = ++wit;       }       rect[width[w]].push_back({h, f});     }     sort(rect[1].begin(), rect[1].end());     for (long long i = (2); i <= (wit); i += (1)) {       if (rect[i - 1].size() != rect[i].size()) {         printf( 0 n );         return 0;       }       sort(rect[i].begin(), rect[i].end());       for (long long j = (0); j <= ((long long)rect[i].size() - 1); j += (1)) {         if (rect[i - 1][j].first != rect[i][j].first) {           printf( 0 n );           return 0;         }       }       long long gcd = findGCD(rect[i - 1][0].second, rect[i][0].second);       long long n = rect[i - 1][0].second / gcd, dn = rect[i][0].second / gcd;       for (long long j = (1); j <= ((long long)rect[i].size() - 1); j += (1)) {         gcd = findGCD(rect[i - 1][j].second, rect[i][j].second);         if (rect[i - 1][j].second / gcd != n || rect[i][j].second / dn != gcd) {           printf( 0 n );           return 0;         }       }     }     long long tgcd = -1;     for (long long j = (0); j <= ((long long)rect[1].size() - 1); j += (1)) {       long long gcd = rect[1][j].second;       for (long long i = (2); i <= (wit); i += (1)) {         gcd = findGCD(gcd, rect[i][j].second);       }       if (tgcd == -1)         tgcd = gcd;       else         tgcd = findGCD(tgcd, gcd);     }     long long ans = 0;     for (long long i = (1); i <= (sqrt(tgcd)); i += (1)) {       if (tgcd % i == 0) {         if (tgcd == i * i)           ans++;         else           ans += 2;       }     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 2e5 + 11;   const int MAXN = 5e7 + 1;   const int BITMAX = 18;   const int INF = 2e9 + 88;   const long long LLINF = 1e17 + 3;   const int MOD = 1e9 + 7;   const long double Pi = acos(-1);   int a[MAX];   int main() {     int n, m;     scanf( %d , &n);     scanf( %d , &m);     for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);     if (n == 1) return puts( 0 ), 0;     sort(a + 1, a + n + 1);     long long res = 0;     int mx = 0;     for (int i = 1; i < n; ++i) {       res += a[i] - 1;       if (a[i] > mx) mx++;     }     if (a[n] > mx)       res += mx;     else       res += a[n] - 1;     printf( %lld n , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void init() {     cin.tie(0);     cin.sync_with_stdio(0);   }   int main() {     init();     int n, z;     cin >> n >> z;     for (int i = 0; i < z; i++) {       (n % 10 == 0) ? n /= 10 : n -= 1;     }     cout << n << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1000010;   const int mod = 998244353;   char str[N];   char s[2][N];   int nxt[2][N];   int extend[2][N];   void get_nxt(char *s, int *nxt) {     int n = strlen(s), r = 0, pos = 1;     nxt[0] = n;     while (r + 1 < n && s[r] == s[r + 1]) ++r;     nxt[1] = r;     for (int i = 2; i < n; ++i) {       nxt[i] = max(0, min(nxt[i - pos], r - i + 1));       while (i + nxt[i] < n && s[i + nxt[i]] == s[nxt[i]]) ++nxt[i];       if (i + nxt[i] - 1 > r) {         r = i + nxt[i] - 1;         pos = i;       }     }   }   void get_extend(char *s, char *t, int *nxt, int *extend) {     int n = strlen(s), m = strlen(t), pos = 0, r;     while (s[extend[0]] == t[extend[0]]) ++extend[0];     r = extend[0] - 1;     for (int i = 1; i < n; ++i) {       extend[i] = max(0, min(nxt[i - pos], r - i + 1));       while (i + extend[i] < n && extend[i] < m &&              s[i + extend[i]] == t[extend[i]])         ++extend[i];       if (i + extend[i] - 1 > r) {         r = i + extend[i] - 1;         pos = i;       }     }   }   int a[N << 2];   int tag[N << 2];   void pushdown(int x) {     a[(x << 1)] = (a[(x << 1)] + tag[x]) % mod;     tag[(x << 1)] = (tag[(x << 1)] + tag[x]) % mod;     a[(x << 1 | 1)] = (a[(x << 1 | 1)] + tag[x]) % mod;     tag[(x << 1 | 1)] = (tag[(x << 1 | 1)] + tag[x]) % mod;     tag[x] = 0;   }   void add(int x, int l, int r, int ll, int rr, int p) {     if (ll > rr) return;     if (l >= ll && r <= rr) {       a[x] = (a[x] + p) % mod;       tag[x] = (tag[x] + p) % mod;     } else {       if (tag[x]) pushdown(x);       if (((l + r) >> 1) >= ll) add((x << 1), l, ((l + r) >> 1), ll, rr, p);       if (((l + r) >> 1) < rr)         add((x << 1 | 1), ((l + r) >> 1) + 1, r, ll, rr, p);     }   }   int query(int x, int l, int r, int pos) {     if (pos == -1) return 1;     if (l == r)       return a[x];     else {       if (tag[x]) pushdown(x);       if (pos <= ((l + r) >> 1))         return query((x << 1), l, ((l + r) >> 1), pos);       else         return query((x << 1 | 1), ((l + r) >> 1) + 1, r, pos);     }   }   int sum[N];   int now;   int main() {     scanf( %s %s %s , str, s[0], s[1]);     int len = strlen(str);     int lenl = strlen(s[0]);     int lenr = strlen(s[1]);     int f = (lenl == 1 && s[0][0] ==  0 );     get_nxt(s[0], nxt[0]);     get_nxt(s[1], nxt[1]);     get_extend(str, s[0], nxt[0], extend[0]);     get_extend(str, s[1], nxt[1], extend[1]);     int now = 1;     sum[0] = mod - 1;     for (int i = 0; i < len; ++i) {       int l, r;       if (str[i] ==  0 ) {         if (f)           l = r = i;         else {           now = (now + sum[i]) % mod;           continue;         }       } else {         l = i + lenl - 1;         if (extend[0][i] != lenl && s[0][extend[0][i]] > str[i + extend[0][i]])           ++l;         r = i + lenr - 1;         if (extend[1][i] != lenr && (s[1][extend[1][i]] < str[i + extend[1][i]]))           --r;       }       sum[l] = (sum[l] + now) % mod;       sum[r + 1] = (sum[r + 1] - now + mod) % mod;       now = (now + sum[i]) % mod;     }     printf( %d n , now);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, t;   std::vector<pair<long long, long long> > v;   long long dp[(1 << 15) + 5][226][4];   long long solve(long long x, long long y, long long z) {     if (x == 0) return 1;     if (x < 0) return 0;     if (dp[y][x][z] != -1) return dp[y][x][z];     long long ans = 0;     for (long long i = 0; i < n; i++) {       if (v[i].second != z and (y & (1 << i))) {         ans = (ans +                (solve(x - v[i].first, y - (1 << i), v[i].second)) % 1000000007) %               1000000007;       }     }     dp[y][x][z] = ans;     return dp[y][x][z] % 1000000007;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> t;     long long t1, t2;     for (long long i = 0; i < (1 << 15) + 5; i++)       for (long long j = 0; j < 226; j++)         for (long long k = 0; k < 4; k++) dp[i][j][k] = -1;     for (long long i = 0; i < n; i++) {       cin >> t1 >> t2;       v.push_back(make_pair(t1, t2));     }     cout << solve(t, (1 << n) - 1, 0);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   map<pair<int, int>, pair<int, int> > p;   int res[100 + 10][100 + 10];   int main() {     int n, m, q, k, d, t, tem1, tem2, tem3, tem4, y = 1, sum = 0, ans = 0;     string s, c;     scanf( %d%d%d , &n, &m, &q);     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         p[{i, j}] = {i, j};       }     }     for (int i = 0; i < q; i++) {       scanf( %d%d , &tem1, &tem2);       tem2--;       if (tem1 != 3) {         if (tem1 == 1) {           pair<int, int> here = p[{tem2, 0}];           for (int j = 0; j < m - 1; j++) {             p[{tem2, j}] = p[{tem2, j + 1}];           }           p[{tem2, m - 1}] = here;         } else {           pair<int, int> here = p[{0, tem2}];           for (int j = 0; j < n - 1; j++) {             p[{j, tem2}] = p[{j + 1, tem2}];           }           p[{n - 1, tem2}] = here;         }       } else {         scanf( %d%d , &tem3, &tem4);         tem3--;         pair<int, int> here = p[{tem2, tem3}];         res[here.first][here.second] = tem4;       }     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         printf( %d  , res[i][j]);       }       printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int d[1000], q[1000], l[1000], r[1000], p[1000];   vector<int> dd[1000];   int main() {     int n;     cin >> n;     int i, j;     fill(d, d + n, -1);     d[0] = 0, dd[0].push_back(0);     int x = 0, z;     while ((1 << x) < n) x++;     for (i = 1; i < n; i++) l[i] = 1, r[i] = (1 << x) - 1;     for (; x >= 1; x--) {       for (z = 0; z < 2; z++) {         for (i = 0; i < n; i++) q[i] = 0;         for (i = (z << x); i < n; i += (1 << (x + 1))) {           for (j = 0; j < dd[i].size(); j++) q[dd[i][j]] = (1 << (x - 1));         }         string s, s2;         cout <<  ? ;         for (i = 0; i < n; i++) cout <<     << q[i];         cout << endl;         cin >> s;         cout <<  ? ;         for (i = 0; i < n; i++) {           if (q[i] > 0) q[i]--;           cout <<     << q[i];         }         cout << endl;         cin >> s2;         for (i = 0; i < n; i++) {           if ((d[i] != -1) || (((l[i] >> x) & 1) != z)) continue;           if (s[i] != s2[i])             d[i] = (l[i] + r[i]) / 2, dd[d[i]].push_back(i);           else if (s[i] ==  1 )             r[i] = (l[i] + r[i]) / 2 - 1;           else             l[i] = (l[i] + r[i]) / 2 + 1;         }       }     }     for (z = 0; z < 3; z++) {       vector<int> v;       for (i = 0; i < n; i++) {         if ((d[i] % 3) == z) v.push_back(i);       }       for (i = 0; (1 << i) < v.size(); i++) {         for (j = 0; j < n; j++) q[j] = 0;         for (j = 0; j < v.size(); j++) {           if (j & (1 << i)) q[v[j]] = 1;         }         string s;         cout <<  ? ;         for (j = 0; j < n; j++) cout <<     << q[j];         cout << endl;         cin >> s;         for (j = 0; j < n; j++) {           if (((d[j] % 3) == ((z + 1) % 3)) && (s[j] ==  1 )) p[j] |= (1 << i);         }       }       for (i = 0; i < n; i++) {         if ((i > 0) && ((d[i] % 3) == ((z + 1) % 3))) p[i] = v[p[i]];       }     }     cout <<  !  << endl;     for (i = 1; i < n; i++) cout << p[i] + 1 <<     << i + 1 << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct square {     int r1, c1, r2, c2;     square(int R1, int C1, int R2, int C2) {       r1 = R1;       c1 = C1;       r2 = R2;       c2 = C2;     }     bool same(int R1, int C1, int R2, int C2) {       if (R1 != r1) return false;       if (C1 != c1) return false;       if (R2 != r2) return false;       if (C2 != c2) return false;       return true;     }     bool in(int x, int y) {       if (r1 <= x && x <= r2 && c1 <= y && y <= c2) return true;       return false;     }   };   vector<square *> S;   int main(void) {     int n, m, q;     scanf( %d %d %d , &n, &m, &q);     while (q--) {       int op;       scanf( %d , &op);       int r1, c1, r2, c2;       scanf( %d %d %d %d , &r1, &c1, &r2, &c2);       if (op == 1) {         square *s = new square(r1, c1, r2, c2);         S.push_back(s);       } else if (op == 2) {         int size = S.size();         for (int i = 0; i < size; i++) {           square *s = S[i];           if (s->same(r1, c1, r2, c2)) {             S.erase(S.begin() + i);             break;           }         }       } else if (op == 3) {         bool find = false;         for (square *s : S)           if (s->in(r1, c1) != s->in(r2, c2)) {             printf( No n );             find = true;             break;           }         if (!find) printf( Yes n );       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 333333;   int ans[maxn];   int fa[maxn];   int nx[maxn];   int visit[maxn];   int n, m;   inline int query(int a) { return a == fa[a] ? a : fa[a] = query(fa[a]); }   inline void conbine(int a, int b) {     a = query(a), b = query(b);     if (a != b) fa[a] = b;   }   inline void paint(int l, int r, int x) {     int i = l;     while (i <= r) {       int a = query(i);       int j = nx[a];       if (j > r) return;       if (ans[j] == 0) ans[j] = x;       int b = query(j + 1);       int _nx = nx[b];       conbine(a, b);       nx[query(a)] = _nx;       i = _nx;     }   }   int main() {     int n, m;     while (scanf( %d%d , &n, &m) != EOF) {       for (int i = 0; i <= n + 1; ++i) fa[i] = nx[i] = i, ans[i] = 0;       for (int i = 0; i < m; ++i) {         int l, r, x;         scanf( %d%d%d , &l, &r, &x);         paint(l, x - 1, x);         paint(x + 1, r, x);       }       for (int i = 1; i <= n; ++i) {         int tmp = ans[i];         printf( %d , tmp);         if (i == n)           printf(  n );         else           printf(   );       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int M = 1000000007;   const int MM = 998244353;   const long double PI = acos(-1);   const long long INF = 2e18;   template <typename T, typename T1>   void amax(T &a, T1 b) {     if (b > a) a = b;   }   template <typename T, typename T1>   void amin(T &a, T1 b) {     if (b < a) a = b;   }   long long power(long long b, long long e) {     if (e == 0) return 1;     if (e & 1) return b * power(b * b, e / 2);     return power(b * b, e / 2);   }   long long power(long long b, long long e, long long m) {     if (e == 0) return 1;     if (e & 1) return b * power(b * b % m, e / 2, m) % m;     return power(b * b % m, e / 2, m);   }   long long modinv(long long a, long long m) { return power(a, m - 2, m); }   int TLE_TERROR() {     long long n, ans = 0;     cin >> n;     long long a[n], c[n + 1];     memset(c, 0, sizeof(c));     for (long long i = 0; i < n; i++) {       cin >> a[i];       ans ^= a[i];     }     for (long long i = 2; i <= n; i++) {       long long z = n / i;       c[i - 1] += z;       z *= i;       long long zz = n - z;       c[zz]++;     }     for (long long i = n - 1; i >= 0; i--) c[i] += c[i + 1];     for (long long i = 1; i <= n; i++) {       if (c[i] % 2 != 0) ans ^= i;     }     cout << ans;     return 0;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);     long long int TESTS = 1;     while (TESTS--) TLE_TERROR();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, m;   int s, p, i, j, k, z;   string s1, s2;   int const md = 1000000;   stack<char> st;   int a[5];   int main() {     int k1 = 0, k2 = 0, k3 = 0;     cin >> k1 >> k2;     for (i = 1; i <= k1; i++) {       cin >> k3;       n = n * k2 + k3;     }     cin >> k1 >> k2;     for (i = 1; i <= k1; i++) {       cin >> k3;       m = m * k2 + k3;     }     if (n > m)       cout <<  > ;     else if (n < m)       cout <<  < ;     else       cout <<  = ;   }