Algorithm
손승열(Son Seungyeol)
[Codeforces][C++] Keep it Beautiful
Educational Codeforces Round 150 Problem B

![[Codeforces][C++] Keep it Beautiful](https://www.datocms-assets.com/66479/1686837917-1.png?auto=format&w=860)
⌨️ Solution Code
cpp
#include <bits/stdc++.h>
using namespace std;
string solve(){
int q, a1, a2, start;
bool desc = false;
string ans="";
cin>>q;
for(int i=0;i<q;i++){
scanf("%d", &a2);
if(i==0){
start = a2;
a1 = a2;
}
if(!desc){
if(a1 <= a2) ans += "1";
else if(start >= a2){
desc = true;
ans += "1";
}
else{
ans += "0";
continue;
}
}
else{
if(a1 <= a2 && start >= a2) ans += "1";
else{
ans += "0";
continue;
}
}
a1 = a2;
}
ans+="\n";
return ans;
}
int main()
{
int t;
cin>>t;
while(t--){
cout<<solve();
}
}