malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int b[2] = {1, -1};   int n, m, f[105][55][205][2], ans;   char a[200];   int main() {     scanf( %s , a);     scanf( %d , &n);     f[0][0][0][0] = 1;     m = strlen(a);     for (int i = (0); i <= (m - 1); i++)       for (int j = (0); j <= (n); j++)         for (int k = (0); k <= (2 * i); k++)           for (int c = (0); c <= (1); c++)             if (f[i][j][k][c]) {               f[i + 1][j + (a[i] !=  T )][k + 1][c ^ 1] = 1;               f[i + 1][j + (a[i] !=  F )][k + 1 + b[c]][c] = 1;             }     for (int j = (0); j <= (n); j++)       if (((n - j) & 1) == 0)         for (int c = (0); c <= (1); c++)           for (int k = (0); k <= (2 * m); k++)             if (f[m][j][k][c]) ans = max(ans, abs(k - m));     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   int main() {     char s[100];     scanf( %s , s);     int ans = 0;     for (int i = 0; s[i]; ++i) {       if (isalpha(s[i])) {         if (s[i] <=  Z )           ans += s[i] -  A  + 1;         else           ans -= s[i] -  a  + 1;       }     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<int> _edge;   set<int> se, to_del;   int main() {     ios_base::sync_with_stdio(false);     cout.tie(0);     cin.tie(0);     int t, n, m, i, j, k, x, y, z, a, b, c;     cin >> t;     while (t--) {       cin >> n >> m;       n *= 3;       se.clear();       _edge.clear();       for (i = 1; i <= n; ++i) se.insert(i);       for (i = 1; i <= m; ++i) {         cin >> x >> y;         if (se.find(x) != se.end() && se.find(y) != se.end()) {           se.erase(x);           se.erase(y);           _edge.push_back(i);         }       }       n = n / 3;       if (_edge.size() >= n) {         cout <<  Matching  << endl;         for (i = 0; i < _edge.size() && i < n; ++i) cout << _edge[i] <<    ;         cout << endl;       } else if (se.size() >= n) {         cout <<  IndSet  << endl;         i = 0;         for (auto it : se) {           cout << it <<    ;           i += 1;           if (i == n) break;         }         cout << endl;       } else         cout <<  Impossible  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool compare(const int &a, const int &b) { return a < b; }   int main() {     int n;     cin >> n;     int i = 0;     double aux = 0;     while (n >= aux) {       aux = (1.0 / 6.0) * (i) * (i + 1) * (i + 2);       i++;     }     cout << i - 2 << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<int> a(n);     multiset<int> b;     int c[n];     for (int i = 0; i < n; i++) {       cin >> a[i];     }     for (int i = 0; i < n; i++) {       int z;       cin >> z;       b.insert(z);     }     for (int i = 0; i < n; i++) {       auto z = b.lower_bound(n - a[i]);       if (z == b.end()) z = b.lower_bound(0);       cout << (a[i] + *z) % n <<    ;       b.erase(z);     }   }
#include <bits/stdc++.h>      using namespace std;   bool func(pair<long long,long long> &fi,pair<long long,long long>&se){       return fi.first<se.first;   }   int main()   {      int t=1;      cin>>t;      while(t--){          long long a,b,n;          cin>>a>>b>>n;          pair<long long,long long>arr[n];                    for(int i=0;i<n;i++){              cin>>arr[i].first;          }          for(int i=0;i<n;i++){              cin>>arr[i].second;          }          sort(arr,arr+n,func);                   bool gamovida=true;          for(int i=0;i<n;i++){              int num=arr[i].second/a;              if(num*a<arr[i].second)num++;              b-=arr[i].first*num;              if(b<=0&&i!=n-1){                  gamovida=false;              }              if(b<=0&&i==n-1){                  if(b+arr[i].first<=0){                      gamovida=false;                  }              }          }          if(gamovida==false){              cout<< NO <<endl;              continue;          }               if(gamovida==false){              cout<< NO <<endl;          }else{              cout<< YES <<endl;          }                }            return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     stack<char> Stack;     string s;     cin >> s;     for (int i = 0; i < s.size(); i++) {       char ch = s[i];       if (!Stack.empty() && ch == Stack.top())         Stack.pop();       else         Stack.push(ch);     }     if (Stack.empty())       printf( Yes n );     else       printf( No n );   }
#include <bits/stdc++.h>   using namespace std;   int number[1003][1003][2];   int n, m, sum;   int part = -1;   int parts[1000003];   int dx[] = {0, 0, 1, -1};   int dy[] = {1, -1, 0, 0};   string s[1003];   bool isvalid(int x, int y) {     if (x >= 0 && x < n && y >= 0 && y < m) return 1;     return 0;   }   int findsum(int x, int y) {     int ans = 0;     int anses[4];     int point = 0;     for (int i = 0; i < 4; i++) {       if (isvalid(x + dx[i], y + dy[i]) && s[x + dx[i]][y + dy[i]] ==  . ) {         bool flag = 0;         int p = number[x + dx[i]][y + dy[i]][1];         for (int j = 0; j < point; j++) {           if (p == anses[j]) {             flag = 1;           }         }         if (flag == 0) {           ans += parts[p];         }         anses[point] = p;         point++;       }     }     return ans + 1;   }   void dfs(int x, int y) {     if (number[x][y][0] == 0) {       sum++;       number[x][y][0] = 1;       number[x][y][1] = part;       for (int i = 0; i < 4; i++) {         if (isvalid(x + dx[i], y + dy[i])) {           if (s[x + dx[i]][y + dy[i]] ==  . ) {             dfs(x + dx[i], y + dy[i]);           }         }       }     }   }   int main() {     cin >> n >> m;     for (int i = 0; i < n; i++) {       cin >> s[i];     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (s[i][j] ==  . ) {           if (number[i][j][0] == 0) {             part++;             dfs(i, j);             parts[part] = sum;             sum = 0;           }         }       }     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (s[i][j] ==  * ) {           s[i][j] =  0  + findsum(i, j) % 10;         }       }     }     for (int i = 0; i < n; i++) {       cout << s[i] << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > score;   map<pair<int, int>, int> freq;   bool compare(const pair<int, int> a, const pair<int, int> b) {     if (a.first == b.first) return a.second < b.second;     return a.first > b.first;   }   void solve() {     int n, k;     cin >> n >> k;     for (int(i) = (0); (i) < (n); ++(i)) {       int x, y;       cin >> x >> y;       pair<int, int> curr = make_pair(x, y);       score.push_back(curr);       ++freq[curr];     }     sort((score).begin(), (score).end(), compare);     cout << freq[score[k - 1]];   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     int t = 1;     while (t--) {       solve();       cout <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int t[200005];   int main() {     ios_base::sync_with_stdio(0), cin.tie(0);     string s, ans;     int test, n;     cin >> test;     while (test--) {       cin >> s;       n = s.length();       for (int i = 1; i <= n; ++i) t[i] = t[i - 1] + s[i - 1] -  0 ;       ans =   ;       bool can = true, less = false;       int m = 0;       for (int i = 0; i < n; ++i) {         int l = ans.length();         string f =   ;         for (int j = 9; j >= 0; --j)           if (m & 1 << j) f += j +  0 ;         if (less) {           l = n - i - f.length();           while (l--) ans +=  9 ;           for (auto j : f) ans += j;           break;         } else {           for (char j = s[i]; j >=  0  + (i == 0); --j) {             auto cp = f;             if (m & 1 << (j -  0 ))               f.erase(f.find(j), 1);             else               f += j;             sort(f.begin(), f.end());             int fl = f.length();             if (i + fl <= n) {               if (n - i - 1 > fl && t[n - fl] - t[i + 1] > 0) {                 if (j < s[i]) less = true;                 ans += j;                 m ^= 1 << (j -  0 );                 break;               } else if (j < s[i] || f < s.substr(n - fl, fl)) {                 if (j < s[i]) less = true;                 ans += j;                 m ^= 1 << (j -  0 );                 break;               } else if (f == s.substr(n - fl, fl) && j < s[i]) {                 less = true;                 ans += j;                 m ^= 1 << (j -  0 );                 break;               }             }             f = cp;           }         }         if (ans.length() == l) {           can = false;           break;         }       }       if (!can) {         ans =   ;         for (int i = 2; i < n; ++i) ans +=  9 ;       }       cout << ans <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct info {     int red, yel, chk;   } v[1000];   struct info1 {     int red, yel, chk;   } v1[1000];   int main() {     string home, away;     cin >> home >> away;     int in, n, i, j, time, number;     char formation, card;     cin >> n;     while (n--) {       cin >> time >> formation >> number >> card;       if (formation ==  h ) {         if (card ==  y ) {           v[number].yel++;         } else {           v[number].red++;         }         if ((v[number].yel == 2 || v[number].red == 1) && v[number].chk == 0) {           cout << home <<     << number <<     << time << endl;           v[number].chk = 1;         }       } else {         if (card ==  y ) {           v1[number].yel++;         } else {           v1[number].red++;         }         if ((v1[number].yel == 2 || v1[number].red == 1) && v1[number].chk == 0) {           cout << away <<     << number <<     << time << endl;           v1[number].chk = 1;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int MOD = 1e9 + 7;   int a[101010];   int dp[1010101];   int main() {     int n;     while (~scanf( %d , &n)) {       for (int i = 0; i < n; i++) scanf( %d , &a[i]);       sort(a, a + n);       n = unique(a, a + n) - a;       int b, c;       scanf( %d%d , &b, &c);       int sum = 0;       while (b > c) {         int next = b - 1;         for (int i = 0; i < n; i++) {           int to = b - b % a[i];           if (to < c)             a[i--] = a[--n];           else if (to < next)             next = to;         }         b = next;         sum++;       }       printf( %d n , sum);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct node {     int l, m, r;   };   node t[3000005];   int arr[300005], n, m;   long long a[300005];   int sign(long long x) {     if (x > 0) return 1;     if (x < 0) return -1;     return 0;   }   void cal(int x, int l, int r) {     int m = (l + r) / 2;     t[x].m = max(t[x * 2].m, t[x * 2 + 1].m);     t[x].l = t[x * 2].l;     t[x].r = t[x * 2 + 1].r;     if (!!a[m] && !!a[m + 1] && sign(a[m]) >= sign(a[m + 1])) {       t[x].m = max(t[x].m, t[x * 2].r + t[x * 2 + 1].l);       if (t[2 * x].m == m - l + 1) t[x].l = t[2 * x].l + t[2 * x + 1].l;       if (t[2 * x + 1].m == r - m) t[x].r = t[2 * x].r + t[2 * x + 1].r;     }   }   void build(int x, int l, int r) {     if (l == r) {       int tmp = !!a[l];       t[x].l = t[x].m = t[x].r = tmp;       return;     }     int m = (l + r) / 2;     build(x * 2, l, m);     build(x * 2 + 1, m + 1, r);     cal(x, l, r);   }   void update(int x, int l, int r, int pos, int d) {     if (l == r) {       a[pos] += d;       int tmp = !!a[pos];       t[x].l = t[x].m = t[x].r = tmp;       return;     }     int m = (l + r) / 2;     if (pos <= m)       update(x * 2, l, m, pos, d);     else       update(x * 2 + 1, m + 1, r, pos, d);     cal(x, l, r);   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) scanf( %d , &arr[i]);     for (int i = 0; i + 1 < n; i++) a[i] = arr[i + 1] - arr[i];     if (n > 1) build(1, 0, n - 2);     cin >> m;     while (m--) {       int l, r, d;       scanf( %d%d%d , &l, &r, &d);       if (n == 1) {         printf( %d n , 1);         continue;       }       if (l > 1) update(1, 0, n - 2, l - 2, d);       if (r < n) update(1, 0, n - 2, r - 1, -d);       printf( %d n , t[1].m + 1);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int N, cnt[100010], beg_cnt[100010];   double ans = 0, dp[100010][110], buf[110];   int main() {     scanf( %d , &N);     for (int i = 0; i < N; ++i) {       scanf( %d , &cnt[i]), dp[i][cnt[i]] = 1;       beg_cnt[i] = cnt[i];       if (cnt[i] == 0) ++ans;     }     int M;     scanf( %d , &M);     for (int i = 0; i < M; ++i) {       int f, t, how;       scanf( %d%d%d , &f, &t, &how);       --f;       --t;       ans -= dp[f][0];       for (int S = 0; S < how; ++S) {         memset(buf, 0, (beg_cnt[f] + 1) * sizeof(double));         for (int i = 0; i <= beg_cnt[f]; ++i) {           buf[i] += dp[f][i] * ((cnt[f] - i + 0.0) / cnt[f]);           if (i) buf[i - 1] += dp[f][i] * ((i + 0.0) / cnt[f]);         }         memcpy(dp[f], buf, (beg_cnt[f] + 1) * sizeof(double));         --cnt[f];       }       cnt[t] += how;       ans += dp[f][0];       printf( %.18lf n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxx = 2e5 + 10;   long long arr[maxx + 5];   int main() {     long long n, k;     cin >> n >> k;     for (int i = 1; i <= n; i++) {       long long x;       cin >> x;       arr[i] = x + arr[i - 1];     }     long long lag = 0, best = 0, x, y, ans;     for (int i = n - (2 * k) + 1; i > 0; i--) {       long long j = i + k;       if (arr[j + k - 1] - arr[j - 1] >= lag) {         lag = arr[j + k - 1] - arr[j - 1];         ans = j;       }       if (arr[j - 1] - arr[i - 1] + lag >= best) {         best = arr[j - 1] - arr[i - 1] + lag;         y = ans;         x = i;       }     }     cout << x <<     << y << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 400010;   char ss[N], s[N];   int fail[N], trie[N][30];   struct node {     int v, next;   } e[N];   int n, opt, m, dfsclock, id, siz[N], tree[N], fa[N], dfsxu[N], ans[N], head[N],       cnt, tot;   void add(int u, int v) {     e[++cnt].v = v;     e[cnt].next = head[u];     head[u] = cnt;   }   vector<pair<int, int> > que[N];   struct BinaryIndexTree {     int tree[800001];     void clear() { memset(tree, 0, sizeof(tree)); }     inline int lowbit(int x) { return x & (-x); }     inline void updata(int x, int cost) {       for (int i = x; i <= tot + 1; i += lowbit(i)) tree[i] += cost;     }     inline int sum(int x) {       int sum1 = 0;       for (int i = x; i > 0; i -= lowbit(i)) sum1 += tree[i];       return sum1;     }   } tt;   int add(char *t) {     int n = strlen(t + 1), p = 0;     for (int i = 1; i <= n; ++i) {       if (!trie[p][t[i] -  a ]) trie[p][t[i] -  a ] = ++tot;       p = trie[p][t[i] -  a ];     }     return p;   }   queue<int> q;   vector<int> E[N];   void build() {     for (int i = 0; i < 26; ++i)       if (trie[0][i]) q.push(trie[0][i]);     while (!q.empty()) {       int u = q.front();       q.pop();       E[fail[u]].push_back(u);       for (int i = 0; i < 26; ++i) {         if (!trie[u][i])           trie[u][i] = trie[fail[u]][i];         else           fail[trie[u][i]] = trie[fail[u]][i], q.push(trie[u][i]);       }     }   }   void dfs1(int u) {     dfsxu[u] = ++dfsclock;     siz[u] = 1;     for (int i = 0; i < E[u].size(); ++i) {       int v = E[u][i];       dfs1(v);       siz[u] += siz[v];     }   }   int getans(int p) {     return tt.sum(dfsxu[p] + siz[p] - 1) - tt.sum(dfsxu[p] - 1);   }   void dfs(int u, int p) {     p = trie[p][s[u] -  a ];     tt.updata(dfsxu[p], 1);     for (int i = head[u]; i != 0; i = e[i].next) dfs(e[i].v, p);     for (int i = 0; i < que[u].size(); ++i)       ans[que[u][i].second] = getans(que[u][i].first);     tt.updata(dfsxu[p], -1);   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf( %d , &opt);       if (opt == 2) scanf( %d , &fa[i]);       add(fa[i], i);       scanf( %s , &s[i]);     }     scanf( %d , &m);     for (int i = 1; i <= m; ++i) {       scanf( %d %s , &id, ss + 1);       que[id].push_back(make_pair(add(ss), i));     }     build();     dfs1(0);     for (int i = 1; i <= n; ++i)       if (!fa[i]) dfs(i, 0);     for (int i = 1; i <= m; ++i) printf( %d n , ans[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod1 = 1000000007;   const long long mod2 = 998244353;   mt19937 rng(       (unsigned int)chrono::steady_clock::now().time_since_epoch().count());   long long power(long long a, long long b) {     long long result = 1;     while (b > 0) {       if (b % 2 == 1) {         result *= a;       }       a *= a;       b /= 2;     }     return result;   }   long long gcd(long long x, long long y) {     long long r;     while (y != 0 && (r = x % y) != 0) {       x = y;       y = r;     }     return y == 0 ? x : y;   }   long long countSetBits(long long x) {     long long Count = 0;     while (x > 0) {       if (x & 1) Count++;       x = x >> 1;     }     return Count;   }   long long mod(long long x, long long M) { return ((x % M + M) % M); }   long long add(long long a, long long b, long long M) {     return mod(mod(a, M) + mod(b, M), M);   }   long long mul(long long a, long long b, long long M) {     return mod(mod(a, M) * mod(b, M), M);   }   long long powerM(long long a, long long b, long long M) {     long long res = 1ll;     while (b) {       if (b % 2ll == 1ll) {         res = mul(a, res, M);       }       a = mul(a, a, M);       b /= 2ll;     }     return res;   }   void solve() {     long long h, w;     cin >> w >> h;     long long x;     cin >> x;     vector<long long> v(x);     for (long long i = 0; i < x; i++) {       cin >> v[i];     }     long long y;     cin >> y;     vector<long long> v1(y);     for (long long i = 0; i < y; i++) {       cin >> v1[i];     }     long long z;     cin >> z;     vector<long long> v2(z);     for (long long i = 0; i < z; i++) {       cin >> v2[i];     }     long long a;     cin >> a;     vector<long long> v3(a);     for (long long i = 0; i < a; i++) {       cin >> v3[i];     }     sort(v.begin(), v.end());     sort(v1.begin(), v1.end());     sort(v2.begin(), v2.end());     sort(v3.begin(), v3.end());     long long t = max(v[x - 1] - v[0], v1[y - 1] - v1[0]);     long long ans1 = t * h;     long long t1 = max(v2[z - 1] - v2[0], v3[a - 1] - v3[0]);     long long ans2 = t1 * w;     cout << max(ans2, ans1) <<   n ;   }   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     cout << fixed << setprecision(20);     long long t = 1;     cin >> t;     for (long long i = 1; i <= t; i++) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int T, sum = 0;   string a, b;   int main() {     cin >> T;     while (T--) {       int temp = 0, flag = 0;       cin >> a;       cin >> b;       int k = 0;       int LA = a.size();       int LB = b.size();       for (int i = 0; i <= LA; i++) {         if (flag == 0 && a[i] != b[k]) {           while (b[k] == b[k - 1]) {             k++;           }           flag = 1;         }         if (a[i] == b[k]) {           k++;           flag = 0;           continue;         }         if (flag == 1) {           cout <<  NO  << endl;           temp = 1;           break;         }       }       if (temp == 0) {         cout <<  YES  << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 200005;   template <typename T>   inline void read(T &AKNOI) {     T x = 0, flag = 1;     char ch = getchar();     while (!isdigit(ch)) {       if (ch ==  - ) flag = -1;       ch = getchar();     }     while (isdigit(ch)) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     AKNOI = flag * x;   }   template <typename T>   inline void cmin(T &x, T y) {     if (x > y) x = y;   }   template <typename T>   inline void cmax(T &x, T y) {     if (x < y) x = y;   }   int n, cnt[MAXN], pos;   int vis[MAXN], siz[MAXN], son[MAXN], tsiz, root;   long long dis[MAXN];   double sum[MAXN], sq, cur, ans;   struct Edge {     int v, w, nxt;   } e[MAXN << 1];   int first[MAXN], eCnt;   inline void AddEdge(int u, int v, int w) {     e[++eCnt].v = v;     e[eCnt].w = w;     e[eCnt].nxt = first[u];     first[u] = eCnt;   }   void GetRoot(int u, int fa) {     siz[u] = 1;     son[u] = 0;     for (int i = first[u]; i; i = e[i].nxt) {       int v = e[i].v;       if (v == fa || vis[v]) continue;       GetRoot(v, u);       cmax(son[u], siz[v]);       siz[u] += siz[v];     }     cmax(son[u], tsiz - siz[u]);     if (son[u] < son[root]) root = u;   }   void GetCost(int u, int fa) {     sq = sqrt(dis[u]) * cnt[u];     sum[u] = sq;     cur += sq * dis[u];     for (int i = first[u]; i; i = e[i].nxt) {       int v = e[i].v;       if (v == fa) continue;       dis[v] = dis[u] + e[i].w;       GetCost(v, u);       sum[u] += sum[v];     }   }   void PointDC(int u) {     vis[u] = 1;     cur = dis[u] = 0;     GetCost(u, 0);     if (cur < ans) {       ans = cur;       pos = u;     }     for (int i = first[u]; i; i = e[i].nxt) {       int v = e[i].v;       if (vis[v]) continue;       if (sum[u] < sum[v] * 2) {         tsiz = siz[v];         root = 0;         GetRoot(v, 0);         PointDC(root);         break;       }     }   }   void init() {     read(n);     for (int i = 1; i <= n; ++i) {       read(cnt[i]);     }     for (int i = 1, u, v, w; i < n; ++i) {       read(u);       read(v);       read(w);       AddEdge(u, v, w);       AddEdge(v, u, w);     }   }   void solve() {     ans = 1e30;     son[0] = tsiz = n;     GetRoot(1, 0);     PointDC(root);     printf( %d %.8lf n , pos, ans);   }   int main() {     init();     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k, i, u, v, w = 0, l = 0;     scanf( %d%d , &n, &k);     for (i = 1; i <= k; ++i)       scanf( %d%d , &u, &v), w = (w + u * 1ll * v) % n, l += v;     if (l < n)       puts( 1 );     else if (l > n)       puts( -1 );     else if ((1ll + n) * n / 2 % n == w)       puts( 1 );     else       puts( -1 );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e2 + 10;   char a[maxn], b[maxn], t[maxn];   int main() {     int n;     char c[1];     scanf( %d , &n);     gets(c);     scanf( %s , a + 1);     int d = 0;     while (d <= n) {       d++;       if (n % d == 0) {         for (int i = 1; i <= d; i++) {           b[i] = a[d - i + 1];         }         for (int j = d + 1; j <= n; j++) {           b[j] = a[j];         }         for (int i = 1; i <= n; i++) a[i] = b[i];       }     }     for (int i = 1; i <= n; i++) printf( %c , b[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = (long long)(5e5) + 322;   const long long INF = (long long)(1e9);   const long long mod = (long long)(1e9) + 7;   const double eps = 1e-9;   int xp, yp, xv, yv, distp, distv;   int main() {     ios_base ::sync_with_stdio(false);     cin.tie(0);     cin >> xp >> yp >> xv >> yv;     distp = xp + yp;     distv = max(xv, yv);     if (distp <= distv) {       cout <<  Polycarp ;       return 0;     }     if (xp <= xv && yp <= yv) {       cout <<  Polycarp ;       return 0;     }     cout <<  Vasiliy ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a;     cin >> a;     long long arr[36] = {         1,          2,          4,          8,          16,          32,         64,         128,        256,        512,        1024,        2048,         4096,       8092,       16184,      32368,      64736,       129472,         258944,     517888,     1035776,    2071552,    4143104,     8286208,         16572416,   33144832,   66289664,   132579328,  265158656,   530317312,         1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968};     cout << arr[a];     return 0;   }