Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. typedef long double ld;
  5. #define X first
  6. #define Y second
  7. #define pb push_back
  8.  
  9. int main() {
  10. ios_base::sync_with_stdio(0), cin.tie(0);
  11. string s;
  12. cin >> s;
  13. ll cnt = 0;
  14. stack<char> st;
  15. for (ll i = 0; i < s.size(); ++i) {
  16. if (st.empty()) {
  17. st.push(s[i]);
  18. continue;
  19. }
  20. if (st.top() != s[i]) {
  21. st.push(s[i]);
  22. continue;
  23. }
  24. st.pop();
  25. ++cnt;
  26. }
  27. if (cnt % 2 == 0) cout << "No\n";
  28. else cout << "Yes\n";
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement