Problem Link: ZOOZ Problem - CodeChef
Feedback
include
include
include
include
using namespace std;
// Remember *max_element(c,c+n) and s.find()
define shit int t;cin>>t;while(t–)
define pi 3.141597653
define o 0
define l 1
define el endl
define loop(j,a,b) for(int j=a; j<b; j++)
define inn int n;cin>>n
int main(){
shit{
inn;
string s1 = “1001”;
string s2 = “010”;
string s3 = “01”;
string s4 = “10”;
string ans;
int i=0;
if(n>=3){
if(n%2==0){
while(i<(n-4)/2){
s1+= s3;
i++;
}
cout<<s1<<el;
}
else{
while(i<(n-3)/2){
s2+= s4;
i++;
}
cout<<s2<<el;
}
}
}
}
I don’t see any problem in any test case from this approach. It’s withing time limit too. Then why isn’t this accepted as the right answer??