Find Jobs
Hire Freelancers

Programming Problem

$10-30 USD

Cancelado
Publicado hace alrededor de 6 años

$10-30 USD

Pagado a la entrega
#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 del proyecto: 16470552

Información sobre el proyecto

16 propuestas
Proyecto remoto
Activo hace 6 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
16 freelancers están ofertando un promedio de $38 USD por este trabajo
Avatar del usuario
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 en 1 día
5,0 (285 comentarios)
7,8
7,8
Avatar del usuario
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 en 1 día
4,9 (116 comentarios)
6,3
6,3
Avatar del usuario
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 en 1 día
4,9 (47 comentarios)
6,1
6,1
Avatar del usuario
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 en 1 día
5,0 (38 comentarios)
5,9
5,9
Avatar del usuario
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 en 1 día
4,8 (50 comentarios)
5,3
5,3
Avatar del usuario
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 en 1 día
5,0 (35 comentarios)
4,9
4,9
Avatar del usuario
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 en 1 día
5,0 (13 comentarios)
4,1
4,1
Avatar del usuario
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 en 1 día
4,8 (3 comentarios)
3,0
3,0
Avatar del usuario
......
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 2 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de KOREA, REPUBLIC OF
Anyang, Korea, Republic of
5,0
1
Forma de pago verificada
Miembro desde abr 2, 2017

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.