diff --git a/1841B Keep it Beautiful/1841B.cpp b/1841B Keep it Beautiful/1841B.cpp new file mode 100644 index 0000000..771b723 --- /dev/null +++ b/1841B Keep it Beautiful/1841B.cpp @@ -0,0 +1,53 @@ +#include +using namespace std; +using ll = long long; + + +void solve() +{ + int n; + cin>>n; + vectorv; + for(int i=0; i>x; + v.push_back(x); + } + string s="1"; + int last=v[0]; + bool increase=1; + for(int i=1; i=last && increase) + { + s.push_back('1'); + last=v[i]; + } + else if(v[i]=v[i] && increase) + { + increase=0; + last=v[i]; + s.push_back('1'); + } + else if(v[i]>=last && v[i]<=v[0]) + { + last=v[i]; + s.push_back('1'); + } + else + s.push_back('0'); + } + cout<> TC; + cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file