MPGH Coding Contest!

Posts 115 of 62 · Page 1 of 5
>>>>[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.
You'll probably only get 3 or 4 entrants.

But nice work on the write-up and best of luck for your contest
Yea probably...want to have a go?
Spoiler for the 5th one:
A*

I'm not gonna join the contest tho(sorry), too much work to do atm.
D= What does your spoiler mean?
Question, Sir.

File input: means you have to read from a text file? Or do you ask for user input in the console?
File input meaning input from file. The filename for each question is located near the top of each problem.
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...
Yo I will participate (I almost finished my C++ book)

give till 12 april plz then peeps can use their weekend
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.
I'm probably going to join also, not going to start today though.
Ok Deadline has been extended to april 12th. You will get extra points for every day you submit earlier.
Errr... There's points now....?
~
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 isn't Grades or anything too is there...?
~
Posts 115 of 62 · Page 1 of 5
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?