SDUT 双向队列(队列)
来源:互联网 发布:知乐的肉小说有哪些 编辑:程序博客网 时间:2024/05/22 16:48
#include<iostream>#include<cstdio>#include<string>#include<cstring>using namespace std;int main(){ int a[30000],n,m=11000,data; int l=0,r=m,i=0; cin>>n; string str; for(int j=1;j<=n;j++) { cin>>str; if(str=="LIN") { cin>>data; a[--l]=data; } else if(str=="RIN") { cin>>data; a[++r]=data; } else if(str=="LOUT") { if(l!=m) cout<<a[l++]<<endl; //cout<<l<<endl; else cout<<j<<" "<<"ERROR"<<endl; } else if(str=="ROUT") { if(r!=m) cout<<a[r--]<<endl; else cout<<j<<" "<<"ERROR"<<endl; } } return 0;}
0 0
- SDUT 双向队列(队列)
- SDUT 1466 双向队列
- 双向队列 SDUT 1466
- SDUT 1466 双向队列
- SDUT 1466 双向队列
- sdut oj1466 双向队列
- acm sdut 双向队列
- SDUT-双向队列
- SDUT-1466 双向队列
- sdut 1466 双向队列
- SDUT OJ 1466 双向队列
- 双向队列(队列)
- Deque(双向队列)
- 双向队列
- 双向队列
- 双向队列
- 双向队列
- 双向队列
- Java调用net的webservice故障排除实战分享
- SVN服务器搭建
- 如何解决 内核启动 卡在 Starting kernel ...
- DFS—HDU1010
- 1619-7 张良 十一月十八号总结 [连续第四十九天]
- SDUT 双向队列(队列)
- github比sourceforge好在哪?
- hibernate中的集合映射详细解析
- Linux-学习-env
- vscode golang开发环境
- 802.11协议笔记(二)——PHY物理层的帧格式(802.11b)
- Android面试题整理
- Spring AOP
- JavaScript知识点整理