Find Jobs
Hire Freelancers

I'm finding experienced javascript developer.

$4-5 USD / hour

已关闭
已发布超过 3 年前

$4-5 USD / hour

This is fixed project. my budget is 5 usd. Hurdle Race Problem Description You are participating in an interesting hurdle race. The race comprises of stairs of certain heights and points at every meter that can be collected. Initially, you are at height 0. In order to make race interesting, an additional constraint is imposed in the race. You are given with certain indexes along with a minimum height you must be at when you reach that index. You are allowed to move forward if and only if you are at a minimum height specified at that index. Your task is to reach the end with the maximum amount of points. You are given with 2 arrays, points and height of size n each. Array points denote the points at n meters. Array height denotes the height of stairs at n meters. You are given with 2 more arrays, index and minheight of size m each. Array index denotes the index at which you must have a specific height to proceed ahead. Array minheight denote the minimum height that must be there to proceed ahead. At every index i, you can either pick the point[i] or climb the stairs and increase the height by height[i]. Your task is to tell the maximum points that can be collected when we reach the end. Output -1 if we can not reach the end of the race. INPUT FORMAT: The first line of input contains a single integer T denoting the number of test cases. The first line of each test case contains a single integer n. Next line contains n space-separated integers denoting points[i]. Next line contains n space-separated integers denoting height[i]. Next line contains a single integer m. Next line contains m space-separated integers denoting index[i]. Next line contains m space-separated integers denoting minheight[i]. OUTPUT FORMAT: Output a single integer denoting the maximum points that can be collected when we reach the end. CONSTRAINTS: 1 <= T <= 10 1 <= M <= N <= 1000 1 <= points[i] <= 10^5 1 <= height[i] <= 10^4 1 <= index[i] <= N-1 1 <= minheight[i] <= 10^4 SAMPLE INPUT #1: 1 4 1 4 3 2 4 0 2 3 2 1 2 3 2 SAMPLE OUTPUT #1: 9 SAMPLE EXPLANATION #1: TEST CASE #1: n=4, m=2, points=[1, 4, 3, 2], height=[4, 0, 2, 3], index=[1, 2], minheight=[3, 2]. At 0th meter, we will climb the stairs and increase our height by 4. Therefore, height = 4, points collected = 0. At 1st meter, we will collect the points. Therefore, height = 4, points collected = 4. Note, at index 1, we must have a height of 3, which is satisfied. At 2nd meter, we will collect the points. Therefore, height = 4, points collected = 7. Note, at index 2, we must have a height of 2, which is satisfied. At 3rd meter, we will collect the points. Therefore, height = 4, points collected = 9. Therefore, the final answer is 9. If you read whole description, please write down "I can do this within 5 usd." thanks
项目 ID: 29255883

关于此项目

2提案
远程项目
活跃3 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
2威客以平均价$5 USD/小时来参与此工作竞价
用户头像
I can do this within 5 usd. Hi, there. Hope you are doing well. Reach out me on here so that and we can discuss in detail. Regards.
$5 USD 在40天之内
0.0 (1条评论)
0.0
0.0
用户头像
Hi there, I have a great experience in web development and javascript, jquery and prototype. I will do this project for you at 4 dollars. Contact me in the chat so that I can start working on it. Regards, Amandeep Singh
$4 USD 在40天之内
0.0 (0条评论)
0.0
0.0

关于客户

LATVIA的国旗
Iecava, Latvia
5.0
1
会员自1月 6, 2021起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。