malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n;     cin >> n;     long long int ar[100000], br[10000];     memset(br, 0, sizeof(br));     for (long long int i = 1; i <= n; i++) {       cin >> ar[i];       br[ar[i]]++;     }     sort(ar + 1, ar + n + 1);     if (n == 1) {       cout <<  YES  << endl;     } else if (ar[1] == ar[n]) {       cout <<  NO  << endl;     } else {       int f = 0;       sort(br + 1, br + 10000, greater<long long int>());       for (long int i = 1; i <= n; i++) {         if (br[i] > (n + 1) / 2) {           f = 1;         }       }       if (f == 0) {         cout <<  YES  << endl;       } else         cout <<  NO  << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   template <class TH>   void _dbg(const char *sdbg, TH h) {     cerr << sdbg <<  =  << h <<   n ;   }   template <class TH, class... TA>   void _dbg(const char *sdbg, TH h, TA... a) {     while (*sdbg !=  , ) cerr << *sdbg++;     cerr <<  =  << h <<  , ;     _dbg(sdbg + 1, a...);   }   long long test;   long long n, maybe, maks = 1000000007;   void solve() {     cin >> n;     for (long long i = 1; i <= (n); ++i) {       long long a, b;       cin >> a >> b;       if (a != b) {         cout <<  rated ;         return;       }       if (maks < a) {         maybe = 1;       }       maks = min(maks, a);     }     if (maybe) {       cout <<  unrated ;     } else {       cout <<  maybe ;     }     return;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.precision(10);     cout << fixed;     test = 1;     while (test--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int x1, y1, x2, y2, x3, y3;     cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;     cout << 3 << endl;     cout << x2 - x1 <<     << y3 - y1 << endl;     cout << x1 - x2 <<     << y3 - y2 << endl;     cout << x2 - x3 <<     << y1 - y3 << endl;   }   void solveexpr(double a, double b, double c, double d, double e, double f) {     double determinant = a * d - b * c;     if (determinant != 0) {       double x = (e * d - b * f) / determinant;       double y = (a * f - e * c) / determinant;       printf( %0.0f %0.0f n , x, y);     }   }   void solve1() {     int x1, y1, x2, y2, x3, y3, x, y;     cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;     cout << 3 << endl;     int val1 = x1 + x2;     int val2 = y1 + y2;     x = val1 - x3;     y = val2 - y3;     cout << x <<     << y << endl;     val1 = x3 + x1;     val2 = y3 + y1;     x = val1 - x2;     y = val2 - y2;     cout << x <<     << y << endl;     val1 = x3 + x2;     val2 = y3 + y2;     x = val1 - x1;     y = val2 - y1;     cout << x <<     << y << endl;   }   int main() {     int t = 1;     while (t--) {       solve1();     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     string s;     cin >> s;     long long n = s.length();     char ch =  z ;     for (long long i = 0; i < n; i++) {       if (ch < s[i])         cout <<  Ann n ;       else {         ch = s[i];         cout <<  Mike n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int abslt(int n) {     if (n < 0)       return -n;     else       return n;   }   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       int arr[n + 1];       int i;       for (i = 1; i <= n; i++) cin >> arr[i];       arr[0] = arr[1];       arr[n + 1] = arr[n];       int mx = INT_MIN;       int mn = INT_MAX;       for (i = 1; i <= n; i++) {         if ((arr[i] != -1 && arr[i + 1] == -1) ||             (arr[i] != -1 && arr[i - 1] == -1)) {           mx = max(mx, arr[i]);           mn = min(mn, arr[i]);         }       }       int ans = (mn + mx) / 2;       if (mx == INT_MIN) {         cout << 0 <<     << 0 << endl;         continue;       }       int k = INT_MIN;       for (i = 1; i < n; i++) {         if (arr[i] == -1) arr[i] = ans;         if (arr[i + 1] == -1) arr[i + 1] = ans;         k = max(k, abslt(arr[i] - arr[i + 1]));       }       cout << k <<     << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, s, cnt = 0;     cin >> n >> s;     int arr[100];     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     sort(arr, arr + n);     for (int i = 0; i < n - 1; i++) s -= arr[i];     if (s >= 0) {       cout <<  YES  << endl;     } else {       cout <<  NO  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 9;   struct node {     int id;     long long t;     bool operator<(const node &A) const { return id > A.id; }   } e[maxn];   bool cmp(node a, node b) { return a.t < b.t || a.t == b.t && a.id < b.id; }   long long ans[maxn];   int tr[maxn];   void update(int p, int v) {     while (p < maxn) tr[p] += v, p += p & -p;   }   int query(int p) {     int res = 0;     while (p > 0) {       res += tr[p];       p -= p & -p;     }     return res;   }   int main() {     int n;     long long p;     scanf( %d%lld , &n, &p);     for (int i = 1; i <= n; i++) e[i].id = i, scanf( %lld , &e[i].t);     sort(e + 1, e + 1 + n, cmp);     priority_queue<node> W;     queue<node> Q;     int ar = 1;     long long t = 0;     while (ar <= n || !Q.empty() || !W.empty()) {       if (Q.empty() && W.empty()) {         t = e[ar].t;         update(e[ar].id, 1);         Q.push(e[ar++]);       }       if (Q.empty() && !W.empty()) {         update(W.top().id, 1);         Q.push(W.top());         W.pop();       }       if (!Q.empty()) {         node tmp = Q.front();         Q.pop();         t += p;         ans[tmp.id] = t;         while (ar <= n && e[ar].t <= t) {           if (query(e[ar].id - 1) == 0)             update(e[ar].id, 1), Q.push(e[ar++]);           else             W.push(e[ar++]);         }         update(tmp.id, -1);         while (!W.empty() && query(W.top().id - 1) == 0) {           tmp = W.top();           W.pop();           update(tmp.id, 1);           Q.push(tmp);         }       }     }     for (int i = 1; i <= n; i++) {       printf( %lld%c , ans[i],    n [i == n]);     }   }
#include <bits/stdc++.h>   using namespace std;   int n, m, mon_cost;   vector<tuple<int, int, int>> friends;   const long long oo = 1LL << 60;   void solve() {     cin >> n >> m >> mon_cost;     friends.resize(n);     for (int i = 0; i < n; ++i) {       int x, k, num;       cin >> x >> k >> num;       int mask = 0;       for (int j = 0; j < num; ++j) {         int y;         cin >> y;         y--;         mask = mask | (1 << y);       }       friends[i] = tie(x, k, mask);     }     sort(friends.begin(), friends.end(),          [](tuple<int, int, int> lhs, tuple<int, int, int> rhs) {            return get<1>(lhs) < get<1>(rhs);          });     vector<vector<long long>> dp(2, vector<long long>(1 << m, oo));     int x, k, tasks;     tie(x, k, tasks) = friends[0];     dp[1][0] = 0;     dp[1][tasks] = x;     long long ans = oo;     for (int i = 0; i < n; ++i) {       int cur = i % 2;       int prev = cur ^ 1;       tie(x, k, tasks) = friends[i];       for (int mask = 0; mask < (1 << m); ++mask) {         dp[cur][mask | tasks] = min(dp[cur][mask | tasks], dp[prev][mask] + x);         dp[cur][mask] = min(dp[cur][mask], dp[prev][mask]);       }       long long val = dp[cur][(1 << m) - 1] + 1LL * k * mon_cost;       ans = min(ans, val);     }     if (ans < oo) {       cout << ans <<   n ;     } else {       cout << -1 <<   n ;     }   }   int main() { solve(); }
#include <bits/stdc++.h>   using namespace std;   using vi = vector<int>;   using vvi = vector<vi>;   using ll = long long;   using vll = vector<ll>;   using vvll = vector<vll>;   using pii = pair<int, int>;   using pll = pair<ll, ll>;   void solve() {     int n;     cin >> n;     vi a(n), b(n);     vector<pii> p, q;     for (int& x : a) cin >> x;     for (int& x : b) cin >> x;     if (n % 2 == 1) {       if (a[n / 2] != b[n / 2]) {         puts( No );         return;       }     }     for (int i = 0; i < n / 2; i++) {       p.push_back(make_pair(min(a[i], a[n - 1 - i]), max(a[i], a[n - 1 - i])));     }     for (int i = 0; i < n / 2; i++) {       q.push_back(make_pair(min(b[i], b[n - 1 - i]), max(b[i], b[n - 1 - i])));     }     sort(p.begin(), p.end());     sort(q.begin(), q.end());     if (p == q) {       puts( Yes );     } else {       puts( No );     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     int n;     cin >> n;     while (n--) {       solve();     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n = 1000 + 1000 + 1;     printf( %d n , n);     for (int i = (int)(1); i <= (int)(1000); ++i)       printf( %d %d %d %d n , i, 1, i, 2);     puts( 1 1 1 2 );     for (int i = (int)(1); i <= (int)(1000); ++i)       printf( %d %d %d %d n , i, 1, i, 2);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   long double x;   int a[5005];   int mem[5005][5005];   int lis(int ind, int ant) {     if (ind >= n) return 0;     if (mem[ind][ant] != -1) return mem[ind][ant];     int op1, op2;     op1 = op2 = 0;     if (ant <= a[ind]) op1 = lis(ind + 1, a[ind]) + 1;     op2 = lis(ind + 1, ant);     return mem[ind][ant] = max(op1, op2);   }   int main() {     ;     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     memset(mem, -1, sizeof mem);     cin >> n >> m;     for (int i = 0; i < n; i++) cin >> a[i] >> x;     cout << n - lis(0, 0) <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long bigmod(long long b, long long p, long long n) {     if (p == 0)       return 1;     else if (p % 2 == 0) {       long long half1 = bigmod(b, p / 2, n);       return ((half1 * half1) % n);     } else if (p % 2 == 1) {       long long p1 = b % n;       long long p2 = bigmod(b, p - 1, n);       return ((p1 * p2) % n);     }   }   long long pre11[1000010], pre21[1000010];   string s, s1;   const int p = 31;   const int m1 = 1e9 + 7;   long long MMI[1000010];   void com() {     MMI[0] = 1;     MMI[1] = bigmod(31, m1 - 2, m1);     for (long long i = 2; i <= s.size() + 3; i++)       MMI[i] = (MMI[i - 1] * MMI[1]) % m1;   }   void compute_hash() {     long long hash_value1 = 0, hash_value2 = 0;     long long p_pow1 = 1, p_pow2 = 1;     for (int i = 0; i < s.size(); i++) {       hash_value1 = (hash_value1 + (s[i] -  a  + 1) * p_pow1) % m1;       if (i < s1.size())         hash_value2 = (hash_value2 + (s1[i] -  a  + 1) * p_pow1) % m1;       p_pow1 = (p_pow1 * p) % m1;       pre11[i] = hash_value1;       if (i < s1.size()) pre21[i] = hash_value2;     }   }   void compute_hash2() {     long long hash_value1 = 0, hash_value2 = 0;     long long p_pow1 = 1, p_pow2 = 1;     for (int i = 0; i < s1.size(); i++) {       hash_value1 = (hash_value1 + (s1[i] -  a  + 1) * p_pow1) % m1;       p_pow1 = (p_pow1 * p) % m1;       pre21[i] = hash_value1;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     cin >> s >> s1;     com();     compute_hash();     vector<int> V;     for (int i = 0; i < s.size(); i++) {       long long p1, p2;       long long t1, t2;       if (i == 0) {         p2 = pre11[s.size() - 1] - pre11[0];         if (p2 < 0) p2 += m1;         p2 = ((p2 % m1) * MMI[i + 1]) % m1;         if (p2 == pre21[s1.size() - 1]) V.push_back(i + 1);       } else if (i == s.size() - 1) {         if (pre21[i - 1] == pre11[i - 1]) V.push_back(i + 1);       } else {         p2 = pre11[s.size() - 1] - pre11[i];         if (p2 < 0) p2 += m1;         p2 = ((p2 % m1) * MMI[i + 1]) % m1;         t2 = pre21[s1.size() - 1] - pre21[i - 1];         if (t2 < 0) t2 += m1;         t2 = ((t2 % m1) * MMI[i]) % m1;         if (p2 == t2 && pre21[i - 1] == pre11[i - 1]) V.push_back(i + 1);       }     }     cout << V.size() << endl;     for (int i = 0; i < V.size(); i++) cout << V[i] <<    ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int c, r;     cin >> c >> r;     bool flag = true;     for (int i = 1; i <= c; i++) {       if (i & 1) {         for (int j = 1; j <= r; j++) {           cout <<  # ;         }         cout << endl;       } else {         if (flag) {           for (int j = 1; j <= r - 1; j++) {             cout <<  . ;           }           cout <<  #  << endl;           flag = false;         } else {           cout <<  # ;           for (int j = 1; j <= r - 1; j++) {             cout <<  . ;           }           cout << endl;           flag = true;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int sMAX = 10010;   const int MAX = 114514;   const long long bMAX = 1919180;   int main() {     int t;     cin >> t;     while (t--) {       string zs;       cin >> zs;       int ans = zs.size() + 1;       int m[4] = {0, 0, 0, 0};       for (int i = 0; i < zs.size(); i++) {         m[zs[i] -  0 ] = i + 1;         if (m[1] && m[2] && m[3]) {           int gsb = min(m[1], m[2]);           ans = min(ans, max(m[1], max(m[2], m[3])) - min(gsb, m[3]) + 1);         }       }       if (ans == zs.size() + 1) {         cout << 0 << endl;       } else         cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, k;   int f[3001][3001], vis[3001][3001];   char s[3001][3001];   int main() {     scanf( %d%d , &n, &k);     for (int i = 1; i <= n; i++) scanf( %s , s[i] + 1);     memset(f, 0x3f, sizeof(f));     f[0][1] = f[1][0] = 0;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++) {         f[i][j] = min(f[i - 1][j], f[i][j - 1]);         if (s[i][j] !=  a ) f[i][j]++;       }     int max0 = 1;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++)         if (f[i][j] <= k) max0 = max(max0, i + j);     for (int i = 2; i <= max0; i++) putchar( a );     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++)         if (i + j == max0 && f[i][j] <= k) vis[i][j] = 1;     if (max0 == 1) vis[0][1] = vis[1][0] = 1;     for (int kx = max0 + 1; kx <= n * 2; kx++) {       for (int i = 1; i < kx; i++)         if (i <= n && kx - i <= n)           vis[i][kx - i] = vis[i - 1][kx - i] | vis[i][kx - i - 1];       char minc =  z ;       for (int i = 1; i < kx; i++)         if (i <= n && kx - i <= n && vis[i][kx - i])           minc = min(minc, s[i][kx - i]);       for (int i = 1; i < kx; i++)         if (i <= n && kx - i <= n && s[i][kx - i] != minc) vis[i][kx - i] = 0;       putchar(minc);     }     putchar(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, pos, l, r;     while (cin >> n >> pos >> l >> r) {       if (l == 1 && r == n)         cout << 0 << endl;       else if (l == 1)         cout << (abs(r - pos) + 1) << endl;       else if (r == n)         cout << (abs(l - pos) + 1) << endl;       else if (pos < l || pos > r)         cout << (max(abs(r - pos), abs(l - pos)) + 2) << endl;       else         cout << (r - l + min(abs(r - pos), abs(l - pos)) + 2) << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 786433, MAXN = 2000005, LOGN = 18, MAXM = 5005;   inline void S(int& n) {     n = 0;     int ch = getchar();     int sign = 1;     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) sign = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       n = (n << 3) + (n << 1) + ch -  0 , ch = getchar();     }     n = n * sign;   }   const int SHIFT = 30, ETF = MOD - 1, LIM = (int)1e9;   const long long int INF = (long long int)1e18 + 1;   const double PI = (double)acos(-1), EPSILON = 1e-10;   long long int recurse(long long int n) {     long long int group_size = 1, gcnt = 0;     long long int ans = 0;     while (n >= group_size) {       long long int temp = 1;       temp <<= gcnt;       ans += temp;       ans += gcnt * (group_size) / 2;       n -= group_size;       group_size <<= 1;       gcnt++;     }     if (n) {       long long int temp = 1;       ans += recurse(n - 1) + (temp << gcnt);     }     return ans;   }   int main() {     long long int n;     cin >> n;     cout << recurse(n - 1) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   long long dp[21][2001];   long long fact[200001];   long long tcaf[200001];   int pow1(int n, int p) {     long long cur, res;     cur = n;     res = 1;     while (p) {       if (p & 1) {         res *= cur;         res %= MOD;       }       p /= 2;       cur *= cur;       cur %= MOD;     }     return res;   }   void init() {     fact[0] = tcaf[0] = 1;     for (int i = 1; i < 200001; i++) {       fact[i] = 1LL * fact[i - 1] * i % MOD;       tcaf[i] = pow1(fact[i], MOD - 2);     }   }   int ways(pair<int, int> p1, pair<int, int> p2) {     int n, m;     n = p2.first - p1.first;     m = p2.second - p1.second;     if (n < 0 || m < 0) return 0;     return 1LL * fact[n + m] * tcaf[n] % MOD * tcaf[m] % MOD;   }   long long calc(int s, int num, int tot) {     for (int i = 0; i < num; i++) s = (s + 1) / 2;     return 1LL * tot * s;   }   int main() {     init();     int n, m, k, s;     cin >> n >> m >> k >> s;     init();     vector<pair<int, int>> points(k + 1);     for (int i = 1; i <= k; i++) {       scanf( %d %d , &points[i].first, &points[i].second);       points[i].first--;       points[i].second--;     }     points.push_back({n - 1, m - 1});     sort(points.begin(), points.end());     dp[0][0] = 1;     for (int i = 1; i <= k + 1; i++) {       dp[0][i] = ways({0, 0}, points[i]);       for (int j = 1; j < i; j++) {         dp[0][i] -= 1LL * dp[0][j] * ways(points[j], points[i]), dp[0][i] %= MOD;       }     }     for (int i = 1; i <= 20; i++) {       for (int j = 1; j <= k + 1; j++) {         dp[i][j] = ways({0, 0}, points[j]);         for (int s = 1; s < j; s++) {           dp[i][j] -= 1LL * dp[i][s] * ways(points[s], points[j]) % MOD;           dp[i][j] %= MOD;         }         for (int s = i - 1; s >= 0; s--) dp[i][j] -= dp[s][j], dp[i][j] %= MOD;       }     }     long long res = 0;     long long tot = ways({0, 0}, {n - 1, m - 1});     for (int i = 0; i <= 20; i++) {       res += calc(s, i, dp[i][k + 1]);       res %= MOD;       tot -= dp[i][k + 1];     }     res += tot;     res *= pow1(ways({0, 0}, {n - 1, m - 1}), MOD - 2);     res %= MOD;     res = (res + MOD) % MOD;     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dp[15][105][105];   int main() {     int n, q, c;     int x, y, s;     int t, x1, y1, x2, y2;     memset(dp, 0, sizeof dp);     scanf( %d%d%d , &n, &q, &c);     while (n--) {       scanf( %d%d%d , &x, &y, &s);       dp[s][x][y]++;     }     for (int i = 0; i < c + 1; i++) {       for (int x = 1; x <= 100; x++) {         for (int y = 1; y <= 100; y++) {           dp[i][x][y] += dp[i][x - 1][y] + dp[i][x][y - 1] - dp[i][x - 1][y - 1];         }       }     }     int cnt;     while (q--) {       scanf( %d%d%d%d%d , &t, &x1, &y1, &x2, &y2);       int ans = 0;       for (int i = 0; i < c + 1; i++) {         int light = (i + t) % (c + 1);         cnt = dp[i][x2][y2] + dp[i][x1 - 1][y1 - 1] - dp[i][x1 - 1][y2] -               dp[i][x2][y1 - 1];         ans += light * cnt;       }       printf( %d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, k;   int a[100010];   int p[100010];   int cnt;   int ans;   int main() {     scanf( %d%d%d , &n, &m, &k);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     for (int i = 2; i <= n; i++) {       p[++cnt] = (a[i] - a[i - 1] - 1);     }     sort(p + 1, p + cnt + 1);     for (int i = 1; i <= n - k; i++) {       ans += p[i];     }     printf( %d , ans + n);   }
#include <bits/stdc++.h>   using namespace std;   const int MX = 3e5;   const int LG = 20;   struct Query {     int i, x, y;     bool operator<(Query q) const {       if (x != q.x) return x > q.x;       return i < q.i;     }   };   int N, Q;   Query query[MX + 10];   int A[MX + 10];   int dp[MX + 10][LG + 10];   int last[MX + 10];   void init() {}   void calc_dp() {     for (int i = 1; i <= N; i++) {       for (int b = 0; b < LG; b++) {         if (A[i] & (1 << b)) {           dp[i][b] = i;         } else {           for (int c = 0; c < LG; c++) {             if (~A[i] & (1 << c)) continue;             dp[i][b] = max(dp[i][b], dp[last[c]][b]);           }         }       }       for (int b = 0; b < LG; b++) {         if (~A[i] & (1 << b)) continue;         last[b] = i;       }     }   }   bool solve(int x, int y) {     for (int b = 0; b < LG; b++) {       if ((A[x] & (1 << b))) {       }       if ((A[x] & (1 << b)) && (dp[y][b] >= x)) {         return true;       }     }     return false;   }   int main() {     init();     scanf( %d%d , &N, &Q);     for (int i = 1; i <= N; i++) {       scanf( %d , &A[i]);     }     for (int q = 1; q <= Q; q++) {       scanf( %d%d , &query[q].x, &query[q].y);       query[q].i = q;     }     calc_dp();     for (int q = 1; q <= Q; q++) {       if (solve(query[q].x, query[q].y))         printf( Shi n );       else         printf( Fou n );     }   }
#include <bits/stdc++.h>   using namespace std;   long long int powmod(long long int a, long long int e) {     if (e == 0) return 1;     long long int x = powmod(a * a % 1000000007, e >> 1);     return e & 1 ? x * a % 1000000007 : x;   }   set<int> unvis;   set<pair<long long int, long long int> > forbid;   void dfs(int v) {     int ver = -1;     auto it = unvis.begin();     while (it != unvis.end()) {       ver = *it;       if (forbid.find({min(ver, v), max(ver, v)}) != forbid.end()) {         it++;         continue;       }       unvis.erase(it);       dfs(ver);       it = unvis.upper_bound(ver);     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n, m, k;     cin >> n >> m >> k;     for (long long int i = 0; i < m; i++) {       int a, b;       cin >> a >> b;       a--;       b--;       forbid.insert({min(a, b), max(a, b)});     }     for (long long int i = 0; i < n - 1; i++) unvis.insert(i + 1);     dfs(0);     if (!unvis.empty()) {       cout <<  impossible ;       return 0;     }     int cnt = 0;     for (auto i : forbid) {       if (i.first == 0)         cnt++;       else         break;     }     for (long long int i = 1; i < n; i++) unvis.insert(i);     int conn = 0;     while (!unvis.empty()) {       int x = *unvis.begin();       unvis.erase(unvis.begin());       dfs(x);       conn++;     }     if (k >= conn and k <= n - 1 - cnt)       cout <<  possible ;     else       cout <<  impossible ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, sum_even = 0, sum_odd = 0;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       int val;       scanf( %d , &val);       if (val & 1) return puts( First ), 0;     }     puts( Second );   }