Mutations Problem

This is a discussion on Mutations Problem within the C++ Programming forums, part of the General Programming Boards category; A black-hat cracker attacked to your computer and he took a very important sequence from it. Also, he replaced this ...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    1

    Mutations Problem

    A black-hat cracker attacked to your computer and he took a very important sequence from it. Also, he replaced this sequence with five mutations of the sequence.

    The sequence has length of N and it's content are numbers between 1 and N (all the numbers one time) in a random position.

    For every single mutation:
    ~He take the original sequence.
    ~He moves a single number to a random place.
    ~He creates the mutation.

    The sequence's length is between 1 and 20000 so this proccess performs only for five numbers.
    Every number moves only one time.
    Taking a number and moving it to the same place is accepted as a mutation.


    Input File:
    In the first line we take the N number (length of sequence).
    In the 5 other lines we take the five mutations.

    Output file:
    In a single line the original sequence.

    Example:

    Input
    5
    4 1 5 3 2
    4 5 1 3 2
    1 5 4 3 2
    3 5 4 1 2
    2 5 4 1 3

    Output
    5 4 1 3 2


    Please HELP me as soon as you can with a verbal or a coded solution!!!

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Your explanation is very bad. If this reflects your current understanding of the problem, then that's where you should start: understand the problem better.

    At any rate, no one's going to code it for you.

    (How many x-posts does this one have?)
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,300
    (How many x-posts does this one have?)
    Two other's so far...
    Mutations Problem - CodeGuru Forums
    scandalz dot net: Programming C/C++

    Goodbye freeloader.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sleep() function problem or logic problem?
    By FernandoBasso in forum C Programming
    Replies: 7
    Last Post: 11-16-2011, 04:50 PM
  2. strcmp problem, whats the problem, i cant figure it out!
    By AvaGodess in forum C Programming
    Replies: 14
    Last Post: 10-18-2008, 06:45 PM
  3. Replies: 4
    Last Post: 10-16-2008, 07:30 PM
  4. sturct/pointer problem, and fscanf problem
    By hiphop4reel in forum C Programming
    Replies: 6
    Last Post: 07-28-2008, 09:40 AM
  5. syntax linked list problem & struct problem
    By beely in forum C Programming
    Replies: 5
    Last Post: 11-11-2002, 08:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21