美味题解
2025-07-30 16:37:42
发布于:浙江
0阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int n;
string b;
int main(){
int t;
cin>>t;
while(t--){
cin>>n>>b;
string s="1";
for(int i=1;i<n;i++){
if(b[i]+1!=s[i-1]+b[i-1]-'0'){
s+="1";
}else{
s+="0";
}
}
cout<<s<<"\n";
}
return 0;
}
这里空空如也
有帮助,赞一个