Page 1 of 5 123 ... LastLast
Results 1 to 15 of 62

Hybrid View

  1. #1
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125

    >>>>[MPGH Coding Contest]<<<<

    MPGHCC


    Deadline of submission: April 12th

    Ok I was bored and decided to make a coding contest for MPGH to see who the REAL coders are. Participants will have to code 5 programs for 5 problems. This won't be a coding contest where you make the best game but the best algorithm. The programs will be coded in C/C++ and submit a .rar/.zip file with all your finished code. Do not send your code file by file. The program will read from file and output to screen. Output must be exact (spelling and punctuation). The input file will contain 5 test cases.

    Updates:
    Marking system will be 20 points for each test case you get correct and 10 points for every day you submit earlier.

    DO NOT LEACH CODE.

    Starting with a simple problem.

    ===============================================

    Problem 1: Counting

    File Input: count.txt

    Problem: There are many people on the MPGH site, but there are many leachers. Yet there are also many good coders. You have been assigned to count the number of coder and leachers using their post count and rep. If their post count multiplied their rep is bigger than or equal to 500, they are a true coder. Else they are a leacher.

    N will be given as the number of people on the site and 2N numbers will be given represneting post count and rep respectively.

    Sample Input 1:

    5
    0 0
    10 49
    200 3
    19 25
    500 0

    Sample Output 1:

    There are 1 Coder(s) and 4 Leecher(s).

    Sample Input 2:
    3
    79 3
    120 4
    97 4

    Sample Output 2:

    There are 0 Coder(s) and 3 Leecher(s).

    ================================================== =

    Problem 2: Dos Attack

    File Input: dosattack.txt

    MPGH is under a DOS attack! You are in charge of the DOS firewall which filters out patterns in incoming connections. Given a sequence of length n determine if there is a subsequence of length m or more which has the same elements.

    You will be given n and m, the length of the sequence and the minimum length of the subsequence you need to filter respectively. The sequence will then be given.

    Sample Input 1:
    10
    3
    1 2 3 8 2 9 9 9 0 2

    Sample Output 1:
    DoS Alert! Connection ID of 9 of the same 3 connections.

    Sample Input 2
    10
    3
    1 6 1 6 9 9 9 9 9 4

    Sample Output 2:
    DoS Alert! Connection ID of 9 of the same 5 connections.

    Sample Input 3:
    6
    2
    1 8 9 2 1 8

    Sample Output 3:
    No DoS detected!

    ================================================== =====

    Problem 3: Trojan Firewall

    File Input: trojan.txt

    Problem: Many hacks released by leechers contain Trojans! You have been assigned to create a "sniffer" that detects these Trojans.
    AVHA HWHO AVAX HJKH DAVE HKJL
    Given a string of characters, split it into groups of 4. In the last group add Z's to fill in the letters. Add up the first letter of each group of 4 where A = 1 and Z = 26. A + H + A + H + D + H = 30. Divide the number by the number of groups there and if it is divisible it is a Trojan. 30 / 6 = 5. The hack is a trojan!

    Output whether the string is a trojan or not and include the quotient.

    Sample Input 1:
    AVHAHWHOAVAXHJKHDAVEHKJL

    Sample Output 1:
    Trojan with code 5!

    Sample Input 2:
    AVAOWOVHAAOWHBAOBOAAO

    Sample Output 2:
    Not a trojan!

    ================================================== ===

    Problem: Server Location

    File Input: server.txt

    Problem: MPGH is getting a new server! Finally! But the server must be placed in a place for the shortest distance for all the clients to reduce lag. To make things simpler the area will be a straight line and all input an offset of the starting location 0.

    You will be given n for number of clients and each clients location.

    Sample Input 1:
    2
    0
    2

    Sample Output 1:
    Server will be located at 1.

    Sample Input 2
    4
    1
    0
    3
    2
    Sample Output 2:
    Server will be located at 1.5.

    ================================================== =====


    Problem 5: Shortest Path

    File Input: shortpath.cpp

    Problem: You have been assigned to the MPGH Coding Team! You will have to be able to find the shortest distance from one point to another as part of the hack. There will be walls and other objects in the way so you will need to find a clever method to do so.

    Input will be n by m as the dimensions of the area. The area will then be given. If impossible output so.

    Key:
    "S" - Start
    "-" - Wall
    "." - Open Space
    "O" - Box
    "E" - End

    Sample Input 1:
    5 5
    S-...
    .-.-.
    .-.-.
    .-.-.
    ...-E

    Sample Output 1:
    16

    Sample Input 2:
    3 2
    SO
    OO
    OE

    Sample Output 2:
    Impossible.

    ================================================

    DO NOT GOOGLE THE ANSWERS. Have fun doing this and it took me while to write all of this.

    Contest will end April 12 / 2010 giving you 7 days to finish it. I guarantee any good coder here will be able to get probably the first 4 but the 5th one requires some advanced knowledge.

    [Submit code to: spaminator@live.ca]

    ////////////////////////////////////////////////////////////////////////////

    Email format is as follows:
    Subject: "Submission MPGHCC: [Your MPGH name]"
    Body:
    Name: [Your name]
    Age: [Your age]
    Country: [Your country]
    Problems Solved: [Indicate which problems you finished with numbers]


    Sample Email

    Subject: Submission MPGHCC: zhaoyun333
    Body:
    Name: zhaoyun
    Age: 15
    Country: Canada
    Problems Solved: 1, 2, 3, 4

    /////////////////////////////////////////////////////////////////////////////

    Make sure the code is .cpp / .c and put all the code into one .rar file for final submission. If you found out you did something wrong, you can resubmit with the header of the email as "Resubmission: [Your MGPH name]" Only one resubmission is allowed.

    Post any comments/suggestions or if you need help with anything.
    Last edited by zhaoyun333; 04-05-2010 at 11:55 AM.
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  2. #2
    LegendaryAbbo's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    5,243
    Reputation
    23
    Thanks
    546
    My Mood
    Relaxed
    You'll probably only get 3 or 4 entrants.

    But nice work on the write-up and best of luck for your contest

  3. #3
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    Yea probably...want to have a go?
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  4. #4
    Retoxified's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    148
    Reputation
    8
    Thanks
    171
    Spoiler for the 5th one:
    A*

    I'm not gonna join the contest tho(sorry), too much work to do atm.

  5. #5
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    D= What does your spoiler mean?
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  6. #6
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Question, Sir.

    File input: means you have to read from a text file? Or do you ask for user input in the console?

  7. #7
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    File input meaning input from file. The filename for each question is located near the top of each problem.
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  8. #8
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    I would try this, hmmm... But I'm feeling lazy.... Is there a short ver for teh LaZy ppl...?
    ~
    edit:nvm saw 5days, but I might procrastinate anyways...
    Last edited by Arhk; 04-05-2010 at 10:12 AM.
    "If the world hates you, keep in mind that it hated me first." John 15:18

  9. #9
    lalakijilp's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    310
    Reputation
    9
    Thanks
    53
    My Mood
    Blah
    Yo I will participate (I almost finished my C++ book)

    give till 12 april plz then peeps can use their weekend

  10. #10
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    Lmao come on Arhk do it! :P I spent a lot of time making this. If you're good enough you should finish in 1-2 hours.
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  11. #11
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    I'm probably going to join also, not going to start today though.

  12. #12
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    Ok Deadline has been extended to april 12th. You will get extra points for every day you submit earlier.
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  13. #13
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    Errr... There's points now....?
    ~
    "If the world hates you, keep in mind that it hated me first." John 15:18

  14. #14
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    How else am I supposed to judge? Read the update. There will be 20 points for each test case you get and 10 points for every day you submit earlier.
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  15. #15
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    There isn't Grades or anything too is there...?
    ~
    "If the world hates you, keep in mind that it hated me first." John 15:18

Page 1 of 5 123 ... LastLast

Similar Threads

  1. [MPGH Coding Contest #2]
    By zhaoyun333 in forum C++/C Programming
    Replies: 20
    Last Post: 04-22-2010, 03:43 PM
  2. MPGH Video Contest Winners
    By radnomguywfq3 in forum News & Announcements
    Replies: 56
    Last Post: 01-21-2009, 07:11 PM
  3. [Video] MPGH Video Contest 2
    By LazyCountry in forum Combat Arms Hacks & Cheats
    Replies: 26
    Last Post: 09-01-2008, 10:43 PM
  4. [Video] MPGH Video Contest
    By LazyCountry in forum Combat Arms Hacks & Cheats
    Replies: 14
    Last Post: 08-31-2008, 04:55 PM
  5. MPGH VIP CONTEST - Custom Emotions
    By arunforce in forum Hack/Release News
    Replies: 1
    Last Post: 04-08-2007, 08:23 AM