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意义下的个数就好了;

最新文章

  1. ABAP 数量单位转换
  2. Bootstrap学习应用
  3. L17 怎么向应用程序商店提交应用
  4. 1行代码为每个Controller自定义“TabBar”-b
  5. Writing a ServiceMain Function(使用RegisterServiceCtrlHandler函数)
  6. Delphi三层网络架构代码实现
  7. PHP socket模拟POST请求
  8. User-Agent-Switcher和fiddler
  9. Web版需求征集系统所得1,servlet中获取checkbox复选框的值
  10. python调用远程chromedriver.exe、selenium抓包方法
  11. Python循环结构用法
  12. 【软件需求工程与建模 - 小组项目】第6周 - 成果展示2 - 软件需求规格说明书V4.3
  13. ActiveMQ_1学习
  14. JavaScript——闭包机制
  15. ContextMune上下文菜单中,二级菜单获取及状态设置
  16. EZ 2018 05 13 NOIP2018 模拟赛(十三)
  17. Codeforces 749E Gosha is hunting 二分+DP
  18. hdu2138 Miller_Rabin
  19. 虚拟机网络配置详解(NAT、桥接、Hostonly) z
  20. 如何将hdf5文件转换成tflite文件

热门文章

  1. _bzoj1014 [JSOI2008]火星人prefix【Splay】
  2. Xcode7 使用AFNetWorking 报错 添加Security.framework
  3. python_基础部分(1)
  4. poj1715Hexadecimal Numbers(数位dp)
  5. DEV—【GridControl添加按钮列】
  6. Laravel环境搭建
  7. ftp 上传与下载
  8. [转] NTFS Permission issue with TAKEOWN & ICACLS
  9. Discuz 页面不能加载插件的原因和解决方法
  10. width:100px; min-width:100% 解释:宽度大于100px 就是100% 小于100px 就是100像素