https://pintia.cn/problem-sets/994805342720868352/problems/994805427332562944
#includeusing namespace std; const int N=1e3+10; int a[N],n,m,k; bool check() { stack st; for(int i=0,val=1;i =m) return false;//如果弹出元素后,栈的大小还是大于等于m则不合法 } return true; } int main(void) { cin>>m>>n>>k; while(k--) { for(int i=0;i >a[i]; if(check()) puts("YES"); else puts("NO"); } return 0; }



