http://codeforces.com/problemset/problem/734/C

枚举第一种,二分第二种,注意不取的情况。

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std; long long n,k,m,x,s,a[],b[],c[],d[]; int main()
{
scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&k,&x,&s);
for(int i = ;i <= m;i++) scanf("%I64d",&a[i]);
for(int i = ;i <= m;i++) scanf("%I64d",&b[i]);
for(int i = ;i <= k;i++) scanf("%I64d",&c[i]);
for(int i = ;i <= k;i++) scanf("%I64d",&d[i]);
a[] = x;
b[] = ;
c[] = ;
d[] = ;
long long ans = n*x;
for(int i = ;i <= m;i++)
{
if(s < b[i]) continue;
int ss = s-b[i];
int t = lower_bound(d,d+k+,ss)-d;
int l = ,r = k+;
while(l < r)
{
int mid = (l+r)/;
if(d[mid] > ss) r = mid;
else l = mid+;
}
l--;
long long tt = a[i]*(n-c[l]);
ans = min(ans,tt);
}
printf("%I64d\n",ans);
return ;
}

最新文章

  1. 调用WebServices超时
  2. div在Iframe 被遮挡解决方法
  3. php用mysql函数出错
  4. 基于tp框架实现的递归城市查询
  5. Mysql-proxy中的lua脚本编程(一)
  6. JQuery获取页面关闭事件
  7. 部署 instance 到 OVS flat network - 每天5分钟玩转 OpenStack(135)
  8. IP 碎片重组
  9. protobuf(Protocol Buffers)java初体验
  10. ajax的介绍
  11. Pyqt4的事件与信号
  12. Microsoft SQL - 数据类型
  13. 处理数据库 Ora-00845: memory_traget not supported on this system 的错误
  14. Oracle查询表占用空间的大小
  15. spring 源码导入eclipse(sts)
  16. LOJ 534 花团(线段树+dfs栈)
  17. AES块加密与解密
  18. SharePoint PeopleEditor控件使用
  19. Oracle DUL/AUL/ODU 工具说明
  20. Codeforces Round #394 (Div. 2) A,B,C,D,E

热门文章

  1. 开源工具abaplint的介绍
  2. [开源] SEPP——研发协作一站式管理平台
  3. Redis 持久化的两种方案
  4. DFT与IDFT
  5. vue 项目使用JSbrideg.js与app通信
  6. 【转】【e周美文】优秀博客上榜推荐
  7. GPU图形绘制管线简介
  8. javascript 实现中文按照拼音首字母排序
  9. js对象转换为json格式时,js对象属性中有值为null和undefined注意事项
  10. 谈谈Java的Collection接口