malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   void file() {     freopen( input.txt ,  r , stdin);     freopen( output.txt ,  w , stdout);   }   void fast() {     ios::sync_with_stdio(0);     cin.tie(0);   }   int main() {     int n;     cin >> n;     int x[n], y[n], ind[n + 5];     for (int i = 0; i < n; i++) cin >> x[i], ind[x[i]] = i;     for (int i = 0; i < n; i++) cin >> y[i];     int s = 0, j = 0;     for (int i = 0; i < n; i++) {       if (x[i - j] != y[i]) s += (n - ind[y[i]] - j), j++;     }     cout << s << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 2e5 + 10, INF = 1e9 + 10, mod = 1e9 + 7;   const double eps = 1e-9;   void chmax(int &a, int b) { a = (a > b ? a : b); }   void chmin(int &a, int b) { a = (a < b ? a : b); }   int sqr(int x) { return x * x; }   int add(int x, int y) {     if (x + y < 0) return x + y + mod;     return x + y >= mod ? x + y - mod : x + y;   }   void add2(int &x, int y) {     if (x + y < 0)       x = x + y + mod;     else       x = (x + y >= mod ? x + y - mod : x + y);   }   int mul(int x, int y) { return 1ll * x * y % mod; }   inline int read() {     char c = getchar();     int x = 0, f = 1;     while (c <  0  || c >  9 ) {       if (c ==  - ) f = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) x = x * 10 + c -  0 , c = getchar();     return x * f;   }   int N, a[MAXN], b[MAXN], c[MAXN], d[MAXN], vis[MAXN], dis[MAXN], pre[MAXN],       da[MAXN], num;   set<pair<int, int> > T[MAXN];   void Add(int x, int v, int id) {     for (; x <= num; x += (x & (-x))) T[x].insert(make_pair(v, id));   }   vector<int> Query(int p) {     int x = a[p], y = b[p];     vector<int> res;     for (; x; x -= (x & (-x))) {       set<pair<int, int> > &now = T[x];       while (1) {         set<pair<int, int> >::iterator it = now.lower_bound(make_pair(y, 0));         if (it == now.end()) break;         res.push_back(it->second);         now.erase(it);       }     }     return res;   }   void Des() {     sort(da + 1, da + num + 1);     num = unique(da + 1, da + num + 1) - da - 1;     for (int i = 1; i <= N; i++) {       a[i] = num - (lower_bound(da + 1, da + num + 1, a[i]) - da) + 1;       c[i] = num - (lower_bound(da + 1, da + num + 1, c[i]) - da) + 1;       if (i != N) Add(c[i], d[i], i);     }   }   void print(int t) {     printf( %d n , dis[t]);     for (int u = t; ~u; u = pre[u]) printf( %d  , u);   }   void BFS() {     queue<int> q;     q.push(N);     pre[N] = -1;     dis[N] = 1;     while (!q.empty()) {       int p = q.front();       q.pop();       if (a[p] == num && !b[p]) {         print(p);         return;       }       vector<int> nxt = Query(p);       for (int i = 0, t; i < nxt.size(); i++) {         if (vis[nxt[i]]) continue;         vis[nxt[i]] = 1;         q.push(t = nxt[i]);         dis[t] = dis[p] + 1, pre[t] = p;       }     }     puts( -1 );   }   signed main() {     N = read();     bool flag = 0;     for (int i = 1; i <= N; i++) {       a[i] = read(), b[i] = read(), c[i] = read(), d[i] = read();       da[++num] = a[i];       da[++num] = c[i];       flag |= (!a[i] && !b[i]);     }     if (!flag) return puts( -1 );     Des();     BFS();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long MOD = 1e9 + 7;   const long double PI = 4 * atan((long double)1);   const long long INF = 1e18;   const long long NINF = -1e18;   long long get_hash(string s) {     long long N = 1000001;     long long base[N], A = 11, MD = 1110111110111;     base[0] = 1;     for (long long i = (1); i < (N); ++i) base[i] = (base[i - 1] * A) % MD;     long long hs = 0;     for (long long i = (0); i < (s.size()); ++i) {       hs += (s[i] * base[i]);       hs %= MD;     }     return hs;   }   long long power(long long a, long long n) {     long long res = 1;     while (n) {       if (n % 2) res *= a;       a *= a;       n /= 2;     }     return res;   }   vector<string> vec_splitter(string s) {     s +=  , ;     vector<string> res;     while (!s.empty()) {       res.push_back(s.substr(0, s.find( , )));       s = s.substr(s.find( , ) + 1);     }     return res;   }   void debug_out(vector<string> __attribute__((unused)) args,                  __attribute__((unused)) long long idx,                  __attribute__((unused)) long long LINE_NUM) {     cerr << endl;   }   template <typename Head, typename... Tail>   void debug_out(vector<string> args, long long idx, long long LINE_NUM, Head H,                  Tail... T) {     if (idx > 0)       cerr <<  ,  ;     else       cerr <<  Line(  << LINE_NUM <<  )  ;     stringstream ss;     ss << H;     cerr << args[idx] <<   =   << ss.str();     debug_out(args, idx + 1, LINE_NUM, T...);   }   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     long long t;     cin >> t;     while (t--) {       long long n, k;       cin >> n >> k;       string s;       cin >> s;       long long cnt = 0;       for (long long i = (0); i < (s.size()); ++i) {         if (s[i] ==  ( ) cnt++;       }       string s1;       for (long long i = (0); i < (k - 1); ++i) {         s1 +=  ( ;         s1 +=  ) ;       }       for (long long i = (k - 1); i < (cnt); ++i) s1 +=  ( ;       for (long long i = (k - 1); i < (cnt); ++i) s1 +=  ) ;       vector<pair<long long, long long> > v;       for (long long i = (0); i < (s.size()); ++i) {         if (s[i] == s1[i])           continue;         else {           for (long long j = (i + 1); j < (s.size()); ++j) {             if (s[j] == s1[i]) {               reverse(s.begin() + i, s.begin() + j + 1);               v.push_back({i + 1, j + 1});               break;             }           }         }       }       cout << v.size() <<   n ;       for (long long i = (0); i < (v.size()); ++i) {         cout << v[i].first <<    ;         cout << v[i].second <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   class big_integer {    public:     big_integer(int32_t v) {       if (v >= base) {         data_.push_back(v % base);         data_.push_back(v / base);       } else {         data_.push_back(v);       }     }     void inc() {       int32_t carry = 1;       size_t ptr = 0;       while (carry != 0 && ptr < data_.size()) {         data_[ptr] += 1;         if (data_[ptr] == base) {           data_[ptr] -= base;         } else {           carry = 0;         }         ptr += 1;       }       if (carry != 0) {         data_.push_back(carry);       }     }     void mult2() {       int32_t carry = 0;       for (size_t i = 0; i < data_.size(); ++i) {         data_[i] = data_[i] * 2 + carry;         if (data_[i] >= base) {           data_[i] -= base;           carry = 1;         } else {           carry = 0;         }       }       if (carry != 0) {         data_.push_back(carry);       }     }     void print(std::ostream& os) const {       os << data_.back();       for (size_t i = data_.size() - 2; i < data_.size(); --i) {         os << std::setw(9) << std::setfill( 0 ) << data_[i];       }     }       private:     std::vector<int32_t> data_;     static const int32_t base = 1000000000;     big_integer() {}   };   struct operation {     std::string op;     int32_t x;   };   std::istream& operator>>(std::istream& is, operation& o) {     return is >> o.op >> o.x;   }   int main() {     std::ios::sync_with_stdio(false);     std::cin.tie(nullptr);     size_t n;     std::cin >> n;     std::vector<operation> ops(n);     std::vector<size_t> poss(2001, n);     for (size_t i = 0; i < n; ++i) {       std::cin >> ops[i];       if (ops[i].op ==  sell ) {         poss[ops[i].x] = i;       }     }     std::vector<int32_t> used(n);     big_integer result(0);     for (int32_t i = 2000; i >= 0; --i) {       result.mult2();       if (poss[i] == n) {         continue;       }       size_t pos = poss[i];       while (pos < n) {         if (used[pos] || (ops[pos].op ==  win  && ops[pos].x == i)) {           break;         }         pos -= 1;       }       if (pos < n && !used[pos]) {         for (size_t j = pos; j <= poss[i]; ++j) {           used[j] = 1;         }         result.inc();       }     }     result.print(std::cout);     std::cout <<   n ;   }
#include <bits/stdc++.h>   int main() {     signed int n, i, j;     scanf( %d , &n);     signed int arr[n][3];     for (i = 0; i < n; i++) {       scanf( %d %d %d , &arr[i][0], &arr[i][1], &arr[i][2]);     }     for (i = 0; i < n; i++) {       int u;       u = arr[i][1] < arr[i][2] ? arr[i][1] : arr[i][2];       int tot;       tot = arr[i][0] - u + 1;       printf( %d n , tot);     }   }
#include <bits/stdc++.h>   using namespace std;   int n;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n;     char ch;     int FL = 0, LL = 0, FR = 0, LR = 0, CL = 0, CR = 0;     for (int i = 1; i <= n; i++) {       cin >> ch;       if (ch !=  . ) {         if (ch ==  L ) {           CL++;           if (FL == 0) {             FL = i;           }           LL = i;         } else {           CR++;           if (FR == 0) {             FR = i;           }           LR = i;         }       }     }     if (CR == 0) {       cout << LL <<     << FL - 1;     } else if (CL == 0) {       cout << FR <<     << LR + 1;     } else {       cout << FR <<     << LR;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mxn = 2e5 + 5;   void solve() {     long long n, k;     cin >> n >> k;     long long arr[n];     for (long long int i = 0; i < n; i++) cin >> arr[i];     long long a;     cin >> a;     long long c[n];     for (long long int i = 0; i < n; i++) cin >> c[i];     long long ans = 0, f = 0;     priority_queue<long long, vector<long long>, greater<long long> > pq;     for (long long int i = 0; i < n; i++) {       if (arr[i] <= k) {         pq.push(c[i]);       } else if (arr[i] > k) {         pq.push(c[i]);         long long gap = arr[i] - k;         gap = ceil(gap * 1.0 / a);         if (pq.size() >= gap) {           while (gap--) {             ans += pq.top();             pq.pop();             k += a;           }         } else {           f = 1;           break;         }       }     }     if (f)       cout << -1 <<   n ;     else       cout << ans <<   n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long t = 1;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using namespace std::chrono;   const long long M = 1e9 + 7;   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;   }   bool isPerfectSquare(long long n) {     long long sr = sqrt(n);     if (sr * sr == n)       return true;     else       return false;   }   long long mod(long long x) { return ((x % M + M) % M); }   long long add(long long a, long long b) { return mod(mod(a) + mod(b)); }   long long mul(long long a, long long b) { return mod(mod(a) * mod(b)); }   long long powerM(long long a, long long b) {     long long res = 1;     while (b) {       if (b % 2 == 1) {         res = mul(a, res);       }       a = mul(a, a);       b /= 2;     }     return res;   }   long long modInverse(long long n) { return powerM(n, M - 2); }   long long nCrM(long long n, long long r) {     if (n < r) return 0;     if (r == 0) return 1;     vector<long long> fact(n + 1);     fact[0] = 1;     for (long long i = 1; i <= n; i++) {       fact[i] = mul(fact[i - 1], i);     }     return mul(mul(fact[n], modInverse(fact[r])), modInverse(fact[n - r]));   }   void solve() {     string s, t;     cin >> s >> t;     map<char, long long> m1;     map<char, long long> m2;     long long y = 0;     long long w = 0;     for (long long i = 0; i < s.length(); i++) {       m1[s[i]]++;     }     for (long long i = 0; i < t.length(); i++) {       m2[t[i]]++;     }     for (auto it = m1.begin(); it != m1.end(); it++) {       char c = it->first;       if (m1[c] <= m2[c]) {         y += m1[c];         m2[c] -= m1[c];         m1[c] = 0;       } else if (m1[c] > m2[c]) {         y += m2[c];         m1[c] -= m2[c];         m2[c] = 0;       }     }     for (auto it = m1.begin(); it != m1.end(); it++) {       char c = it->first;       if (m1[c] > 0) {         if (islower(c)) {           char d = toupper(c);           if (m2[d] != 0) w += min(m1[c], m2[d]);         } else {           char d = tolower(c);           if (m2[d] != 0) w += min(m1[c], m2[d]);         }       }     }     cout << y <<     << w <<   n ;   }   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-6;   const double pi = acos(-1);   const long long inf = 0x3f3f3f3f3f3f3f3f;   const int INF = 0x3f3f3f3f;   const int MAX = 2e5 + 10;   const long long mod = 1e9 + 7;   int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }   int main() {     int n;     cin >> n;     int sum1 = 0, sum2 = 0, sum = 0;     for (int i = 1; i <= n; i++) {       char c;       cin >> c;       if (c ==  - )         sum1++;       else         sum2++;       if (sum1 > sum2) {         sum1 = 0;         sum2 = 0;         sum = 0;       } else         sum = sum2 - sum1;     }     cout << sum;   }
#include <bits/stdc++.h>   using namespace std;   int l[200010], r[200010];   int main() {     string s, t;     cin >> s >> t;     int n = s.size(), k = t.size();     if (s[0] == t[0]) l[0] = 1;     if (s[n - 1] == t[k - 1]) r[n - 1] = 1;     for (int i = 1; i < n; i++) {       if (l[i - 1] < k && s[i] == t[l[i - 1]])         l[i] = l[i - 1] + 1;       else         l[i] = l[i - 1];       if (r[n - i] < k && s[n - i - 1] == t[k - r[n - i] - 1])         r[n - i - 1] = r[n - i] + 1;       else         r[n - i - 1] = r[n - i];     }     int res = 0;     for (int i = 0; i < n; i++) {       if (l[i] == k) {         res = max(res, n - i - 1);       }       if (r[i] == k) {         res = max(res, i);       }     }     int li = 0, ri = 0;     while (li < n) {       while (ri < n && r[ri] + l[li] >= k) ri++;       ri--;       res = max(ri - li - 1, res);       li++;     }     cout << res << endl;   }
#include <bits/stdc++.h>   using namespace std;   template <class c>   struct rge {     c b, e;   };   template <class c>   rge<c> range(c i, c j) {     return rge<c>{i, j};   }   template <class c>   auto dud(c* x) -> decltype(cerr << *x, 0);   template <class c>   char dud(...);   struct debug {     template <class c>     debug& operator<<(const c&) {       return *this;     }   };   long long power(long long x, long long y, long long M) {     long long res = 1;     while (y > 0) {       if (y & 1) res = (res * x) % M;       y >>= 1;       x = (x * x) % M;     }     return res % M;   }   long long power(long long x, long long y) {     long long res = 1;     while (y > 0) {       if (y & 1) res = (res * x);       y >>= 1;       x = (x * x);     }     return res;   }   const long long mxn = 1e6 + 6, mod = 1e9 + 7, inf = 1e18;   long long t, casee = 1;   void test_case() {     long long n;     cin >> n;     vector<long long> a(n);     for (long long i = 0; i < n; i++) cin >> a[i];     vector<vector<long long>> possiblesubsetxor(8500, vector<long long>());     for (long long i = 0; i < 8500; i++) possiblesubsetxor[i].push_back(0);     vector<long long> pos(8500, 0);     vector<long long> help(8500, 8500);     pos[0] = 1;     help[0] = 0;     for (long long i = 0; i < n; i++) {       for (long long currxor : possiblesubsetxor[a[i]]) {         long long newxor = currxor ^ a[i];         pos[newxor] = 1;         if (a[i] < help[newxor]) {           for (long long k = a[i] + 1; k < help[newxor]; k++) {             possiblesubsetxor[k].push_back(newxor);           }           help[newxor] = a[i];         }       }       possiblesubsetxor[a[i]].clear();     }     long long cnt = 0;     for (long long i = 0; i < 8500; i++) cnt += pos[i];     cout << cnt <<   n ;     for (long long i = 0; i < 8500; i++) {       if (pos[i]) cout << i <<    ;     }   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     t = 1;     while (t--) {       test_case();       casee++;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int gcf(int A, int B) {     if (A < B)       return gcf(B, A);     else if (B == 0)       return A;     else       return gcf(B, A % B);   }   int main() {     int n, m;     cin >> m >> n;     bool A[m], B[n];     memset(A, 0, sizeof(A));     memset(B, 0, sizeof(B));     int x, y;     cin >> x;     for (int i = 0; i < x; i++) {       int temp;       cin >> temp;       A[temp] = 1;     }     cin >> y;     for (int i = 0; i < y; i++) {       int temp;       cin >> temp;       B[temp] = 1;     }     for (int i = 0; i < 5000000; i++) {       if (A[i % m] || B[i % n]) A[i % m] = B[i % n] = 1;     }     for (int i = 0; i < m; i++) {       if (!A[i]) {         cout <<  No ;         return 0;       }     }     for (int i = 0; i < n; i++) {       if (!B[i]) {         cout <<  No ;         return 0;       }     }     cout <<  Yes ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long m;   long long a[100005], b[100005], c[100005], ans[100005];   bool prime[100005];   vector<long long> pvec;   long long modpow(long long a, long long n) {     if (n == 0) return 1;     if (n % 2) {       return ((a % 998244353) * (modpow(a, n - 1) % 998244353)) % 998244353;     } else {       return modpow((a * a) % 998244353, n / 2) % 998244353;     }   }   int main(void) {     ios::sync_with_stdio(0);     cin.tie(0);     for (int i = 2; i < 1005; i++) {       if (prime[i]) continue;       for (int j = 2 * i; j < 100005; j += i) prime[j] = true;     }     for (int i = 2; i < 100005; i++) {       if (!prime[i]) pvec.push_back(i);     }     cin >> m;     long long x, y;     for (int i = 1; i <= m; i++) {       cin >> x >> y;       a[x] += y;       b[x] += x * y % 998244353, b[x] %= 998244353;       c[x] += x * x % 998244353 * y % 998244353, c[x] %= 998244353;     }     for (int i = 0; i < pvec.size(); i++) {       long long p = pvec[i];       for (int j = 100004 / p; j >= 1; j--) {         a[j] += a[j * p];         b[j] += b[j * p], b[j] %= 998244353;         c[j] += c[j * p], c[j] %= 998244353;       }     }     for (int i = 1; i <= 100000; i++) {       long long sum = 0, mul, mul2;       if (a[i] >= 2) {         mul = c[i],         mul2 = (a[i] - 1) % 998244353 * modpow(2, a[i] - 2) % 998244353;         sum += mul * mul2 % 998244353, sum %= 998244353;       }       if (a[i] >= 3) {         mul = b[i] * b[i] % 998244353 + 998244353 - c[i], mul %= 998244353;         mul2 = (a[i] - 2) % 998244353 * modpow(2, a[i] - 3) % 998244353;         sum += mul * mul2 % 998244353, sum %= 998244353;       }       if (a[i] >= 2) {         mul = b[i] * b[i] % 998244353 + 998244353 - c[i], mul %= 998244353;         mul2 = modpow(2, a[i] - 2);         sum += mul * mul2 % 998244353, sum %= 998244353;       }       ans[i] = sum;     }     for (int i = 0; i < pvec.size(); i++) {       long long p = pvec[i];       for (int j = 1; j <= 100004 / p; j++) {         ans[j] += 998244353 - ans[j * p], ans[j] %= 998244353;       }     }     cout << ans[1] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   int mini, c;   const int MAXN = 2e3 + 3;   long long dp[2][MAXN][MAXN];   long long go(int lft, int cur, bool f) {     if (lft == 0 and !f) return 1;     if (dp[f][lft][cur] != -1) return dp[f][lft][cur];     long long ret = 0;     if (f) {       if (mini >= 0 and lft >= c + cur) ret += go(lft, cur + c, false);       if (ret >= MOD) ret -= MOD;       if (mini < 0 and abs(mini) <= cur and lft >= c + cur)         ret += go(lft, cur + c, false);       if (ret >= MOD) ret -= MOD;       if (lft) ret += go(lft - 1, cur + 1, f);       if (ret >= MOD) ret -= MOD;       if (cur != 0 and lft) ret += go(lft - 1, cur - 1, f);       if (ret >= MOD) ret -= MOD;     } else {       if (cur != 0 and lft) ret += go(lft - 1, cur - 1, f);       if (ret >= MOD) ret -= MOD;       if (lft - 1 >= cur + 1 and lft) ret += go(lft - 1, cur + 1, f);       if (ret >= MOD) ret -= MOD;     }     return dp[f][lft][cur] = ret;   }   int main() {     int n, m;     cin >> n >> m;     string str;     cin >> str;     mini = 1e9;     c = 0;     for (int i = 0; i < ((int)str.size()); i++) {       if (str[i] ==  ( )         ++c;       else         --c;       mini = min(mini, c);     }     memset(dp, -1, sizeof(dp));     cout << go(n - m, 0, true) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int l, r, a;     cin >> l >> r >> a;     int mini = min(l, r);     int maxi = max(l, r);     int diff = maxi - mini;     mini += (diff <= a) ? diff : a;     a -= (diff <= a) ? diff : a;     if (a & 1) a--;     cout << 2 * min(mini, maxi) + a;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long int n;     cin >> n;     vector<long long int> vec(n);     for (long long int i = 0; i < n; i++) {       cin >> vec[i];     }     long long int left = 0, right = 1e10;     long long int ans = 0;     while (left <= right) {       long long int mid = (left + right) / 2;       bool cool = 1;       vector<long long int> dummy = vec;       for (long long int i = n - 1; i >= 2; i--) {         long long int x = dummy[i];         long long int y = dummy[i - 1];         long long int z = dummy[i - 2];         if (dummy[i] < mid) {           cool = 0;           break;         }         long long int extra = dummy[i] - mid;         extra = min(extra, vec[i]);         dummy[i] = mid;         long long int remain = extra % 3;         long long int v = extra / 3;         dummy[i - 1] += v;         dummy[i - 2] += 2 * v;         remain = extra - 3 * v;       }       long long int val = *min_element(dummy.begin(), dummy.end());       if (val < mid) {         right = mid - 1;       } else {         left = mid + 1;         ans = mid;       }     }     cout << ans;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     long long int T = 1;     cin >> T;     for (int t = 1; t <= T; t++) {       solve();       cout <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string smallest(string s) {     if (s.length() % 2 == 1) return s;     string s1 = smallest(s.substr(0, s.length() / 2));     string s2 = smallest(s.substr(s.length() / 2));     if (s1 < s2)       return s1 + s2;     else       return s2 + s1;   }   bool solve(string s1, string s2) {     for (int i = 0; i < s1.length(); i++)       if (s1[i] != s2[i]) return 0;     return 1;   }   int main() {     string s1, s2;     cin >> s1 >> s2;     s1 = smallest(s1);     s2 = smallest(s2);     if (solve(s1, s2))       cout <<  YES n ;     else       cout <<  NO n ;   }