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 ;
}

Codeforces_734_C的更多相关文章

随机推荐

  1. 原生js获取下拉框下标

    // 获取下拉框所选下标 传入下拉框的id function getselectscheckitemindex (idStr) { let o = document.getElementById(id ...

  2. 小小知识点(二十三)circularly symmetric complex zero-mean white Gaussian noise(循环对称复高斯噪声)

    数学定义 http://en.wikipedia.org/wiki/Complex_normal_distribution 通信中的定义 在通信里,复基带等效系统的噪声是复高斯噪声,其分布就是circ ...

  3. [MariaDB]MHA高可用部署-实验

    目录 一.简介 1.1MHA角色 二.MHA的工具 三.MHA部署过程 3.1.1 配置 3.1.2 环境规划 3.1.3 配置一主多从 3.2 MHA配置 3.2.1 master权限授予 3.2. ...

  4. list查询

    public List<MISSINGISTEMS> getMissList(MISSINGISTEMS missingistems) throws Exception { List< ...

  5. C++指针声明

    指针声明 void f(int) void (*p1)(int)=&f; void (*p2)(int)=f; 调用例子: int f(); int (*p) ()=f; //指针p指向f i ...

  6. VUE CLI环境搭建文档

    VUE CLI环境搭建文档 1.安装Node.js 下载地址 https://nodejs.org/zh-cn/download/ 2.全局安装VUE CLI win+R键打开运行cmd窗口输入一下代 ...

  7. must appear in the GROUP BY clause or be used in an aggregate function

    今天在分组统计的时候pgsql报错 must appear in the GROUP BY clause or be used in an aggregate function,在mysql里面是可以 ...

  8. log日志拦截

    简介 主要记录一下项目中的日志拦截和异常拦截,由于之前公司项目为单体项目,所使用的日志拦截较为简单,只是用拦截器进行前后对日志的拦截,异常拦截直接使用@ExceptionHandler,而现在公司接口 ...

  9. 网络流入门题目 - bzoj 1001

    现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的, 而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点 ...

  10. html+css 知识点总结 day1(01-08)

    01  初步认识浏览器 02 浏览器内核 IE   内核:Trident,                 win10 Edge  内核:EdgeHTML Firefox(火狐浏览器)   内核:Ge ...