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)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。