bzoj1510: [POI2006]Kra-The Disks
来源:互联网 发布:ps淘宝美工修裤子 编辑:程序博客网 时间:2024/06/05 08:31
传送门
首先一个下面直径比上面大的管子是然并卵的。
我们大可以把他当作上面的小管子。
然后就可以二分答案了。
但是盘子是不可以穿透的。
所以还要考虑叠在之前盘子之上的情况。
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#define N 301000using namespace std;int n,m;int a[N],b[N];int sta[N],top;int main(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=m;i++) scanf("%d",&b[i]); for(int i=2;i<=n;i++) if(a[i]>a[i-1])a[i]=a[i-1]; int l,r,la=n+1; for(int i=1;i<=m;i++) { l=1,r=la-1; int ans=r; while(l<=r) { int mid=(l+r)>>1; if(a[mid]<b[i])ans=mid,r=mid-1; else l=mid+1; } la=ans; if(a[ans]<b[i])la--; } printf("%d\n",la);}
阅读全文
0 0
- BZOJ1510 [POI2006]Kra-The Disks
- bzoj1510: [POI2006]Kra-The Disks
- bzoj1510 [POI2006]Kra-The Disks
- bzoj1510[POI2006]Kra-The Disks 二分
- BZOJ 1510 [POI2006]Kra-The Disks 二分
- BZOJ 1510: [POI2006]Kra-The Disks
- 【BZOJ】【P1510】【POI2006】【Kra-The Disks】【题解】【前缀min+二分】
- find the uuid for disks
- Disks
- [BZOJ1510]遇见
- hadoop配置 - using the other hard disks
- adding extra disks on openbsd the fast way
- Poi2006 Palindromes
- BZOJ 1515 [POI2006]Lis-The Postman (挖坑)欧拉回路+重构
- Vmware :Cannot open the disk 'xxx.vmdk' or one of the snapshot disks it depends on
- cannot open the disk XXX or one of the snapshot disks it depends on
- How can I get the logical valume by the datafile names and ASM disks?
- VMware “Cannot open the disk ‘XXXXXX.vmdk’ or one of the snapshot disks it depends on.”
- Kotlin汇总5-内部类,枚举类,对象,代理
- GCD死锁 分析
- Java 实例
- 代理模式动态代理
- 第八届蓝桥杯国赛Java b组 第六题
- bzoj1510: [POI2006]Kra-The Disks
- 三维重建面试0:*SLAM滤波方法的串联综述
- 如何取得Windows驱动程序的数字签名
- 第五课
- Kotlin编程之接口和实现接口
- Mysql导致tmp目录空间耗尽问题(ERROR 1030 (HY000): Got error 28 from storage engine)
- MATLAB save 函数用法及实例
- android之bundle
- 1620