You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
473 B
C++
20 lines
473 B
C++
#define _CRT_SECURE_NO_WARNINGS
|
|
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
|
|
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
const int N = 100100;
|
|
char str[N];
|
|
int main()
|
|
{
|
|
scanf("%s", str);
|
|
int len = strlen(str), ans = 0;
|
|
stack<char> S;
|
|
for (int i = 0; i < len; i++)
|
|
if (S.empty() || S.top() != str[i])
|
|
S.push(str[i]);
|
|
else
|
|
S.pop(), ans++;
|
|
puts((ans & 1) ? "Yes" : "No");
|
|
return 0;
|
|
}
|