malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   char S[1000000 + 5], T[1000000 + 5];   int c[1000000 + 5][26], l[1000000 + 5], f[1000000 + 5], tn, df[1000000 + 5],       ff[1000000 + 5], s[1000000 + 5], F[1000000 + 5];   int main() {     int n, i, j, x;     scanf( %s , S + 1);     n = strlen(S + 1);     T[0] = 255;     for (i = 1; i <= n / 2; ++i)       T[2 * i - 1] = S[i] -  a , T[2 * i] = S[n - i + 1] -  a ;     f[0] = 1;     l[++tn] = -1;     for (F[0] = i = x = 1; i <= n; ++i) {       while (T[i] != T[i - l[x] - 1]) x = f[x];       if (!c[x][T[i]]) {         for (j = f[x]; T[i - l[j] - 1] != T[i]; j = f[j])           ;         f[++tn] = c[j][T[i]];         l[c[x][T[i]] = tn] = l[x] + 2;         df[tn] = l[tn] - l[f[tn]];         ff[tn] = df[tn] == df[f[tn]] ? ff[f[tn]] : tn;       }       x = c[x][T[i]];       for (j = x; j; j = f[ff[j]]) {         s[j] = F[i - l[ff[j]]];         if (ff[j] != j) s[j] = (s[j] + s[f[j]]) % 1000000007;         if (~i & 1) F[i] = (F[i] + s[j]) % 1000000007;       }     }     printf( %d , F[n]);   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int i, j, n, ct = 0;     cin >> n;     int a[n];     for (i = 0; i < n; i++) cin >> a[i];     if (n < 2) {       cout <<  -1 n ;       return;     }     sort(a, a + n);     set<int> ans;     if (n == 2) {       ans.insert(a[1] + a[1] - a[0]);       ans.insert(a[0] - (a[1] - a[0]));       if ((a[1] - a[0]) % 2 == 0) ans.insert((a[0] + a[1]) / 2);     } else {       set<int> dif;       for (i = 1; i < n; i++) dif.insert(a[i] - a[i - 1]);       if (dif.size() == 1) {         int d = *dif.begin();         ans.insert(a[0] - d);         ans.insert(a[n - 1] + d);       } else if (dif.size() == 2) {         int d1 = *dif.begin();         int d2 = *dif.upper_bound(d1);         if (2 * d1 == d2) {           for (i = 0; i + 1 < n; i++) {             if (a[i] + d1 == a[i + 1]) continue;             ct++;             ans.insert(a[i] + d1);           }         }       }     }     if (ct > 1) ans.clear();     cout << ans.size() <<   n ;     for (auto &x : ans) cout << x <<    ;   }   int main() {     ios_base::sync_with_stdio(false);     int test = 1;     while (test--) solve();   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int i, j, k, l, m, n;     cin >> n;     string s[n], t;     for (i = 0; i < n; i++) {       cin >> s[i];     }     map<string, vector<long long int>> mp;     set<string> ss;     for (i = 1; i <= 9; i++) {       for (j = 0; j < n; j++) {         for (k = 0; k + i - 1 < 9; k++) {           t = s[j].substr(k, i);           ss.insert(t);         }         while (ss.empty() != true) {           mp[*(ss.begin())].push_back(j);           ss.erase(ss.begin());         }       }     }     map<string, vector<long long int>>::iterator it;     string fir;     map<long long int, long long int> mpp;     string ans[n];     for (it = mp.begin(); it != mp.end(); it++) {       fir = it->first;       if (mp[fir].size() == 1 && mpp[mp[fir][0]] == 0) {         mpp[mp[fir][0]] = 1;         ans[mp[fir][0]] = fir;       } else if (mp[fir].size() == 1 && mpp[mp[fir][0]] == 1) {         if (fir.length() < ans[mp[fir][0]].length()) {           ans[mp[fir][0]] = fir;         }       }     }     for (i = 0; i < n; i++) {       cout << ans[i] << endl;       ;     }   }
#include <bits/stdc++.h>   using namespace std;   string ToStr(char k) {     stringstream ss;     ss << k;     return ss.str();   }   bool check(string str) {     int n = (int)str.length();     for (int i = 0; i < n / 2; i++) {       if (str[i] != str[n - i - 1]) return false;     }     return true;   }   int main() {     string s;     cin >> s;     for (int i = 0; i <= (int)s.length(); i++) {       for (int j = 0; j < 26; j++) {         string tmp = s;         tmp.insert(i, ToStr( a  + j));         if (check(tmp)) {           cout << tmp << endl;           return 0;         }       }     }     cout <<  NA  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 1000 * 101;   const long long INF = 1e18;   long long n, a[maxn];   vector<pair<char, long long> > ans1;   vector<pair<long long, long long> > ans;   queue<long long> bra;   int main() {     std::ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     a[0] = 0;     a[n + 1] = 0;     for (int i = 1; i <= n + 1; i++) {       if (a[i] > a[i - 1]) {         long long dis = a[i] - a[i - 1];         for (int j = 0; j < dis; j++) ans1.push_back({ ( , i});       } else if (a[i] < a[i - 1]) {         long long dis = a[i - 1] - a[i];         for (int j = 0; j < dis; j++) ans1.push_back({ ) , i - 1});       }     }     for (int i = 0; i < ans1.size(); i++) {       if (ans1[i].first ==  ( ) {         bra.push(ans1[i].second);       } else {         long long x2 = bra.front();         ans.push_back({x2, ans1[i].second});         bra.pop();       }     }     cout << ans.size() <<   n ;     for (int i = 0; i < ans.size(); i++) {       cout << ans[i].first <<     << ans[i].second <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool gone[1000000];   int n;   int ord[1000000], put[1000000];   int main() {     scanf( %i , &n);     for (int(a) = 0; (a) < (n); (a)++) scanf( %i , ord + a);     for (int(a) = 0; (a) < (n); (a)++) scanf( %i , put + a);     int i = 0;     for (int(a) = 0; (a) < (n); (a)++) {       int res = 0;       if (gone[put[a]] || i >= n) {         printf( %i  , res);         continue;       }       while (ord[i] != put[a]) {         gone[ord[i]] = true;         i++;         res++;       }       gone[ord[i]] = true;       i++;       res++;       printf( %i  , res);     }     printf(  n );     return 0;   }
#include <bits/stdc++.h>   enum { MAXN = 102 };   int reverse[MAXN], target[MAXN], init[MAXN];   int n;   int eq(int *a, int *b) {     int i;     for (i = 1; i <= n; i++)       if (a[i] != b[i]) return 0;     return 1;   }   void proc(int *a, int *b) {     int ans[MAXN], i;     for (i = 1; i <= n; i++) {       ans[i] = a[b[i]];     }     for (i = 1; i <= n; i++) a[i] = ans[i];   }   void print(int *a) {     int i;     for (i = 1; i <= n; i++) printf( %d  , a[i]);     puts(  );   }   int main(void) {     int k, m1, m2, i;     scanf( %d %d , &n, &k);     for (i = 1; i <= n; i++) {       scanf( %d , init + i);       reverse[init[i]] = i;     }     for (i = 1; i <= n; i++) scanf( %d , target + i);     int natur[MAXN];     for (i = 1; i <= n; i++) natur[i] = i;     m1 = 0;     m2 = 0;     while (m1 < 1000 && !eq(natur, target)) {       proc(natur, init);       m1++;     }     if (!eq(natur, target)) m1 = -1;     for (i = 1; i <= n; i++) natur[i] = i;     while (m2 < 1000 && !eq(natur, target)) {       proc(natur, reverse);       m2++;     }     if (!eq(natur, target)) m2 = -1;     char *ans =  NO ;     if (m1 == 1 && m2 == 1) {       if (k == 1) ans =  YES ;     } else if (m1 == 1 || m2 == 1) {       if (k % 2 == 1) ans =  YES ;     }     if (m1 > 1 && (k - m1) >= 0 && (k - m1) % 2 == 0) ans =  YES ;     if (m2 > 1 && (k - m2) >= 0 && (k - m2) % 2 == 0) ans =  YES ;     puts(ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   int R[N], czy[N], dp[N], siz[N];   pair<int, int> E[N], E2[N];   int M;   pair<int, int> Find(int x) {     if (x == R[x]) return {x, 0};     pair<int, int> a = Find(R[x]);     a.second ^= czy[x];     return a;   }   void Union(int a, int b) {     if (a == b) return;     if (siz[a] > siz[b]) swap(a, b);     siz[b] += siz[a];     R[a] = b;     czy[a] ^= 1 ^ czy[b];     czy[b] = 0;   }   void sep(int a, int b) {     if (a == b) return;     czy[a] = 0;     czy[b] = 0;     if (siz[a] > siz[b]) swap(a, b);     siz[b] -= siz[a];     R[a] = a;   }   void solve(int l, int r, int a, int b) {     if (l > r) return;     int m = (l + r) >> 1;     dp[m] = N;     for (int i = l; i < m; i++) {       pair<int, int> A = Find(E[i].first), B = Find(E[i].second);       E2[i] = {A.first, B.first};       if (A.first == B.first && (A.second ^ B.second ^ 1)) {         dp[m] = i;         break;       }       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);     }     if (dp[m] < m) {       for (int i = dp[m] - 1; i >= l; i--) sep(E2[i].first, E2[i].second);       solve(l, dp[m], a, b);       for (int i = dp[m] + 1; i <= r; i++) dp[i] = b;       return;     }     for (int i = b; i >= a; i--) {       if (i < m) {         dp[m] = m - 1;         break;       }       pair<int, int> A = Find(E[i].first), B = Find(E[i].second);       E2[i] = {A.first, B.first};       if (A.first == B.first && (A.second ^ B.second ^ 1)) {         dp[m] = i;         break;       }       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);     }     for (int i = dp[m] + 1; i <= b; i++) sep(E2[i].first, E2[i].second);     pair<int, int> A = Find(E[m].first), B = Find(E[m].second);     if (A.first == B.first && (A.second ^ B.second ^ 1)) {       for (int i = m + 1; i <= r; i++) dp[i] = b;     } else {       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);       solve(m + 1, r, dp[m], b);       sep(A.first, B.first);     }     for (int i = m - 1; i >= l; i--) {       sep(E2[i].first, E2[i].second);     }     for (int i = b; i > dp[m]; i--) {       A = Find(E[i].first), B = Find(E[i].second);       E2[i] = {A.first, B.first};       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);     }     solve(l, m - 1, a, dp[m]);     for (int i = dp[m] + 1; i <= b; i++) sep(E2[i].first, E2[i].second);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n, m, q;     cin >> n >> m >> q;     M = m;     for (int i = 1; i <= n + 2; i++) {       R[i] = i;       siz[i] = 1;     }     for (int i = 1; i <= m; i++) {       cin >> E[i].first >> E[i].second;     }     E[m + 1] = {n + 1, n + 2};     solve(1, m, 0, m + 1);     while (q--) {       int l, r;       cin >> l >> r;       if (r >= dp[l])         cout <<  NO n ;       else         cout <<  YES n ;     }   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   long long pw[19];   long long val[19];   char A[100009];   string s[100009];   int main() {     scanf( %s , A);     scanf( %d , &m);     for (int i = 0; i < 10; i++) {       val[i] = i;       pw[i] = 10;     }     for (int i = 0; i < m; i++) cin >> s[i];     for (int j = m - 1; j >= 0; j--) {       int ln = s[j].length();       int nm = s[j][0] -  0 ;       long long nmpw = 1;       long long san = 0;       for (int i = ln - 1; i > 2; i--) {         san = (san + (nmpw * val[s[j][i] -  0 ])) % 1000000007;         nmpw = (nmpw * pw[s[j][i] -  0 ]) % 1000000007;       }       val[nm] = san;       pw[nm] = nmpw;     }     int ln = strlen(A);     long long ans = 0;     long long nmpw = 1;     for (int i = ln - 1; i >= 0; i--) {       ans = (ans + (val[A[i] -  0 ] * nmpw)) % 1000000007;       nmpw = (nmpw * pw[A[i] -  0 ]) % 1000000007;     }     printf( %lld n , ans);   }
#include <bits/stdc++.h>   using namespace std;   inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }   const int INF = (((1 << 30) - 1) << 1) + 1;   const int nINF = 1 << 31;   string s;   vector<int> v[2], ans;   int n, t;   void print(vector<int>& vec) {     for (int x : vec) cout << x <<    ;     cout << endl;   }   signed main() {     ios::sync_with_stdio(false);     cin >> t;     while (t--) {       v[0].clear(), v[1].clear(), ans.clear();       cin >> n >> s;       bool good = true, two = false;       int lo = 10;       for (int i = 0; i < (n); i++) {         if (two) {           if (s[i] == lo && s[v[1].back()] == lo) {             v[1].push_back(i);           } else if (s[i] <= lo) {             if (!v[0].empty() && s[i] < s[v[0].back()]) {               good = false;               break;             } else {               v[0].push_back(i);             }           } else {             if (!v[1].empty() && s[i] < s[v[1].back()]) {               good = false;               break;             } else {               v[1].push_back(i);             }           }         } else {           if (!v[0].empty() && s[i] < s[v[0].back()]) {             two = true;             vector<int> temp;             while (!v[0].empty() && s[i] < s[v[0].back()]) {               temp.push_back(v[0].back());               v[0].pop_back();             }             lo = s[temp.back()];             while (!temp.empty()) {               v[1].push_back(temp.back());               temp.pop_back();             }           }           v[0].push_back(i);         }       }       ans.resize(n, 1);       for (int i = 0; i < (v[1].size()); i++) {         ans[v[1][i]] = 2;       }       if (!good)         cout <<  -  << endl;       else {         for (int x : ans) cout << x;         cout << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   int n, m;   int popCount(int x) {     int count = 0;     while (x) {       ++count;       x &= x - 1;     }     return count;   }   inline bool Okay(int x) { return (((1 << m) - 1) & x) == ((1 << m) - 1); }   int main() {     ios::sync_with_stdio(false);     cin >> n >> m;     if (n < m) swap(n, m);     int*** Arr = new int**[n + 1];     for (int i = 0; i <= n; ++i) {       Arr[i] = new int*[1 << m];       for (int j = 0; j < (1 << m); ++j) {         Arr[i][j] = new int[1 << m];         for (int k = 0; k < (1 << m); ++k) {           Arr[i][j][k] = 100000000;         }       }     }     Arr[0][(1 << m) - 1][0] = 0;     for (int i = 0; i < n; ++i) {       for (int j = 0; j < (1 << m); ++j) {         for (int k = 0; k < (1 << m); ++k) {           for (int t = 0; t < (1 << m); ++t) {             if (Okay(j | k | t | (k >> 1) | (k << 1)))               Arr[i + 1][k][t] =                   min(Arr[i + 1][k][t], Arr[i][j][k] + popCount(t));           }         }       }     }     int _ans = 100000;     for (int k = 0; k < (1 << m); ++k) {       for (int t = 0; t < (1 << m); ++t) {         if (Okay(k | t | (t << 1) | (t >> 1))) _ans = min(_ans, Arr[n][k][t]);       }     }     cout << n * m - _ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, l, k;   double probs[200];   int bags[200];   double dp[201][410][201];   double solve(int index, int currCapacity, int wonTours) {     if (index == n) {       if (wonTours >= l) {         if (currCapacity >= 0)           return 1.0;         else           return 0.0;       } else {         return 0.0;       }     }     double &calculated = dp[index][currCapacity + 201][wonTours];     if (calculated + 1.0 > 1e-4) return calculated;     double ans = 0.0;     ans = probs[index] * solve(index + 1, min(405, currCapacity + bags[index]),                                wonTours + 1) +           (1.0 - probs[index]) * solve(index + 1, currCapacity, wonTours);     return calculated = ans;   }   int main() {     cin >> n >> l >> k;     memset(dp, -1.0, sizeof(dp));     for (int i = 0; i <= n - 1; i++) {       cin >> probs[i];       probs[i] /= 100.0;     }     for (int i = 0; i <= n - 1; i++) {       cin >> bags[i];     }     printf( %.10f , solve(0, k, 0));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, n, sum = 0, t;     vector<int> a;     cin >> n;     for (i = 0; i < n; i++) {       cin >> t;       sum += t;       a.push_back(sum);     }     cin >> n;     for (i = 0; i < n; i++) {       cin >> t;       cout << lower_bound(a.begin(), a.end(), t) - a.begin() + 1 <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void DBG() {     cerr <<  ]           <<   n ;   }   template <class H, class... T>   void DBG(H h, T... t) {     cerr << h;     if (sizeof...(t)) cerr <<  ,  ;     DBG(t...);   }   template <class H>   void DBG(vector<H> v) {     for (int i = 0; i < (int)v.size(); i++) {       cerr << v[i];       if (i != (int)v.size() - 1) cerr <<  ,  ;     }     cerr <<  ]  <<   n ;   }   long long randNum(long long a, long long b) { return a + rand() % (b - a + 1); }   long long mPow(long long b, long long p, long long m) {     b %= m;     long long result = 1;     while (p > 0) {       if (p & 1) result = (result * b) % m;       b = (b * b) % m;       p >>= 1;     }     return result;   }   long long gcdExtended(long long a, long long b, long long *x, long long *y) {     if (a == 0) {       *x = 0, *y = 1;       return b;     }     long long x1, y1;     long long gcd = gcdExtended(b % a, a, &x1, &y1);     *x = y1 - (b / a) * x1;     *y = x1;     return gcd;   }   long long modInverse(long long b, long long m) {     long long x, y;     long long g = gcdExtended(b, m, &x, &y);     if (g != 1) return -1;     return (x % m + m) % m;   }   long long modDivide(long long a, long long b, long long m) {     a = a % m;     long long inv = modInverse(b, m);     if (inv == -1)       return -1;     else       return (inv * a) % m;   }   unsigned long long nCrModPFermat(unsigned long long n, int r, int p) {     if (n < (unsigned long long)r) return 0;     if (r == 0) return 1;     unsigned long long fac[n + 1];     fac[0] = 1;     for (unsigned long long i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;     return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %            p;   }   bool sortfunc(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }   long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }   long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }   const int dx4[4] = {-1, 0, 1, 0}, dy4[4] = {0, -1, 0, 1};   const int dx8[8] = {-1, -1, -1, 0, 0, 1, 1, 1},             dy8[8] = {0, 1, -1, -1, 1, 0, 1, -1};   void solve() {     vector<string> s;     int n, m;     cin >> n >> m;     string temp;     vector<int> cnt(m, 0);     for (int i = 0; i < n; i++) {       cin >> temp;       for (int j = 0; j < m; j++) {         if (temp[j] ==  1 ) {           cnt[j]++;         }       }       s.push_back(temp);     }     for (int i = 0; i < n; i++) {       bool flag = true;       for (int j = 0; j < m; j++) {         if (s[i][j] ==  0  and cnt[j] == 0) {           flag = false;           break;         }         if (s[i][j] ==  1  and cnt[j] - 1 == 0) {           flag = false;           break;         }       }       if (flag) {         cout <<  YES               <<   n ;         return;       }     }     cout <<  NO           <<   n ;   }   signed main() {     ios::sync_with_stdio(false);     cout.tie(NULL);     cin.tie(NULL);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char str[1000010];   int dp[1000010][2];   int a[1000010], b[1000011];   int main() {     scanf( %s , str);     int n = strlen(str);     n++;     for (int i = 0; i < n - 1; i++) a[i + 1] = str[i] -  0 ;     while (n > 0 && a[n - 1] == 0) n--;     for (int i = 0; i < n; i++) b[i] = 1 - a[i];     b[n - 1]++;     a[0] = 0;     for (int i = n - 1; i >= 0; i--) {       dp[i][0] = dp[i + 1][0] + a[i];       if (b[i] == 0) dp[i][0] = min(dp[i][0], dp[i + 1][1] + 1);       dp[i][1] = dp[i + 1][1] + b[i];       if (a[i] == 0) dp[i][1] = min(dp[i][1], dp[i + 1][0] + 1);     }     printf( %d n , dp[0][0]);   }
#include <bits/stdc++.h>   using namespace std;   const int MN = 100005, inf = 1000000005, mod = 1000000007;   const long long INF = 1000000000000000005LL;   const long double eps = (long double)1e-10;   long long det(pair<int, int> x, pair<int, int> y) {     return 1LL * x.first * y.second - 1LL * x.second * y.first;   }   long long det_pts(pair<int, int> x, pair<int, int> y, pair<int, int> z) {     y.first -= x.first;     y.second -= x.second;     z.first -= x.first;     z.second -= x.second;     return det(y, z);   }   long double detf(pair<long double, long double> x,                    pair<long double, long double> y) {     return x.first * y.second - x.second * y.first;   }   namespace hull {   vector<pair<int, int> > half_oto(vector<pair<int, int> >& P) {     vector<pair<int, int> > H;     for (auto p : P) {       while (H.size() > 1 && det_pts(H[H.size() - 2], H.back(), p) >= 0LL)         H.pop_back();       H.push_back(p);     }     return H;   }   vector<pair<int, int> > oto(vector<pair<int, int> > P) {     vector<pair<int, int> > L, U, ret;     sort((P).begin(), (P).end());     U = half_oto(P);     reverse((P).begin(), (P).end());     L = half_oto(P);     int su = U.size(), sl = L.size();     for (int i = 0; i < su; ++i) ret.push_back(U[i]);     for (int i = 1; i < sl - 1; ++i) ret.push_back(L[i]);     return ret;   }   };  // namespace hull   pair<long double, long double> daj(pair<long double, long double> a,                                      pair<long double, long double> b,                                      long double alfa) {     return {a.first * alfa + b.first * (1.0 - alfa),             a.second * alfa + b.second * (1.0 - alfa)};   }   long double P, Q;   long double wyn(pair<long double, long double> p) {     if (min(p.first, p.second) < eps) return (long double)INF;     return max(P / p.first, Q / p.second);   }   long double tern(pair<int, int> a, pair<int, int> b) {     pair<long double, long double> af = {(long double)a.first,                                          (long double)a.second};     pair<long double, long double> bf = {(long double)b.first,                                          (long double)b.second};     long double zd = 0.0, zg = 1.0;     for (int i = 1; i <= 60; ++i) {       long double one_th = (zg - zd) / 3.0, a1 = zd + one_th, a2 = zg - one_th;       pair<long double, long double> l = daj(af, bf, a1), r = daj(af, bf, a2);       if (wyn(l) > wyn(r))         zd = a1;       else         zg = a2;     }     long double alfa = (zd + zg) / 2.0;     return wyn(daj(af, bf, alfa));   }   int main() {     int n, p, q;     scanf( %d%d%d , &n, &p, &q);     P = p, Q = q;     vector<pair<int, int> > pts;     for (int i = 1; i <= n; ++i) {       int a, b;       scanf( %d%d , &a, &b);       pair<int, int> p = {a, b};       pts.push_back(p);       p = {a, 0};       pts.push_back(p);       p = {0, b};       pts.push_back(p);     }     pts = hull::oto(pts);     int s = pts.size();     long double ans = (long double)INF;     for (int i = 1; i < s; ++i) {       auto cur_wyn = tern(pts[i - 1], pts[i]);       ans = min(ans, cur_wyn);     }     printf( %.9Lf , ans);   }
#include <bits/stdc++.h>   using namespace std;   const long long Llinf = LLONG_MAX;   const int Inf = INT_MAX;   const int Maxn = 400 + 10;   const int Mod = 1e9 + 7;   char* _c = new char[Maxn];   string GetString() {     scanf( %s , _c);     return string(_c);   }   int n;   string s[Maxn];   string ns[Maxn];   unordered_map<string, bool> m;   int ans;   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) s[i] = GetString();     for (int i = 0; i < n; i++)       for (int j = 0; j < s[i].size(); j++) {         if (s[i][j] ==  u ) s[i][j] =  o , s[i].insert(j + 1,  o );         if (s[i][j] ==  h ) {           int k = j - 1;           while (k >= 0 && s[i][k] ==  k ) s[i][k] =  . , k--;         }       }     for (int i = 0; i < n; i++)       for (int j = 0; j < s[i].size(); j++)         if (s[i][j] !=  . ) ns[i].push_back(s[i][j]);     for (int i = 0; i < n; i++)       if (!m[ns[i]]) ans++, m[ns[i]] = true;     printf( %d n , ans);     return 0;   }