Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef long double ld;
- #define X first
- #define Y second
- #define pb push_back
- int main() {
- ios_base::sync_with_stdio(0), cin.tie(0);
- string s;
- cin >> s;
- ll cnt = 0;
- stack<char> st;
- for (ll i = 0; i < s.size(); ++i) {
- if (st.empty()) {
- st.push(s[i]);
- continue;
- }
- if (st.top() != s[i]) {
- st.push(s[i]);
- continue;
- }
- st.pop();
- ++cnt;
- }
- if (cnt % 2 == 0) cout << "No\n";
- else cout << "Yes\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement