Find Jobs
Hire Freelancers

Programming Problem

$10-30 USD

已取消
已发布大约 6 年前

$10-30 USD

货到付款
#1. Today, a shop offers a very good deal “Buy 3 only pay 2” with a rule that in one bill only the cheapest ones get free. Your job is to help shopper find the maximum discount he can get. Example: - Your friend wants to buy 7 items, costing $350000, $400000, $300000, $100000, $150000, $200000, and $250000. - If he buys all items in one bill, he gets 2 free items which are the cheapest ones of $100000 and $150000. Consequently, he gets the discount of $250000 and must pay $1500000. - If he buys the items separately, he may get a bigger discount. For instance, he separates the items in three bills as follow: o The first bills: 3 items $400000, $300000, and $250000 -> $250000 discount. o The second bill: 3 items $350000, $200000 and $100000 -> $100000 discount. o The third bill: 1 item $150000 -> no discount. o Eventually, he gets the total discount of $350000 and must pay $1400000. Input is read from the text file [login to view URL] consisting of: - The first line is the number of items he buys - The second line is the list of prices of items Output is written to the text file [login to view URL] consisting of ONLY ONE NUMBER which is the maximum discount he can get. [Example]: [login to view URL] [login to view URL] 6 100000 400000 200000 350000 300000 250000 400000 Limitation: - 1 ≤ number of items he buys ≤ 200000 - 1 ≤ the cost of an item ≤ 1000000 - Processing time of the proposed algorithm ≤ 1 second The output file only has one value - The main function must follow the template: int main(int argc, const char* argv[]) { //content … return 0; } - The extension of the input file of the programming problem is “inp” (ex:[login to view URL]), NOT “[login to view URL]” (ex: [login to view URL]) - Sample code for writing to a text file: #include <stdio.h> int main() { int num; FILE *fptr; fptr = fopen("[login to view URL]","w"); printf("Enter num: "); scanf("%d",&num); fprintf(fptr,"%d",num); fclose(fptr); return 0; }
项目 ID: 16470552

关于此项目

16提案
远程项目
活跃6 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
16威客以平均价$38 USD来参与此工作竞价
用户头像
Hi! I'm interesting your project very well. I am mastering c++ and I'm a good Mathematician. And also I have many experience and good skill about Algorithm. Let's go ahead with me
$30 USD 在1天之内
5.0 (285条评论)
7.8
7.8
用户头像
Hello, I am interested in this project and so wanted to discuss more it in details. I have a lot of experience in C programming. Thanks
$35 USD 在1天之内
4.9 (116条评论)
6.3
6.3
用户头像
I have high proficiency in Matlab including SPSS Statistics, Simulation, Mathematics, Python,Algorithm, C++ programming, Machine learning and Statistics analysis. Once you share the project, I will have a look & confirm if I can do it. I’m honest, creative and a unique person to carry out your tasks given to me. Leaving your project on our hand is a privileged; we'll make sure that the project is done in a perfect way and do our best until you satisfied. I would love to discuss this project with you and meet your exact requirements. I am confident I can provide you with top notch materials that will fit your needs. I'm proud my work on being professional, of the highest quality and always delivered on time
$25 USD 在1天之内
4.9 (47条评论)
6.1
6.1
用户头像
I, Jignesh Lakhani completed my masters from IIT Roorkee in Computer Engineering. I am having very good knowledge of C, C++, Java, JavaFX, Algorithm and Data Structure. I am having strong analytical power. I will complete your project before the deadline. I am looking forward to discussing with you about this job post. Please feel free to contact me. Respectfully, Jignesh
$30 USD 在1天之内
5.0 (38条评论)
5.9
5.9
用户头像
Hi, I can solve this algorithm problem. I have looked carefully the problem and i can solve it within 1 day. Knock me for more details. Thanks
$25 USD 在1天之内
4.8 (50条评论)
5.3
5.3
用户头像
It is a simple task it should be done in few hours Please contact me if you are interested in good quality and fast delivery code
$25 USD 在1天之内
5.0 (35条评论)
4.9
4.9
用户头像
Sir, you need help in C programming? like mentioned ? so you don't need to be worry because I am here with outstanding understanding of programmin in C I'll provide you 100% quality work with money back guarantee I hope I'll get this project sokn to show you my skills thanks
$15 USD 在1天之内
5.0 (13条评论)
4.1
4.1
用户头像
Call me a Hacker (white hat), a guru or whatever suits you best. The fact is by hiring me YOU'RE GOING TO GET A GREAT JOB DONE AND HAVE IT DELIVERED QUICKER THAN AS QUICK AS POSSIBLE! I have a long road behind me paved by code written in C, Java, Swift, PHP, JavaScript etc. I have successfully delivered software for the most relevant platforms out there: iOS, Android, Web and Desktop. My code is clean and my systems are very well designed. Programers love my code and customers love my software. Because of all the above you can call me simply: "The Ultimate Software Developer".
$30 USD 在1天之内
4.8 (3条评论)
3.0
3.0
用户头像
......
$25 USD 在1天之内
0.0 (0条评论)
0.0
0.0
用户头像
I'm a systems engineering student. I've resolved many problems like this one Relevant Skills and Experience C and C++ handling, resolved many programming problems like this
$15 USD 在2天之内
0.0 (0条评论)
0.0
0.0

关于客户

KOREA, REPUBLIC OF的国旗
Anyang, Korea, Republic of
5.0
1
付款方式已验证
会员自4月 2, 2017起

客户认证

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