Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <cstdlib>
- #include <algorithm>
- #include <cmath>
- #include <iomanip>
- #include <numeric>
- #include <vector>
- #include <string>
- #include <set>
- #include <map>
- #include <stack>
- #include <deque>
- #include <unordered_map>
- #include <bits/stdc++.h>
- #include <queue>
- using namespace std;
- #define ll long long
- void sherry()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- bool comp(pair<int, int> a, pair<int, int> b)
- {
- return a.second > b.second;
- }
- ll fac(ll t)
- {
- if (t == 1)
- {
- return 1;
- }
- return t * fac(t - 1);
- }
- int main()
- {
- sherry();
- string s;
- cin >> s;
- stack<char> st;
- st.push(s[0]);
- for (int i = 1; i < s.size(); i++)
- {
- if (s[i] == st.top())
- st.pop();
- else
- st.push(s[i]);
- }
- if (st.empty())
- cout << "Yes";
- else
- cout << "No";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement