Find Jobs
Hire Freelancers

Programming Problem

$10-30 USD

Cancelled
Posted about 6 years ago

$10-30 USD

Paid on delivery
#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; }
Project ID: 16470552

About the project

16 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
16 freelancers are bidding on average $38 USD for this job
User Avatar
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 in 1 day
5.0 (285 reviews)
7.8
7.8
User Avatar
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 in 1 day
4.9 (116 reviews)
6.3
6.3
User Avatar
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 in 1 day
4.9 (47 reviews)
6.1
6.1
User Avatar
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 in 1 day
5.0 (38 reviews)
5.9
5.9
User Avatar
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 in 1 day
4.8 (50 reviews)
5.3
5.3
User Avatar
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 in 1 day
5.0 (35 reviews)
4.9
4.9
User Avatar
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 in 1 day
5.0 (13 reviews)
4.1
4.1
User Avatar
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 in 1 day
4.8 (3 reviews)
3.0
3.0
User Avatar
......
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
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 in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of KOREA, REPUBLIC OF
Anyang, Korea, Republic of
5.0
1
Payment method verified
Member since Apr 2, 2017

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.