-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path1144C.cpp
More file actions
41 lines (35 loc) · 725 Bytes
/
Copy path1144C.cpp
File metadata and controls
41 lines (35 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//By Prajawal Kumar Pandey
//Oct 31 2020
#include<bits/stdc++.h>
using namespace std;
int search(vector<int>&vec,int i){
int lo=0,hi=vec.size()-1;
while(lo<hi){
int mid=(lo+hi+1)/2;
if(vec[mid]<i)lo=mid;
else hi=mid-1;
}
return lo;
}
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)cin>>a[i];
bool flag=1;
for(int i=1;i<n;i++){
if(a[i]>a[i-1]){
if(a[i]!=a[i-1]+1){
flag=0;
break;
}
}
}
if(flag)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}