BZOJ 1012: [JSOI2008]最大数maxnumber
来源:互联网 发布:qt is淘宝刷平台哪个好 编辑:程序博客网 时间:2024/06/13 03:24
少打库贡献了一发CE(难受)
单调栈
#include<iostream>#include<algorithm>#include<set>#include<cstdio>using namespace std;int m,d,t;int top,len,a[200001],num[200001];int main(){int x;char ch[1];scanf("%d %d",&m,&d);while(m--){scanf("%s%d",ch,&x);if(ch[0]=='A'){x=(x+t)%d;num[++len]=x;while(top&&num[a[top]]<=x)--top;a[++top]=len;}else{int y=lower_bound(a+1,a+top+1,len-x+1)-a;printf("%d\n",t=num[a[y]]);}}return 0;}
0 0
- BZOJ 1012: [JSOI2008]最大数maxnumber
- BZOJ 1012 [JSOI2008]最大数maxnumber
- BZOJ 1012: [JSOI2008]最大数maxnumber
- [BZOJ 1012][JSOI2008]最大数maxnumber
- BZOJ 1012: [JSOI2008]最大数maxnumber
- bzoj 1012: [JSOI2008]最大数maxnumber 二分
- bzoj 1012 [JSOI2008]最大数maxnumber
- [BZOJ 1012] [JSOI2008] 最大数maxnumber
- 【BZOJ 1012】[JSOI2008]最大数maxnumber
- BZOJ 1012:[JSOI2008]最大数 maxnumber
- bzoj 1012 [JSOI2008]最大数maxnumber
- 【BZOJ 1012】 [JSOI2008]最大数maxnumber
- bzoj 1012 [JSOI2008]最大数maxnumber
- BZOJ 1012 [JSOI2008]最大数maxnumber
- BZOJ 1012 [JSOI2008]最大数maxnumber
- BZOJ 1012: [JSOI2008]最大数maxnumber
- BZOJ 1012: [JSOI2008]最大数maxnumber
- bzoj 1012: [JSOI2008]最大数maxnumber
- [Linux基础]Linux基础知识入门及常见命令.
- 小强ROS机器人教程(10)___使用kinect进行自主移动避障
- 文章投稿推荐
- windows下node.js环境配置
- Java数组和foreach遍历循环
- BZOJ 1012: [JSOI2008]最大数maxnumber
- 好书推荐:Python网络数据采集
- 【LeetCode】recorder-list
- Django 学习笔记一
- 趣探 Mach-O:加载过程
- 解决PyCharm [import tensorflow as tf]报错
- COGS 731. [网络流24题] 最长递增子序列
- iOS 传七种值方法
- eclipse导入Androidstudio