题目描述
blablabla
样例
blablabla
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla\#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
string s;
cin >> s;
//n + 1
int sign = false;
int x = 31;
while((s[x] == '1')&&(x>=0))
{
s[x] = '0';
x --;
}
if(x == -1)
{
sign = true;
cout << '1';
}
else{
s[x] = '1';
}
cout << s << endl;
//n + 3
for(int i = 0;i < 2;i ++ )
{
x = 31;
while((s[x] == '1')&&(x>=0))
{
s[x] = '0';
x --;
}
if(x == -1)
{
cout << '1';
}
else{
s[x] = '1';
}
}
if(sign)cout << '1';
cout << s << endl;
}
return 0;
}