Click here to Skip to main content
15,886,801 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Efficiently sort the following? Pin
Richard Deeming30-Aug-17 4:40
mveRichard Deeming30-Aug-17 4:40 
AnswerRe: Efficiently sort the following? Pin
Alan N30-Aug-17 5:48
Alan N30-Aug-17 5:48 
GeneralRe: Efficiently sort the following? Pin
arnold_w31-Aug-17 23:50
arnold_w31-Aug-17 23:50 
GeneralRe: Efficiently sort the following? Pin
Alan N3-Sep-17 1:13
Alan N3-Sep-17 1:13 
GeneralRe: Efficiently sort the following? Pin
arnold_w3-Sep-17 2:37
arnold_w3-Sep-17 2:37 
QuestionHow to use tensorflow in c# Pin
delphix518-Jul-17 0:48
delphix518-Jul-17 0:48 
AnswerRe: How to use tensorflow in c# Pin
Richard MacCutchan18-Jul-17 2:09
mveRichard MacCutchan18-Jul-17 2:09 
QuestionC++ algorithm Question Pin
Member 1310646721-Jun-17 18:29
Member 1310646721-Jun-17 18:29 
anyone would like to try a program on this. i have some practice material. Also would love to see what you are all upto. share your work too.

The running time of the program should be less than 4 seconds.

Mina wants to go on a trip during the a summer vacation.

She has to pay in advance several things such as airfare, lodging, car rent, show tickets,

etc. To pay them, she wants to use her mileage points from her credit card, airline, cell

phone, etc.

She can divide mileage points from one source (ex. airline mileage) to pay multiple things

(ex. airfare and tickets). Also she can merge mileage points from multiple sources (ex.

airline and cell phone) to pay one thing (ex. car rent).

However, there can be a limitation in applying certain mileages to certain type of payments.

For example, suppose she has 100,000 (in Korean Won) airline mileage and 50,000 cell phone

mileage, and she wants to pay 90,000 for airfare and 70,000 for car rent 1 , there can be a

limitation that she can use airline mileage for both airfare and car rent, but she only can

use cell phone mileage for car rent.

With that limitation, it is not a good idea to use only airline mileage to pay for car rent,

because, after that, she needs to pay 60,000 for car rent (after she use 90,000 for airfare

and 10,000 for car rent from 100,000 airline mileage). Instead, it is a reasonable choice to

use 50,000 cell phone mileage for car rent first, and then use 100,000 airline mileage for

airfare and car rent, which results her to pay 10,000 for either car rent or airfare.

Now given a set of mileages, a set of payments, and lists of feasible payments for each

mileage, calculate the minimum amount of money that Mina has to pay.

Input

2 <-- # of mileages

10 5 <-- mileage #0 and #1

2 <-- # of payments

9 7 <-- payment #0 and #1

0 1 <-- mileage #0 can be used for payment #0 and #1

1 <-- mileage #1 can be used for #1

Output

1 <-- minimum of payment 1 is needed
AnswerRe: C++ algorithm Question Pin
OriginalGriff21-Jun-17 18:37
mveOriginalGriff21-Jun-17 18:37 
QuestionInvoice / Payments history table or statement of account Pin
Bastien Vandamme14-Jun-17 15:50
Bastien Vandamme14-Jun-17 15:50 
AnswerRe: Invoice / Payments history table or statement of account Pin
Gerry Schmitz14-Jun-17 16:17
mveGerry Schmitz14-Jun-17 16:17 
GeneralRe: Invoice / Payments history table or statement of account Pin
Bastien Vandamme14-Jun-17 16:46
Bastien Vandamme14-Jun-17 16:46 
GeneralRe: Invoice / Payments history table or statement of account Pin
Gerry Schmitz14-Jun-17 17:39
mveGerry Schmitz14-Jun-17 17:39 
AnswerRe: Invoice / Payments history table or statement of account Pin
jschell10-Jul-17 4:30
jschell10-Jul-17 4:30 
QuestionChaotic image encryption algorithm by Xingyuan Wang Pin
Member 1325934114-Jun-17 4:53
Member 1325934114-Jun-17 4:53 
QuestionSelecting values from list to make up totals in second list Pin
Wayne Gaylard15-May-17 21:45
professionalWayne Gaylard15-May-17 21:45 
AnswerRe: Selecting values from list to make up totals in second list Pin
Richard MacCutchan15-May-17 22:27
mveRichard MacCutchan15-May-17 22:27 
GeneralRe: Selecting values from list to make up totals in second list Pin
Wayne Gaylard15-May-17 22:34
professionalWayne Gaylard15-May-17 22:34 
AnswerRe: Selecting values from list to make up totals in second list Pin
F-ES Sitecore22-May-17 4:48
professionalF-ES Sitecore22-May-17 4:48 
QuestionALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303117-Apr-17 1:29
Member 1313303117-Apr-17 1:29 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
OriginalGriff17-Apr-17 1:30
mveOriginalGriff17-Apr-17 1:30 
GeneralRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303117-Apr-17 1:59
Member 1313303117-Apr-17 1:59 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Ralf Meier17-Apr-17 2:08
mveRalf Meier17-Apr-17 2:08 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Gerry Schmitz17-Apr-17 7:15
mveGerry Schmitz17-Apr-17 7:15 
GeneralRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303118-Apr-17 1:27
Member 1313303118-Apr-17 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.