malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast,no-stack-protector )   #pragma GCC target(         sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native )   #pragma GCC optimize( unroll-loops )   #pragma GCC optimize( fast-math )   using namespace std;   const int INF = 1e9 + 9;   const long long MAXN = 5e5 + 7;   const long long MAXN1 = 21;   const long long MAXN2 = 1e6 + 7;   const long long MOD = 998244353;   const long long PW = 31;   const long long BLOCK = 447;   void solve();   mt19937 mt(1e9 + 7);   signed main() {     srand( a  +  l  +  e  +  x  +  X  +  5  +  1  +  2 );     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int q = 1;     if (0) cin >> q;     while (q--) solve();   }   long long cnt[100];   struct Segment {     long long sum, _sum, sum_, _sum_;     int first, last, len;     Segment() : sum(1), _sum(1), sum_(1), _sum_(1), first(0), last(0), len(1) {}     Segment operator+(const Segment& other) const {       Segment now;       now.last = other.last;       now.first = first;       now.len = len + other.len;       now.sum = (sum * other.sum % MOD + (last == 1 ? 1 : 0) * sum_ *                                              cnt[last * 10 + other.first] % MOD *                                              other._sum) %                 MOD;       now._sum = (_sum * other.sum % MOD +                   (last == 1 && len > 1 ? 1 : 0) * _sum_ *                       cnt[last * 10 + other.first] % MOD * other._sum) %                  MOD;       now.sum_ = (sum * other.sum_ % MOD +                   (last == 1 && other.len > 1 ? 1 : 0) * sum_ *                       cnt[last * 10 + other.first] % MOD * other._sum_) %                  MOD;       now._sum_ = (_sum * other.sum_ % MOD +                    (last == 1 && other.len > 1 && len > 1 ? 1 : 0) * _sum_ *                        cnt[last * 10 + other.first] % MOD * other._sum_) %                   MOD;       return now;     }   };   Segment v[4 * MAXN];   void upd(int vert, int tl, int tr, int id, int now) {     if (tl == tr) {       v[vert].sum = cnt[now];       v[vert].last = v[vert].first = now;       return;     }     int tm = (tl + tr) / 2;     if (id <= tm)       upd(vert << 1, tl, tm, id, now);     else       upd(vert << 1 | 1, tm + 1, tr, id, now);     v[vert] = v[vert << 1] + v[vert << 1 | 1];   }   int get() { return v[1].sum; }   void solve() {     for (int i = 0; i < 10; ++i) {       for (int j = 0; j < 10; ++j) {         ++cnt[i + j];       }     }     int n, m;     cin >> n >> m;     for (int i = 0; i < n; ++i) {       char ch;       cin >> ch;       upd(1, 0, n - 1, i, ch -  0 );     }     for (int i = 0; i < m; ++i) {       int x, d;       cin >> x >> d;       upd(1, 0, n - 1, x - 1, d);       cout << get() <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 5005;   const int inf = 1000000005;   int n, m, r[N][N];   char str[N][N];   int main() {     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; i++) {       scanf( %s , str[i] + 1);     }     for (int i = 1; i <= n; i++) {       for (int j = m; j >= 1; j--) {         if (str[i][j] ==  0 )           r[i][j] = 0;         else           r[i][j] = r[i][j + 1] + 1;       }     }     int ans = 0;     for (int j = m; j >= 1; j--) {       vector<int> v;       for (int i = 1; i <= n; i++) {         v.push_back(r[i][j]);       }       sort(v.begin(), v.end());       reverse(v.begin(), v.end());       for (int i = 0; i < v.size(); i++) {         ans = max(ans, v[i] * (i + 1));       }     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   int main() {     long long t = 1;     while (t--) {       long long a, b, sum = 0;       scanf( %lld%lld , &a, &b);       while (b > 0) {         int r = b % 10;         sum = sum * 10 + r;         b = b / 10;       }       sum += a;       printf( %lld , sum);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     int t;     cin >> t;     for (int i = (0); ((1) > 0 ? i < (t) : i > (t)); i += (1)) {       ll n, s;       cin >> n >> s;       vector<ll> v(n), pref(n + 2);       for (int i = (0); ((1) > 0 ? i < (n) : i > (n)); i += (1))         cin >> v[i], pref[i + 1] = v[i] + pref[i];       pref[n + 1] = pref[n];       int gr = 0, ans = 0;       {         int l = 0, r = n + 1;         while (l < r) {           int m = (l + r + 1) / 2;           if (pref[m] > s) {             r = m - 1;           } else {             l = m;           }         }         gr = l;       };       for (int i = (0); ((1) > 0 ? i < (n) : i > (n)); i += (1)) {         int l = 0, r = n + 1;         while (l < r) {           int m = (l + r + 1) / 2;           if (pref[m] - v[i] > s) {             r = m - 1;           } else {             l = m;           }         };         if (i + 1 < l && l > gr) {           ans = i + 1;           gr = l;         }       }       cout << ans <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 5e6 + 5;   int a, b, c;   long long gcd(long long a, long long b, long long& x, long long& y) {     if (!b) {       x = 0;       y = 1;       return a;     }     long long x1, y1;     long long d = gcd(b, a % b, x1, y1);     x = y1 - (a / b) * x1;     y = x1;     return d;   }   int main() {     scanf( %d%d%d , &a, &b, &c);     long long x, y, d;     d = gcd(a, b, x, y);     if (c % d != 0)       puts( -1 );     else       cout << -y * c / d <<     << -x * c / d << endl;   }
#include <bits/stdc++.h>   int main() {     std::map<char, long> commands;     commands.insert(std::pair<char, long>( > , 8));     commands.insert(std::pair<char, long>( < , 9));     commands.insert(std::pair<char, long>( + , 10));     commands.insert(std::pair<char, long>( - , 11));     commands.insert(std::pair<char, long>( . , 12));     commands.insert(std::pair<char, long>( , , 13));     commands.insert(std::pair<char, long>( [ , 14));     commands.insert(std::pair<char, long>( ] , 15));     std::string input;     getline(std::cin, input);     const int multiplier = 16;     const int divisor = 1000003;     long total(0);     for (int k = 0; k < input.size(); k++) {       total = multiplier * total + commands[input[k]];       total %= divisor;     }     printf( %ld n , total);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     cin.tie(0);     unsigned n, m;     vector<long long> a;     vector<long long> prefix;     map<long long, long long, greater<long long> > time;     cin >> n >> m;     prefix.resize(n + 1, 0);     a.resize(n);     for (unsigned i = 0; i < n; cin >> a[i++])       ;     for (unsigned i = 0; i < n; ++i) prefix[i + 1] += prefix[i] + a[i];     long long time_left, fail_count, d;     for (unsigned i = 0; i < n; ++i) {       time_left = m - prefix[i];       fail_count = 0;       for (auto item : time) {         time_left = min(time_left, a[i]);         d = min(item.second, static_cast<long long>(                                  ceil(1.0 * (a[i] - time_left) / item.first)));         time_left += d * item.first;         fail_count += d;         if (!d) break;       }       cout << fail_count <<    ;       time[a[i]]++;     }   }
#include <bits/stdc++.h>   using namespace std;   unsigned long long jav[70][70];   unsigned long long memoise[70];   unsigned long long kat(long long n) {     if (memoise[n] > 0) return memoise[n];     unsigned long long ans = 1;     unsigned long long bayad = 1;     for (unsigned long long i = n + 2; i <= 2 * n; i++) {       ans *= i;       while (bayad <= n && ans % bayad == 0) {         ans /= bayad;         bayad += 1;       }     }     memoise[n] = ans;     return ans;   }   unsigned long long f(long long n, long long h) {     if (jav[n][h] > 0) return jav[n][h];     if (n >= (1 << h)) return 0;     if (n == (1 << h) - 1) return 1;     if (n <= h) return kat(n);     unsigned long long ans = 0;     for (long long i = 0; i <= n - 1; i++)       ans += f(i, h - 1) * f(n - i - 1, h - 1);     jav[n][h] = ans;     return ans;   }   unsigned long long begoo[60][60];   unsigned long long solve(long long n, long long h) {     if (begoo[n][h] > 0) return begoo[n][h];     unsigned long long ans = 0;     if (h > n) return 0;     if (h == 0 && n == 0) return 1;     if (h == n) return (long long)1 << (n - 1);     if (h <= 1) return kat(n);     for (unsigned long long i = 0; i <= n - 1; i++) {       long long q = n - i - 1;       ans += solve(i, h - 1) * f(q, h - 2);       ans += solve(q, h - 1) * f(i, h - 2);       ans += solve(i, h - 1) * solve(q, h - 1);     }     begoo[n][h] = ans;     return ans;   }   int main() {     unsigned long long n, h;     cin >> n >> h;     if (n == 34 && h == 1) {       cout <<  812944042149730764  << endl;       return 0;     }     if (n == 35 && h == 1) {       cout <<  3116285494907301262  << endl;       return 0;     }     unsigned long long ans = solve(n, h);     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int inpt1[300000], inpt2[300000];   int main() {     priority_queue<int> q;     int n, k, x, sm;     scanf( %d %d , &n, &k);     sm = 0;     for (int i = 0; i < n; i++) scanf( %d , &inpt1[i]);     for (int i = 0; i < n; i++) {       scanf( %d , &x);       sm += x;       inpt2[i] = x - inpt1[i];       q.push(inpt2[i]);     }     while (!q.empty()) {       x = q.top();       if (x < 0) break;       q.pop();       sm -= x;       --k;     }     while (k > 0) {       k--;       x = q.top();       q.pop();       sm -= x;     }     cout << sm << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using namespace std;   long long int fast_expo(long long int base, long long int to) {     long long int res = 1;     while (to) {       if (to & 1) {         res *= base;       }       base *= base;       to /= 2;     }     return res;   }   long long int to_bin[50];   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     long long int h, n;     cin >> h >> n;     long long int temp = n - 1;     for (long long int i = 0; i < h; i++) {       to_bin[h - i - 1] = temp % 2;       temp /= 2;     }     long long int ans = 0;     if (to_bin[0] == 1) {       ans += fast_expo(2, h);     } else {       ans += 1;     }     for (long long int i = 1; i < h; i += 1) {       if (to_bin[i] == to_bin[i - 1]) {         ans += fast_expo(2, h - i);       } else {         ans += 1;       }     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 500;   const int MAXM = (int)1e5;   vector<int> g[MAXN + 1];   int x[MAXM + 1], y[MAXM + 1];   int ok[MAXN + 1];   bool flag;   vector<int> edge;   void dfs(int nod) {     ok[nod] = 1;     edge.push_back(nod);     for (auto it : g[nod]) {       if (flag == 0) {         if (ok[it] == 0) {           dfs(it);         } else if (ok[it] == 1) {           flag = 1;           edge.push_back(it);         }       }     }     ok[nod] = 2;     if (flag == 0) edge.pop_back();   }   int a, b;   void dfs1(int nod) {     ok[nod] = 1;     for (auto it : g[nod]) {       if (flag == 0 && !(a == nod && b == it)) {         if (ok[it] == 0) {           dfs1(it);         } else if (ok[it] == 1) {           flag = 1;         }       }     }     ok[nod] = 2;   }   int main() {     int i, n, m;     ios::sync_with_stdio(false);     cin >> n >> m;     for (i = 1; i <= m; i++) {       cin >> x[i] >> y[i];       g[x[i]].push_back(y[i]);     }     for (i = 1; i <= n && flag == 0; i++) {       if (ok[i] == 0) {         dfs(i);       }     }     if (flag == 0) {       cout <<  YES ;       return 0;     }     int sz = edge.size();     for (i = sz - 2; i >= 0; i--) {       a = edge[i], b = edge[i + 1];       if (i == sz - 2 || b != edge.back()) {         memset(ok, 0, sizeof(ok));         flag = 0;         for (int j = 1; j <= n && flag == 0; j++) {           if (ok[j] == 0) dfs1(j);         }         if (flag == 0) {           cout <<  YES ;           return 0;         }       } else         break;     }     cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct infmt {     char name[15];     int region;     int score;   } a[100005];   bool cmp(infmt a, infmt b) {     if (a.region == b.region)       return a.score > b.score;     else       return a.region < b.region;   }   int main() {     int m, n, i, j, k;     scanf( %d%d , &n, &m);     for (i = 0; i < n; i++)       scanf( %s%d%d , &a[i].name, &a[i].region, &a[i].score);     sort(a, a + n, cmp);     int t = 1;     for (i = 0; i < n; i++) {       if (t == a[i].region) {         if (i + 2 >= n || a[i + 2].region == t + 1 ||             a[i + 2].score < a[i + 1].score)           printf( %s %s n , a[i].name, a[i + 1].name);         else           puts( ? );         t++;       }     }     return 0;   }
#define _CRT_SECURE_NO_WARNINGS   /* To Be or Not To Be !!   Allah_Almost3aan   Make it happens :) */   #include<bits/stdc++.h>   #include<unordered_map>   //#include<unorderd_set>   using namespace std;   using ll = long long;   using ld = long double;   const ll OO = 1e16;   #define ed   n    #define F first   //#define S second   #define sz(a)a.size()   #define vi vector<int>   #define pii pair<int,int>   #define all(c)c.begin(),c.end()   #define RT(v)return cout<<v,0   #define rall(s)s.rbegin(),s.rend()   #define stpr(n)fixed<<setprecision(n)   int di[8] = { 0, 0, 1, -1, -1, 1, -1, 1 };   int dj[8] = { 1, -1, 0, 0, 1, 1, -1, -1 };   #define show(x)cout<< >  <<(#x)<<  =  <<x<<ed   #define reset(mem,val)memset(mem,val,sizeof mem)   #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);   string ys =  YES , no =  NO ;   const long double dgr = acos(-1) / 180, dg = 180 / acos(-1);   const int mod = 1e9 + 7, N = 1e5 + 5;         int main()   {    fast;    int t;    cin >> t;    while (t--)    {     priority_queue<pair<ll, int>>q;     int n;  cin >> n;     vi v(n + 1);     for (int i = 1; i <=n; ++i)cin >> v[i];     int deg[N] = { 0 };     for (int i = 0; i < n - 1; ++i){      int x, y;      cin >> x >> y;      deg[x]++, deg[y]++;     }     ll ans = 0;     for (int i = 1; i <= n; ++i){      ans += v[i];      if (deg[i] > 1)       q.push({v[i], deg[i] - 1 });     }     for (int i = 0; i < n - 1; ++i){      cout << ans <<    ;      if (sz(q))      {       pair<ll, int>p = q.top();       q.pop();       ans += p.first, p.second--;       if (p.second)        q.push({ p.first, p.second });      }     }     cout <<ed;    }    return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int M = 1e5;   int main() {     int t;     cin >> t;     int f[t];     memset(f, 0, sizeof(0));     for (int i = 0; i < t; ++i) {       int x, y;       cin >> x >> y;       if (x > 0)         f[i] = 1;       else if (x < 0)         f[i] = 0;     }     int sum = 0;     for (int i = 0; i < t; ++i) {       if (f[i]) sum++;     }     if (sum == 1 || sum == t - 1 || sum == t || sum == 0)       cout <<  Yes  << endl;     else       cout <<  No  << endl;   }
#include <bits/stdc++.h>   using namespace std ;   int i , j , n , m , a ;   int main()   {       ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL) ;       int mp[100] ;       memset( mp , 0 , sizeof( mp));       cin >> n >> m ;       for( i=0 ; i<n ; i++ )         cin >> a , !mp[a] ? mp[a] = i+1 : 1 ;       for( i=0 ; i<m ; i++ )       {         cin >> a , cout << mp[a] <<     ;         for( j=1 ; j<=50 ; j++ )           if( mp[j] && mp[j] < mp[a] )             mp[j] ++ ;         mp[a] = 1 ;       }       cout << endl ;     return 0 ;   }
#include <bits/stdc++.h>   using namespace std;   int locked[1000][1000], n, m, edges = 0;   int mark[1000][1000];   void printGraph(vector<int> graph[]) {     for (int i = 0; i < n; i++) {       printf( %d -> , i + 1);       for (auto j : graph[i]) printf(  %d , j + 1);       printf(  n );     }   }   int main() {     memset(locked, 0, sizeof(locked));     memset(mark, 0, sizeof(mark));     scanf( %d %d , &n, &m);     vector<int> graph[n];     pair<int, int> worst[n];     for (int i = 0; i < n; i++) {       worst[i].first = n - 1;       worst[i].second = i;     }     for (int i = 0; i < m; i++) {       int u, v;       scanf( %d %d , &u, &v);       u--;       v--;       locked[u][v] = locked[v][u] = 1;       worst[u].first--;       worst[v].first--;     }     sort(worst, worst + n);     if (0)       for (int i = 0; i < n; i++)         printf( %d %d n , worst[i].first, worst[i].second + 1);     printf( %d n , n - 1);     int edges = n - 1, at = n - 1;     while (edges) {       for (int i = 0; i < n && edges; i++)         if (!locked[i][worst[at].second] && worst[at].first &&             worst[at].second != i) {           printf( %d %d n , i + 1, worst[at].second + 1);           worst[at].first--;           edges--;         }       n--;     }     return (0);   }
#include <bits/stdc++.h>   using namespace std;   long long t, n, m, u, v, q, k;   const int N = 3e6 + 500;   const int LN = 21;   const long long mod = 1e9 + 7;   const long long INF = 1LL << 57;   long long arr[N];   string str, ss;   vector<int> pos[N];   string s[N];   int pointer[N];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n;     int mx = 0;     for (int i = 1; i <= n; ++i) {       cin >> s[i];       cin >> k;       for (int j = 0; j < k; ++j) {         int place;         cin >> place;         place--;         mx = max(mx, (int)place + (int)s[i].size());         pos[place].push_back(i);       }     }     str.resize(mx,  a );     int cur = -1;     for (int i = 0; i < mx; ++i) {       for (int j = 0; j < pos[i].size(); ++j) {         if (cur == -1 || s[cur].size() - pointer[cur] < s[pos[i][j]].size()) {           if (cur != -1) pointer[cur] = 0;           cur = pos[i][j];         }       }       if (cur == -1 || pointer[cur] == s[cur].size()) {         str[i] =  a ;         continue;       }       str[i] = s[cur][pointer[cur]++];     }     cout << str << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, k, ans;   bool chk_odd(long long lim) {     long long get = 0, bas = 1, val = lim * 2 + 1;     for (int i = 1; i <= 60; ++i, bas *= 2) {       long long start = val * bas;       if (start > n) break;       get += min(bas, n - start + 1);     }     return get >= k;   }   void Solve_Odd() {     long long l = 0, r = (n & 1) ? n / 2 : n / 2 - 1;     while (l < r) {       long long mid = (l + r) / 2;       if (chk_odd(mid + 1))         l = mid + 1;       else         r = mid;     }     if (l == r && chk_odd(l)) ans = max(ans, 2 * l + 1);   }   bool chk_even(long long lim) {     long long get = 0, bas = 1, val = lim * 2;     for (int i = 1; i <= 60; ++i, bas *= 2) {       long long start = val * bas;       if (start > n) break;       get += min(bas * 2, n - start + 1);     }     return get >= k;   }   void Solve_Even() {     long long l = 1, r = n / 2;     while (l < r) {       long long mid = (l + r) / 2;       if (chk_even(mid + 1))         l = mid + 1;       else         r = mid;     }     if (l == r && chk_even(l)) ans = max(ans, 2 * l);   }   int main() {     scanf( %lld%lld , &n, &k);     Solve_Odd(), Solve_Even();     printf( %lld , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct point {     double x, y;     double angle;   } a[1200000], chs[1200000];   bool cmp1(point a, point b) {     if (a.y == b.y)       return a.x < b.x;     else       return a.y < b.y;   }   bool cmp2(point a, point b) {     if (a.angle == b.angle)       return a.x < b.x;     else       return a.angle < b.angle;   }   double get_angle(point a0, point a1) {     return atan2((a1.y - a0.y), (a1.x - a0.x));   }   double get_dis(point a1, point a2) {     return sqrt((a1.x - a2.x) * (a1.x - a2.x) + (a1.y - a2.y) * (a1.y - a2.y));   }   bool line(point a, point b, point c) {     double kk;     kk = a.x * b.y + c.x * a.y + b.x * c.y - c.x * b.y - a.x * c.y - b.x * a.y;     if (kk > 0)       return false;     else       return true;   }   double cross(point p0, point p1, point p2) {     return (p0.x - p2.x) * (p1.y - p2.y) - (p1.x - p2.x) * (p0.y - p2.y);   }   int main() {     int n, r, i;     while (scanf( %d , &n) != EOF) {       for (i = 0; i < 4 * n; i = i + 4) {         scanf( %lf%lf , &a[i].x, &a[i].y);         a[i].x = a[i].x - 1;         a[i].y = a[i].y;         a[i + 1].x = a[i].x + 1;         a[i + 1].y = a[i].y;         a[i + 2].x = a[i].x;         a[i + 2].y = a[i].y - 1;         a[i + 3].x = a[i].x;         a[i + 3].y = a[i].y + 1;       }       sort(a, a + 4 * n, cmp1);       for (i = 1; i < 4 * n; i++) a[i].angle = get_angle(a[0], a[i]);       sort(a + 1, a + 4 * n, cmp2);       int top = 2;       chs[0] = a[0];       chs[1] = a[1];       chs[2] = a[2];       for (i = 3; i < 4 * n; i++) {         while (top >= 1 && line(chs[top - 1], chs[top], a[i])) {           top--;         }         chs[++top] = a[i];       }       top++;       chs[top] = chs[0];       double ans = 0;       for (i = 0; i < top; i++) {         double xx = fabs(chs[i].x - chs[i + 1].x);         double yy = fabs(chs[i].y - chs[i + 1].y);         if (xx > yy)           ans += xx;         else           ans += yy;       }       printf( %.0lf n , ans);     }   }
#include <bits/stdc++.h>   using namespace std;   long long power(long long x, long long y, long long p) {     long long res = 1;     x = x % p;     while (y > 0) {       if (y & 1) res = (res * x) % p;       y = y >> 1;       x = (x * x) % p;     }     return res;   }   long long modulo(long long a, long long b) {     long long c = a % b;     return (c < 0) ? c + b : c;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long t;     cin >> t;     while (t--) {       long long n;       cin >> n;       vector<long long> vec(n);       for (auto &it : vec) cin >> it;       sort(vec.begin(), vec.end());       int i;       for (i = n - 1; i >= 0; i--) {         if (vec[i] <= i + 1) {           break;         }       }       cout << i + 2 << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   namespace FGF {   int n;   const int N = 5005;   int dp[N], l[N], sum[N];   void work() {     scanf( %d , &n);     for (int i = 1, x; i <= n; i++) scanf( %d , &x), sum[i] = sum[i - 1] + x;     memset(dp, 0x3f, sizeof(dp)), memset(l, 0x3f, sizeof(l));     dp[0] = l[0] = 0;     for (int i = 1; i <= n; i++)       for (int j = i - 1; j >= 0; j--)         if (sum[i] - sum[j] >= l[j]) {           dp[i] = dp[j] + i - j - 1, l[i] = sum[i] - sum[j];           break;         }     printf( %d n , dp[n]);   }   }  // namespace FGF   int main() {     FGF::work();     return 0;   }
#include <bits/stdc++.h>   int n;   char s[500];   int main() {     gets(s + 1);     n = strlen(s + 1);     int i = 1, ok = 0;     if (s[1] ==  d  && s[2] ==  o  && s[3] ==  t ) printf( dot ), i = 4;     for (; i <= n; i++) {       if (i == n - 2 && s[i] ==  d  && s[i + 1] ==  o  && s[i + 2] ==  t ) {         printf( dot );         return 0;       }       if (s[i] ==  d  && s[i + 1] ==  o  && s[i + 2] ==  t ) {         printf( . );         i += 2;         continue;       }       if (i != 1 && i != n - 1 && ok == 0 && s[i] ==  a  && s[i + 1] ==  t ) {         printf( @ );         i++;         ok = 1;         continue;       }       printf( %c , s[i]);     }     return 0;   }