#include <bits/stdc++.h>
using namespace std;
int a,b,x;
int main()
{
cin>>a>>b>>x;
if(a<x/2||b<x/2||a+b<x)cout<<-1<<'\n';
else
{
int cnt = x/2;
int a1 = a-cnt;
int b1 = b-cnt;
if(a1%2==0&&b1%2==0)
{
for(int i=1;i<=x;i++)
{
if(i%2==1)cout<<1;
else cout<<0;
}
for(int i=1;i<=b1;i++)
{
cout<<1;
}
for(int i=1;i<=a1;i++)
{
cout<<0;
}
return 0;
}
}
cout<<-1<<'\n';
return 0;
}
简单的构造,最终的剩余状态一定是101010.....这样或者是010101....这样,但是得保证在构造完长度为x的字串后,剩余的0与1必定得为偶数,不然无法完全消除获得消除过多,使得最终结果长度不为x

京公网安备 11010502036488号