#include<stdio.h>
#define N 100001
int n;
char ice[N];
void solve()
{
int i,t_tol=0,h_tol=0,h=0,t=0,m=n>>1;
for(i=0;i<n;++i)
if(ice[i]=='H')
h_tol++;
else
t_tol++;
if((h_tol%2)||(t_tol%2))
{
printf("-1\n");
return ;
}
for(i=0;i<m;++i)
if(ice[i]=='H')
++h;
else
++t;
if(h*2==h_tol&&t*2==t_tol)
{
printf("1\n%d\n",m);
return ;
}
for(;i<n;++i)
{
if(ice[i]=='H')
h++;
else
hdu 3363 Ice-sugar Gourd
最新推荐文章于 2019-08-03 15:52:16 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)