Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int n;
- cin>>n;
- vector<int> a(n);
- for(auto &e: a) cin>>e;
- int f = 1;
- for(int i=1; i<n; i++)
- {
- if(a[i-1]>a[i])
- {
- if(i!=1 && i!=2 && i!=4 && i!=8 && i!=16)
- f = 0;
- }
- }
- if(f) cout<<"Yes\n";
- else cout<<"No\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment