acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 题解

    userId_undefined

    法兰西玫瑰

    倔强青铜
    158阅读
    0回复
    0点赞
  • 标准题解

    这就是标准题解,大家可以参考。

    userId_undefined

    复仇者_零

    尊贵铂金
    58阅读
    0回复
    1点赞
  • 题解

    userId_undefined

    嘉陵江的晚风.

    倔强青铜
    19阅读
    0回复
    1点赞
  • 6

    #include <bits/stdc++.h> using namespace std; stack<int> s; int main(){ int n,m,c; cin>>n>>m; int a[1001]={},b[1001]={}; for(int i=1;i<=n;i++) cin>>a[i]; while(m--){ for(int i=1;i<=n;i++){ cin>>b[i]; } stack<int> s; c=1; for(int i=1;i<=n;i++){ s.push(a[i]); while(!s.empty()&&s.top()==b[c]){ s.pop(); c++; } } if(!s.empty()==0){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } } }

    userId_undefined

    只莹

    倔强青铜
    28阅读
    0回复
    0点赞
  • TIJIE

    userId_undefined

    陈炜涵

    倔强青铜
    12阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    zhouty

    秩序白银
    12阅读
    0回复
    0点赞
  • 带点注释

    userId_undefined

    嘎嘣嘎嘣脆

    倔强青铜
    7阅读
    0回复
    0点赞
  • gdfdfgdfg

    #include<bits/stdc++.h> using namespace std; stack<int> s; int n,m; int main(){ cin>>n>>m; int a[n+1]; for(int i=1;i<=n;i++) cin>>a[i]; while(m--){ int b[n+1],cnt=1; for(int i=1;i<=n;i++) cin>>b[i]; for(int i=1;i<=n;i++){ s.push(a[i]); while(s.top()==b[cnt]){ s.pop(); cnt++; if(s.empty()) break; } } if(s.empty()) cout<<"Yes"<<endl; else cout<<"No"<<endl; while(!s.empty()){ s.pop(); } } return 0; }

    userId_undefined

    艾尔海森

    倔强青铜
    7阅读
    0回复
    0点赞
首页