malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int tu(int val) { return (1 << val); }   bool iset(int mask, int id) {     if ((mask & tu(id)) != 0) return true;     return false;   }   void doset(int &mask, int id) { mask |= tu(id); }   void dounset(int &mask, int id) { mask = mask & (~tu(id)); }   template <typename T>   string tos(T a) {     stringstream ss;     string ret;     ss << a;     ss >> ret;     return ret;   }   const long long LM = 1e18;   long long N, K;   vector<long long> pms, PA, push_back, temp;   void proc(vector<long long> &ans, const vector<long long> &now) {     ans.clear();     ans.push_back(1);     int l = now.size();     for (int(x) = (0); (x) < (l); (x)++) {       long double p = now[x];       int la = ans.size();       temp.clear();       for (int(i) = (0); (i) < (la); (i)++) {         long double v = p * ans[i];         while (v <= LM) {           temp.push_back(v);           v *= p;         }       }       la = temp.size();       for (int(i) = (0); (i) < (la); (i)++) ans.push_back(temp[i]);     }     sort(ans.begin(), ans.end());     int la = ans.size();     for (int(i) = (1); (i) < (la); (i)++) assert(ans[i] != ans[i - 1]);   }   long long count(long long val) {     int la = PA.size();     int lb = push_back.size();     int ia = 0;     int ib = lb - 1;     long long ret = 0;     while (ia < la && ib >= 0) {       unsigned long long va = PA[ia] * push_back[ib];       if (va > val)         ib--;       else {         ret += ib + 1;         ia++;       }     }     return ret;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     while (cin >> N) {       vector<long long> pa, pb;       pms.clear();       pms.resize(N);       for (int(i) = (0); (i) < (N); (i)++) cin >> pms[i];       sort(pms.begin(), pms.end());       cin >> K;       for (int(i) = (0); (i) < (N); (i)++) {         if ((i % 2) == 0)           pa.push_back(pms[i]);         else           pb.push_back(pms[i]);       }       proc(PA, pa);       proc(push_back, pb);       long long ans = -1;       long long lo = 1;       long long hi = LM;       while (true) {         if (hi - lo < 5) {           for (long long x = lo; x <= hi; x++) {             long long k = count(x);             if (k == K) {               ans = x;               break;             }           }           break;         }         long long m = (lo + hi) / 2;         long long k = count(m);         if (k >= K)           hi = m;         else           lo = m;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string ans_t =  YES ;   string ans_f =  NO ;   void judge(int n) {     if (n < 6 + 10 + 14 + 1) {       cout << ans_f << endl;     } else {       cout << ans_t << endl;       int tmp = n - 6 - 10 - 14;       if (tmp == 6 || tmp == 10 || tmp == 14) {         cout <<  6 10   << 14 + 1 <<     << tmp - 1 << endl;       } else {         cout <<  6 10 14   << tmp << endl;       }     }   }   int main() {     ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       judge(n);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int HX = 0x3F3F3F3F;   int n, m, p, q;   long long k;   int f[1111];   int main() {     cin >> n >> m >> k;     memset(f, 0x3F, sizeof f);     for (int i = 0; i < (n); ++i) {       cin >> p >> q;       f[p] = min(f[p], q);     }     long long ans = 0;     for (int i = (1); i <= (m); ++i) ans += f[i];     cout << min(ans, k) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2 * 1000 * 100 + 100;   int n, m, w[N], deg[N], ans[N];   vector<pair<int, int>> adj[N];   bool vis[N];   int main() {     ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);     cin >> n >> m;     for (int i = 1; i <= n; i++) cin >> w[i];     for (int i = 1, v, u; i <= m; i++) {       cin >> v >> u;       deg[v]++, deg[u]++;       adj[v].push_back({u, i});       adj[u].push_back({v, i});     }     queue<int> q;     for (int i = 1; i <= n; i++)       if (deg[i] <= w[i]) q.push(i), vis[i] = true;     int ind = m;     while (q.size()) {       int x = q.front();       q.pop();       for (auto u : adj[x]) {         deg[u.first]--, deg[x]--;         if (deg[u.first] <= w[u.first] && !vis[u.first])           vis[u.first] = true, q.push(u.first);         if (!ans[u.second]) ans[u.second] = ind--;       }     }     vector<int> res(m + 10);     for (int i = 1; i <= m; i++) {       if (!ans[i]) return cout <<  DEAD n , 0;       res[ans[i]] = i;     }     cout <<  ALIVE n ;     for (int i = 1; i <= m; i++) cout << res[i] <<    ;     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<vector<int> > adj(601);   vector<int> unvisited, even, odd;   int d[601], parent[601];   bool visited[601];   map<vector<int>, int> M;   void RemoveFromUnvisited(int v) {     int i = 0;     for (; i < unvisited.size() && unvisited[i] != v; ++i)       ;     unvisited.erase(unvisited.begin() + i);   }   void PrintQueryOrAnswer(char c, vector<int> &A) {     printf( %c %lu n , c, A.size());     for (auto x : A) {       printf( %d  , x);     }     printf(  n );     fflush(stdout);   }   int PrintQuery(vector<int> A) {     sort(A.begin(), A.end());     if (M.find(A) != M.end()) {       return M[A];     }     PrintQueryOrAnswer( ? , A);     int m;     scanf( %d , &m);     M[A] = m;     return m;   }   int Query(vector<int> &A, int s = 0) {     if (s) {       A.push_back(s);     }     int m = PrintQuery(A);     if (s) {       A.pop_back();     }     return m;   }   int NextChild(int i, vector<int> A) {     if (A.size() == 0) {       return 0;     }     int m1 = Query(A, i);     if (m1 == 0) {       return 0;     }     if (A.size() == 1) {       return A.back();     }     int m2 = Query(A);     if (m2 == m1) {       return 0;     }     int j = NextChild(i, vector<int>(A.begin(), A.begin() + (A.size() / 2)));     if (j == 0) {       j = NextChild(i, vector<int>(A.begin() + (A.size() / 2), A.end()));     }     return j;   }   void AddEdge(int i, int j) {     adj[i].push_back(j);     adj[j].push_back(i);   }   void AddEdgeDFS(int i, bool markEvenOdd) {     RemoveFromUnvisited(i);     if (markEvenOdd) {       if (d[i]) {         odd.push_back(i);       } else {         even.push_back(i);       }     }     for (int j = NextChild(i, unvisited); j > 0; j = NextChild(i, unvisited)) {       AddEdge(i, j);       if (markEvenOdd) {         d[j] = 1 - d[i];       }       AddEdgeDFS(j, markEvenOdd);     }   }   pair<int, int> BipartiteDFS(int i, int p) {     parent[i] = p;     d[i] = 1 + d[p];     visited[i] = 1;     pair<int, int> ans = make_pair(0, 0);     for (auto j : adj[i]) {       if (j == p) {         continue;       }       if (visited[j]) {         if ((d[i] - d[j]) % 2 == 0 && d[i] > d[j]) {           return make_pair(i, j);         }         continue;       }       ans = max(ans, BipartiteDFS(j, i));     }     return ans;   }   void AddEdges(vector<int> v, bool markEvenOdd) {     unvisited = vector<int>(v);     while (unvisited.size()) {       AddEdgeDFS(unvisited.back(), markEvenOdd);     }   }   int main() {     int n;     vector<int> V;     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       V.push_back(i);     }     AddEdges(V, true);     AddEdges(even, false);     AddEdges(odd, false);     pair<int, int> p = make_pair(0, 0);     for (int i = 1; i <= n; ++i) {       if (visited[i]) {         continue;       }       p = max(p, BipartiteDFS(i, 0));     }     int u, v;     tie(u, v) = p;     vector<int> ans;     if (u == 0) {       for (int i = 1; i <= n; ++i) {         if (d[i] % 2) {           ans.push_back(i);         }       }     } else {       for (; u != parent[v]; u = parent[u]) {         ans.push_back(u);       }     }     PrintQueryOrAnswer(v ?  N  :  Y , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int pow2[30];   int ar[1000900], mark[1000090];   int main() {     int n;     int a, b;     pow2[0] = 1;     for (int i = 1, _n = 30; i < _n; i++) pow2[i] = pow2[i - 1] * 2;     while (cin >> n) {       memset(mark, -1, sizeof(mark));       int m = n - 1, r = 0;       while (m > 1) {         if (m % 2) r = 1;         m /= 2;       }       if (n != 2 && !r) {         mark[1] = 0;         mark[0] = 1;       }       for (int i = n; i >= 0; i--) {         if (mark[i] == -1) {           int hi = 29, low = 0, x = 0;           while (hi >= low) {             int mid = (hi + low) / 2;             if (pow2[mid] > i) {               hi = mid - 1;             } else if (pow2[mid] <= i)               low = mid + 1, x = pow2[mid];           }           int d = i - x;           mark[i] = x - d - 1;           mark[x - d - 1] = i;         }       }       long long ret = 0;       for (int i = 0, _n = n + 1; i < _n; i++) ret += (i ^ max(mark[i], 0));       cout << ret << endl;       for (int i = 0, _n = n + 1; i < _n; i++) {         if (i) cout <<    ;         if (mark[i] == -1) mark[i] = 0;         cout << mark[i];       }       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long T, n, a[300010], c[300010], l[300010], r[300010];   long long lowbit(long long x) { return x & (-x); }   void add(long long x, long long k) {     for (long long i = x; i <= n; i += lowbit(i)) c[i] += k;   }   long long query(long long x) {     long long sum = 0;     for (long long i = x; i >= 1; i -= lowbit(i)) sum += c[i];     return sum;   }   signed main() {     memset(l, 0, sizeof(l));     memset(r, 0, sizeof(r));     scanf( %lld , &n);     for (long long i = 1; i <= n; i++) scanf( %lld , &a[i]);     memset(c, 0, sizeof(c));     for (long long i = 1; i <= n; i++) {       if (2 * a[i] - 1 <= n)         l[i] = query(2 * a[i] - 1);       else         l[i] = query(n) - query(2 * a[i] - n - 1);       add(a[i], a[i]);     }     memset(c, 0, sizeof(c));     for (long long i = n; i >= 1; i--) {       if (2 * a[i] - 1 <= n)         r[i] = query(2 * a[i] - 1);       else         r[i] = query(n) - query(2 * a[i] - n - 1);       add(a[i], a[i]);     }     long long f = 0;     for (long long i = 1; i <= n; i++)       if (l[i] % (2 * a[i]) && r[i] % (2 * a[i])) {         printf( YES n );         f = 1;         break;       }     if (!f) printf( NO n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     vector<pair<int, int> > v_p;     int x1, y1, x2, y2;     cin >> x1 >> y1 >> x2 >> y2;     if (x2 < x1) swap(x1, x2);     if (y2 < y1) swap(y1, y2);     for (int i = y1; i <= y2; i++) {       v_p.push_back(make_pair(x1, i));       v_p.push_back(make_pair(x2, i));     }     for (int i = x1 + 1; i < x2; i++) {       v_p.push_back(make_pair(i, y1));       v_p.push_back(make_pair(i, y2));     }     int n, x, y, r;     cin >> n;     vector<tuple<int, int, int> > v;     for (int i = 0; i < n; i++) {       cin >> x >> y >> r;       v.push_back(make_tuple(x, y, r));     }     int cnt = 0;     for (int i = 0; i < v_p.size(); i++) {       bool flag = 1;       for (int j = 0; j < n; j++) {         int x2 = get<0>(v[j]);         int y2 = get<1>(v[j]);         int r = get<2>(v[j]);         if (r * r >= ((v_p[i].first - x2) * (v_p[i].first - x2)) +                          ((v_p[i].second - y2) * (v_p[i].second - y2))) {           flag = 0;           break;         }       }       if (flag) cnt++;     }     cout << cnt;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   int main() {     int n;     cin >> n;     while (n--) {       string s;       cin >> s;       int szs = s.size();       bool z = 0, e = 0;       int sum = 0;       for (int i = 0; i < szs; i++) {         sum += s[i] -  0 ;         e |= (!((s[i] -  0 ) & 1) && ((s[i] -  0 ) || z));         z |= (s[i] ==  0 );       }       if (sum == 0 || (z && e && !(sum % 3)))         cout <<  red n ;       else         cout <<  cyan n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 1;   namespace fastinput {   inline int readChar();   template <class T = int>   inline T readInt();   template <class T>   inline void writeInt(T x, char end = 0);   inline void writeChar(int x);   inline void writeWord(const char *s);   static const int buf_size = 16384;   inline int getChar() {     static char buf[buf_size];     static int len = 0, pos = 0;     if (pos == len) pos = 0, len = fread(buf, 1, buf_size, stdin);     if (pos == len) return -1;     return buf[pos++];   }   inline int readChar() {     int c = getChar();     while (c <= 32) c = getChar();     return c;   }   template <class T>   inline T readInt() {     int s = 1, c = readChar();     T x = 0;     if (c ==  - ) s = -1, c = getChar();     while ( 0  <= c && c <=  9 ) x = x * 10 + c -  0 , c = getChar();     return s == 1 ? x : -x;   }   static int write_pos = 0;   static char write_buf[buf_size];   inline void writeChar(char x) {     if (write_pos == buf_size)       fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;     write_buf[write_pos++] = x;   }   template <class T>   inline void writeInt(T x, char end) {     if (x < 0) writeChar( - ), x = -x;     char s[24];     int n = 0;     while (x || !n) s[n++] =  0  + x % 10, x /= 10;     while (n--) writeChar(s[n]);     if (end) writeChar(end);   }   inline void writeWord(const char *s) {     while (*s) writeChar(*s++);   }   struct Flusher {     ~Flusher() {       if (write_pos) fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;     }   } flusher;   }  // namespace fastinput   using namespace fastinput;   const string arr[6] = { S ,  M ,  L ,  XL ,  XXL ,  XXXL };   int decode(string s) {     for (int i = 0; i < 6; ++i)       if (s == arr[i]) return i;   }   int cnt[6];   int answer[N];   pair<int, int> want[N];   int give[N];   map<pair<int, int>, vector<int> > whowant;   void NO() {     puts( NO );     exit(0);   }   int main() {     ::ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     for (int i = 0; i < 6; ++i) cin >> cnt[i];     int n;     cin >> n;     for (int i = 0; i < n; ++i) {       string t;       cin >> t;       size_t x = t.find( , );       if (x != std::string::npos) {         want[i].first = decode(t.substr(0, x));         want[i].second = decode(t.substr(x + 1));       } else         want[i].first = decode(t), want[i].second = -1;       whowant[want[i]].push_back(i);     }     for (int i = 0; i < 6; ++i) {       vector<int> tmp = whowant[{i, -1}];       while (cnt[i] > 0 && tmp.size() > 0) {         give[tmp.back()] = i;         tmp.pop_back();         --cnt[i];       }       if (tmp.size() > 0) NO();       tmp = whowant[{i - 1, i}];       while (cnt[i] > 0 && tmp.size() > 0) {         give[tmp.back()] = i;         tmp.pop_back();         --cnt[i];       }       if (tmp.size() > 0) NO();       tmp = whowant[{i, i + 1}];       while (cnt[i] > 0 && tmp.size() > 0) {         give[tmp.back()] = i;         tmp.pop_back();         --cnt[i];       }       whowant[{i, i + 1}] = tmp;     }     cout <<  YES n ;     for (int i = 0; i < n; ++i) cout << arr[give[i]] <<   n ;     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   using namespace std;   long long S[500005];   void add(int first, int a) {     for (int i = first; i < 500005; i += i & -i) {       S[i] += a;     }   }   long long query(int first) {     long long res = 0;     for (int i = first; i > 0; i -= i & -i) {       res += S[i];     }     return res;   }   struct node {     node *l, *r;     int a, b;     long long Min;     long long tag;     node(int _a, int _b) : l(NULL), r(NULL) {       a = _a;       b = _b;       Min = 1e18;       tag = 0;     }   } * root;   void build(node *n) {     if (n->a == n->b) return;     int mid = (n->a + n->b) / 2;     n->l = new node(n->a, mid);     n->r = new node(mid + 1, n->b);     build(n->l);     build(n->r);   }   long long Min(node *n) { return n->Min + n->tag; }   void pull(node *n) { n->Min = min(Min(n->l), Min(n->r)); }   void push(node *n) {     n->l->tag += n->tag;     n->r->tag += n->tag;     n->tag = 0;   }   void Set(node *n, int first, long long k) {     if (n->a == n->b) {       n->Min = k;       n->tag = 0;       return;     }     push(n);     int mid = (n->a + n->b) / 2;     if (first <= mid)       Set(n->l, first, k);     else       Set(n->r, first, k);     pull(n);   }   void add(node *n, int l, int r, int k) {     if (n->a >= l && n->b <= r) {       n->tag += k;       return;     }     if (n->b < l || n->a > r) return;     push(n);     add(n->l, l, r, k);     add(n->r, l, r, k);     pull(n);   }   int loc[500005];   map<int, vector<int> > qu;   int dfs(node *n) {     if (Min(n) >= 0) {       return 0;     }     if (n->a == n->b) return 1;     push(n);     int ret = dfs(n->l) + dfs(n->r);     pull(n);     return ret;   }   int main() {     int q;     scanf( %d , &q);     vector<pair<char, int> > v;     v.push_back(make_pair(( + ), (0)));     vector<pair<int, int> > num;     num.push_back(make_pair((0), (0)));     for (int i = 1; i <= q; i++) {       char c;       int first;       scanf(  %c %d , &c, &first);       v.push_back(make_pair((c), (first)));       if (c ==  + ) num.push_back(make_pair((first), (i)));     }     sort(num.begin(), num.end());     for (int i = 1; i < num.size(); i++) {       loc[num[i].second] = i;       qu[num[i].first].push_back(i);     }     for (auto &it : qu) {       reverse(it.second.begin(), it.second.end());     }     root = new node(1, num.size() - 1);     int R = num.size() - 1;     build(root);     int sum = 0;     for (int i = 1; i <= q; i++) {       char c;       c = v[i].first;       if (c ==  + ) {         sum++;         int first;         first = v[i].second;         int Index = loc[i];         long long val = query(Index - 1) * 2 - first;         add(root, Index + 1, R, first * 2);         Set(root, Index, val);         add(Index, first);       } else {         sum--;         int first;         first = v[i].second;         int Index = qu[first].back();         qu[first].pop_back();         add(root, Index + 1, R, -first * 2);         Set(root, Index, 1e18);         add(Index, -first);       }       printf( %d n , sum - dfs(root));     }   }
#include <bits/stdc++.h>   using namespace std;   struct Node {     int r, idx;   } p, q, t;   struct Fin {     int x, y, z;     Fin(){};     Fin(int _x, int _y, int _z) { x = _x, y = _y, z = _z; }   };   bool operator<(Node a, Node b) { return a.r < b.r; }   priority_queue<Node> que;   vector<Fin> vec;   vector<Node> tmp;   int main() {     int n, mini = 110;     scanf( %d , &n);     for (int i = 1; i <= n; i++)       scanf( %d , &p.r), p.idx = i, que.push(p), mini = min(mini, p.r);     while (1) {       tmp.clear();       tmp.push_back(que.top());       que.pop();       while (!que.empty()) {         if (tmp[0].r == que.top().r)           tmp.push_back(que.top()), que.pop();         else           break;       }       if (que.empty()) {         mini = tmp[0].r;         break;       }       if (tmp.size() == 1) tmp.push_back(que.top()), que.pop();       for (int i = 0; i < tmp.size(); i++) tmp[i].r = max(0, tmp[i].r - 1);       if (tmp.size() & 1) {         for (int i = 0; i < tmp.size() - 3; i += 2)           vec.push_back(Fin(tmp[i].idx, tmp[i + 1].idx, 0)), que.push(tmp[i]),               que.push(tmp[i + 1]);         vec.push_back(Fin(tmp[tmp.size() - 3].idx, tmp[tmp.size() - 2].idx,                           tmp[tmp.size() - 1].idx));         que.push(tmp[tmp.size() - 3]), que.push(tmp[tmp.size() - 2]),             que.push(tmp[tmp.size() - 1]);       } else         for (int i = 0; i < tmp.size(); i += 2)           vec.push_back(Fin(tmp[i].idx, tmp[i + 1].idx, 0)), que.push(tmp[i]),               que.push(tmp[i + 1]);     }     printf( %d n%d n , mini, vec.size());     for (int i = 0; i < vec.size(); i++) {       for (int j = 1; j <= n; j++) {         if (j == vec[i].x || j == vec[i].y || j == vec[i].z)           printf( 1 );         else           printf( 0 );       }       printf(  n );     }   }
#include <bits/stdc++.h>   using namespace std;   int ok[1 << 20];   int F[1 << 9][1 << 9];   int d[1 << 9];   int bfs(int n) {     d[0] = 0;     for (int i = 1; i <= n; ++i) d[i] = -1;     queue<int> Q;     Q.push(0);     while (!Q.empty() && d[n] == -1) {       int node = Q.front();       Q.pop();       for (int i = 0; i <= n; ++i)         if (d[i] == -1 && F[node][i]) Q.push(i), d[i] = node;     }     if (d[n] == -1) return 0;     int flow = 1e9;     for (int vertex = n; vertex; vertex = d[vertex])       flow = min(flow, F[d[vertex]][vertex]);     for (int vertex = n; vertex; vertex = d[vertex])       F[d[vertex]][vertex] -= flow, F[vertex][d[vertex]] += flow;     return flow;   }   vector<int> order;   int mark[1 << 9];   void dfs(int node, int n, int how) {     mark[node] = 1;     order.push_back(node);     for (int i = 1; i <= n; ++i)       if (!mark[i] && (F[node][i] == how && F[i][node] != how))         dfs(i, n, 1 - how);   }   int Val[1 << 9];   int main(void) {     int n;     for (int i = 2; i <= 1e6; ++i) ok[i] = 1;     for (int i = 2; i <= 1e3; ++i)       if (ok[i])         for (int j = i * i; j <= 1e6; j += i) ok[j] = 0;     cin >> n;     vector<int> a, b, pa, pb;     for (int i = 1; i <= n; ++i) {       int val;       cin >> val;       Val[i] = val;       if (val & 1)         a.push_back(val), pa.push_back(i);       else         b.push_back(val), pb.push_back(i);     }     if (a.size() != b.size()) return puts( Impossible ) * 0;     int sz = a.size();     for (int i = 1; i <= sz; ++i) F[0][i] = 2;     for (int i = 1; i <= sz; ++i) F[i + sz][sz + sz + 1] = 2;     for (int i = 0; i < sz; ++i)       for (int j = 0; j < sz; ++j)         if (ok[a[i] + b[j]]) F[i + 1][j + 1 + sz] = 1;     int flow = 0;     int cnt = 0;     while ((cnt = bfs(sz + sz + 1)) != 0) flow += cnt;     if (flow != sz + sz) return puts( Impossible ) * 0;     vector<vector<int> > cycles;     for (int i = 1; i <= sz + sz; ++i)       if (!mark[i]) {         order.clear();         dfs(i, sz + sz, 0);         for (auto &it : order)           if (it <= sz)             it = pa[it - 1];           else             it = pb[it - sz - 1];         cycles.push_back(order);       }     cout << (cycles.size()) <<   n ;     for (auto cycle : cycles) {       cout << cycle.size() <<    ;       for (auto it : cycle) cout << it <<    ;       cout <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     int pearls = 0, links = 0;     cin >> s;     for (int i = 0; i < s.size(); i++) {       if (s[i] ==  - )         links++;       else         pearls++;     }     if (pearls == 0)       cout <<  yes  << endl;     else if (links % pearls == 0)       cout <<  yes  << endl;     else       cout <<  no  << endl;     return 0;   }