2017ccpc 杭州Master of Sequence
Problem K. Master of Sequence
Therearetwosequencesa1,a2,··· ,an, b1,b2,··· ,bn. LetS(t) =∑n i=1⌊t−bi ai ⌋. Therearemoperationswithin three kinds as following: • 1 x y: change value ax to y. • 2 x y: change value bx to y. • 3 k: ask min{t|k ≤ S(t)} Input The first line contains a integer T (1 ≤ T ≤ 5) representing the number of test cases. For each test case, the first line contains two integers n (1 ≤ n ≤ 100000), m (1 ≤ m ≤ 10000). The following line contains n integers representing the sequence a1,a2,··· ,an. The following line contains n integers representing the sequence b1,b2,··· ,bn. The following m lines, each line contains two or three integers representing an operation mentioned above. It is guaranteed that, at any time, we have 1 ≤ ai ≤ 1000, 1 ≤ bi,k ≤ 109. And the number of queries (type 3 operation) in each test case will not exceed 1000.
Output For each query operation (type 3 operation), print the answer in one line.
分析:
b的范围只有1000,于是树状数组维护mod意义下的个数就好了;
最新文章
- ABAP 数量单位转换
- Bootstrap学习应用
- L17 怎么向应用程序商店提交应用
- 1行代码为每个Controller自定义“TabBar”-b
- Writing a ServiceMain Function(使用RegisterServiceCtrlHandler函数)
- Delphi三层网络架构代码实现
- PHP socket模拟POST请求
- User-Agent-Switcher和fiddler
- Web版需求征集系统所得1,servlet中获取checkbox复选框的值
- python调用远程chromedriver.exe、selenium抓包方法
- Python循环结构用法
- 【软件需求工程与建模 - 小组项目】第6周 - 成果展示2 - 软件需求规格说明书V4.3
- ActiveMQ_1学习
- JavaScript——闭包机制
- ContextMune上下文菜单中,二级菜单获取及状态设置
- EZ 2018 05 13 NOIP2018 模拟赛(十三)
- Codeforces 749E Gosha is hunting 二分+DP
- hdu2138 Miller_Rabin
- 虚拟机网络配置详解(NAT、桥接、Hostonly) z
- 如何将hdf5文件转换成tflite文件
热门文章
- _bzoj1014 [JSOI2008]火星人prefix【Splay】
- Xcode7 使用AFNetWorking 报错 添加Security.framework
- python_基础部分(1)
- poj1715Hexadecimal Numbers(数位dp)
- DEV—【GridControl添加按钮列】
- Laravel环境搭建
- ftp 上传与下载
- [转] NTFS Permission issue with TAKEOWN &; ICACLS
- Discuz 页面不能加载插件的原因和解决方法
- width:100px; min-width:100% 解释:宽度大于100px 就是100% 小于100px 就是100像素