时间: $ O(a.size()) $ 。
直接用栈模拟即可。
#include<bits/stdc++.h>
using namespace std;
string a,b,c;
int op=0,tot;
char ch[11111111];
int top;
int main()
{
cin>>a;
for(int i=0; i<a.size(); i++)
{
if(ch[top]==a[i])
{
top--;
op^=1;
}
else
{
ch[++top]=a[i];
}
}
cout<<(op==0?"No":"Yes")<<endl;
}