Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: 1150 The specified program requires a newer version of Windows vc++ application Pin
DanielBrownAU9-Apr-17 17:04
professionalDanielBrownAU9-Apr-17 17:04 
QuestionHow to read data from text file using CMFCEditBrowseCtrl vc++ Pin
lolici7-Apr-17 5:12
lolici7-Apr-17 5:12 
AnswerRe: How to read data from text file using CMFCEditBrowseCtrl vc++ Pin
David Crow7-Apr-17 5:58
David Crow7-Apr-17 5:58 
GeneralRe: How to read data from text file using CMFCEditBrowseCtrl vc++ Pin
lolici7-Apr-17 7:36
lolici7-Apr-17 7:36 
AnswerRe: How to read data from text file using CMFCEditBrowseCtrl vc++ Pin
David Crow7-Apr-17 7:59
David Crow7-Apr-17 7:59 
GeneralRe: How to read data from text file using CMFCEditBrowseCtrl vc++ Pin
lolici7-Apr-17 11:05
lolici7-Apr-17 11:05 
QuestionRe: How to read data from text file using CMFCEditBrowseCtrl vc++ Pin
Richard MacCutchan7-Apr-17 6:03
mveRichard MacCutchan7-Apr-17 6:03 
QuestionHow to efficiently map to original indices of an array after modification? Pin
Member 131008342-Apr-17 6:50
Member 131008342-Apr-17 6:50 
This is a simplified version of the problem.

We have an array of numbers (between 0 and X-1), at each round, we choose a range of numbers that we compare and only promote the biggest one and eliminate the rest. At each round, we need to output the *original* indices of the numbers that have been eliminated.

This is best explained using an example:

Here is the input:

    8 // X represents the size of the array, 2 ≤ X ≤ 100000
    4 // Y represents the number of elimination rounds 1 ≤ Y ≤ X−1
    1 0 3 6 2 4 7 5 // the numbers
    1 3
    2 4
    1 3
    0 1

Output: 4 lines, the original index of the losers at each round

    1 2
    4 5
    3 7
    0

Here is a diagram of how the output was obtained, `[]` means the numbers inside the brackets are the ones being compared.

    1 [0 3 6] 2 4 7 5 // output 1 2 because 0 and 3 were eliminated
    1 6 [2 4 7] 5 // output 4 5 because 4 and 2 were eliminated
    1 [6 7 5] // output 3 7 because 7 and 5 were eliminated
    [1 7] // output 0 because 1 was eliminated
    7

The basic idea is that we want to output the original indices of the number eliminated at each round.

**Approach:**

Model each number as a pair, with the second entry representing the original index. So we have the following:

    (1,0) [(0,1) (3,2) (6,3)] (2,4) (4,5) (7,6) (5,7) // 1 2
    (1,0) (6,3) [(2,4) (4,5) (7,6)] (5,7) // 4 5
    (1,0) [(6,3) (7,6) (5,7)] // 3 7
    [(1,0) (7,6)] // 0
    [7,6]

Is this a promising approach? What is the best way to complement it efficiently?

Is there a better, more efficient approach that is easier to implement?

AnswerRe: How to efficiently map to original indices of an array after modification? Pin
Victor Nijegorodov2-Apr-17 7:26
Victor Nijegorodov2-Apr-17 7:26 
Questiongauge pressure and absolute pressure calculations in C++ Pin
Member 131006682-Apr-17 3:29
Member 131006682-Apr-17 3:29 
AnswerRe: gauge pressure and absolute pressure calculations in C++ Pin
leon de boer2-Apr-17 4:10
leon de boer2-Apr-17 4:10 
GeneralRe: gauge pressure and absolute pressure calculations in C++ Pin
harold aptroot2-Apr-17 4:28
harold aptroot2-Apr-17 4:28 
AnswerRe: gauge pressure and absolute pressure calculations in C++ Pin
Jochen Arndt2-Apr-17 22:26
professionalJochen Arndt2-Apr-17 22:26 
AnswerRe: gauge pressure and absolute pressure calculations in C++ Pin
Munchies_Matt2-Apr-17 23:30
Munchies_Matt2-Apr-17 23:30 
QuestionMessage: Failed to set up the execution context to run the test. Pin
HaraldGalda31-Mar-17 2:16
professionalHaraldGalda31-Mar-17 2:16 
QuestionRe: Message: Failed to set up the execution context to run the test. Pin
David Crow31-Mar-17 5:23
David Crow31-Mar-17 5:23 
AnswerRe: Message: Failed to set up the execution context to run the test. Pin
zezba90003-Dec-18 9:30
zezba90003-Dec-18 9:30 
GeneralRe: Message: Failed to set up the execution context to run the test. Pin
David Crow3-Dec-18 10:21
David Crow3-Dec-18 10:21 
GeneralRe: Message: Failed to set up the execution context to run the test. Pin
zezba90003-Dec-18 10:59
zezba90003-Dec-18 10:59 
QuestionSave strings and integer in text file Pin
lolici25-Mar-17 11:01
lolici25-Mar-17 11:01 
SuggestionRe: Save strings and integer in text file Pin
David Crow25-Mar-17 11:12
David Crow25-Mar-17 11:12 
GeneralRe: Save strings and integer in text file Pin
lolici25-Mar-17 11:27
lolici25-Mar-17 11:27 
SuggestionRe: Save strings and integer in text file Pin
Premnath Mali14-Apr-17 1:40
professionalPremnath Mali14-Apr-17 1:40 
QuestionCMFCToolBarComboBoxButton dont work on some machines Pin
vojtee24-Mar-17 3:21
vojtee24-Mar-17 3:21 
SuggestionRe: CMFCToolBarComboBoxButton dont work on some machines Pin
Richard MacCutchan24-Mar-17 3:40
mveRichard MacCutchan24-Mar-17 3:40 

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.