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