MPGH Coding Contest!

Posts 31–45 of 62 · Page 3 of 5
Haha, my good friend A*.

For those who want the stepahead, I suggest you read this;
A* Pathfinding for Beginners

Minutes Later Edit: Yes, I am aware I'm not participating. Stop PM Spamming me.
If the deadline is increased, I will give it a shot, but I'm really busy currently.

Regards,
-Schyler-
Oh... Thought he meant a pointer, That was obscure...

@BA: Hi there. currently Im behind, but that's only cuz HD rushed and turned all his in on the first day. >_>...
Quote Originally Posted by why06 View Post
Oh... Thought he meant a pointer, That was obscure...

@BA: Hi there. currently Im behind, but that's only cuz HD rushed and turned all his in on the first day. >_>...
Quote Originally Posted by My email
Name: Wesley V.
Age: 17
Country: The Netherlands
Problems Solved: x

I'll just go for the 70 points I get for handing over nothing 7 days before the deadline
Thats what I submitted good luck
Omg lmao. That's epic.
Quote Originally Posted by zhaoyun333 View Post
MPGHCC


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!
why does it needs to be filled up with Z?

edit:
I got problem 1,2 and 3
can you further explain problem 4....
it isn't really clear yet
Quote Originally Posted by lalakijilp View Post
why does it needs to be filled up with Z?

edit:
I got problem 1,2 and 3
can you further explain problem 4....
it isn't really clear yet

Writing in white as to not give anything away to casual observers:
<---begin white--->
Since you're only using the first character of each group I don't see the need for filling with 'z' unless it's a deliberate attempt to confuse people or put a bogus requirement in place. I chose to not fill since it's just a waste of CPU cycles and has no effect on the ultimate required calculation. (i.e ABCD EF would be A+E, so no need to add two Z's)

4 is pretty silly imho - you have a file with the first line saying how many lines, and the other lines are simply numbers - figure out the average of those numbers and show it.

<---end white--->

I decided to make mine a little fun and do some using fopen etc, others using filestreams and some even using STL.
Don't tell me your competing too BA?
Not competing - just bored so I submitted just for the hell of it .
Perhaps I should upload it here too just for laughs

BTW A* allows diagonal steps normally, while the given example under problem 5 doesn't so if you go A*, be sure to account for that (my first solution solved his problem in 5 or so steps less than what he had listed, so I had to make it 'less efficient' haha

And you can always just roll your own algorithm, not that hard when you start thinking about it. I think I even showed HD how to do that once for pathfinding..
Already finished huh? I've only done number one...

I got a pretty unique technique for it though. No I will have to finish the rest of them to see how mines compares with ur techniques.
i'm sure this anal thing
Output must be exact (spelling and punctuation).
will knock my score down quite a bit
Quote Originally Posted by B1ackAnge1 View Post
i'm sure this anal thing
will knock my score down quite a bit
Yeh well apparently my first one crashed. Which is weird because it worked fine for me. =/
Could very well be simple differences in the test input file etc so better error-handling when dealing with these files (ok so it says it has 5 lines, but what if there's only 3?) would be beneficial - i just didn't bother with it but i'm sure the same will happen to mine
1-4 is nothing more than read from file, parse data, calculate.
5 is basically the same thing, but you have to come up with a pathfinding algorithm
So i'm sure you could do those right now - get to it man!
My plan is to procrastinate... =d
~
It might work in the end since I'm reading a crap load on alot of topics now, D3D, cryptography, C++ (I've never had confidence in any of my abilities so I continually read many beginner texts front to end), ASM, applied cryptography, reverse engineering, network hacking. I just feel like I'm way behind so I'll be cramming for a while.
~
Tbh I'm trying to focus on all of the things I listed above so if when I get to it, and it doesn't take like 10mins max I'll just ignore it.
~
Currently got a PDF open on C++, and D3D coding.
Thanks for your positive reinforcement BA, but I'm the timid type I don't take a test until I'm sure I've crammed enough.
~
That kind of attitude rarely gets applied to my school work though I guess I might sound like a brat saying school bores me and I don't see how it's worth my time, but it is kind of how I think (roughly).
~
I Love the time I get to spend learning/coding though, I'm actually sitting here at the desktop reading some PDFs with this awesome background music. I can play this, although crappy in relativity =d.

Posts 31–45 of 62 · Page 3 of 5
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us