- N连环
- 2009-07-20 00:12:32 @
include
include
using namespace std;
int main()
{
string a,b;
cin>>a>>b;
int l;
l=a.size();
int s1,s2;
int num1[l],num2[l];
s1=s2=0;
for(int i=0;i=0;i--) {
s1-=num1[i];
if (s1%2!=0) num1[i]=1-num1[i];
s2-=num2[i];
if (s2%2!=0) num2[i]=1-num2[i];
}
int q;
q=1;
s1=s2=0;
for(int i=l-1;i>=0;i--) {
s1+=num1[i]*q;
s2+=num2[i]*q;
q*=2;
}
if (s2>s1) cout
1 条评论
-
飛花如月 LV 8 @ 2009-07-20 21:22:17
......
好了,我会了....ac
- 1