社区讨论
64pts WA求调
P14524[BYOI R1] 意识解离参与者 3已保存回复 7
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 7 条
- 当前快照
- 1 份
- 快照标识符
- @mi3yigqy
- 此快照首次捕获于
- 2025/11/18 10:30 4 个月前
- 此快照最后确认于
- 2025/11/18 23:50 4 个月前
CPP
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1000005;
int t,n,a[N];
void read(int &x){
int f=1;
x=0;
char s=getchar();
while(s<'0'||s>'9')
{
if (s=='-') f=-1;
s=getchar();
}
while(s>='0'&&s<='9')
{
x=x*10+s-'0';
s=getchar();
}
x*=f;
}
signed main(){
read(t);
while(t--){
bool pp=0;
read(n);
for(int i=1;i<=n;i++){
read(a[i]);
if(a[i]==0){
pp=1;
}
}
int cnt=1;
for(int i=1;i<n;i++){
if(a[i]<a[i+1]){
cnt++;
}
}
if(cnt<=a[n]&&pp==0){
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}
}
回复
共 7 条回复,欢迎继续交流。
正在加载回复...