delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

44
2.514.cpp Normal file
View File

@ -0,0 +1,44 @@
#include<iostream>
#include<cstdio>
using namespace std;
const int maxn=10007;
int n,k,a[maxn],s[maxn],top,q,x;
bool f()
{
k=1,top=0;
for(int i=1;i<=n;i++)
{
s[++top]=i;
while(top>0&&s[top]==a[k])
{
k++;
top--;
}
}
if(top==0) return 1;
else return 0;
}
int main()
{
#ifdef local
freopen("pro.in","r",stdin);
#endif
while(1)
{
scanf("%d",&q);
if(q==0) break;
while(1)
{
scanf("%d",&x);
if(!x) break;
else a[1]=x;
for(int i=2;i<=q;i++)
scanf("%d",&a[i]);
n=q;
if(f()) printf("Yes\n");
else printf("No\n");
}
printf("\n");
}
return 0;
}