48 Hours of Code - And The Winner Is...

Programming Competition

Page 1 of 1

9 Replies - 17854 Views - Last Post: 17 August 2005 - 12:59 PM

#1 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1964
  • View blog
  • Posts: 20,423
  • Joined: 17-March 01

48 Hours of Code - And The Winner Is...

Posted 25 July 2005 - 06:51 PM

48 Hours of Code Has Ended. The Winner Is: 1lacca!

Posted Image

Top 10:
1st Place: 1lacca (4 Problems, 2909 Minutes)
2nd Place: LuxFX (3 Problems, 3598 Minutes)
3rd Place: mffoo (3 Problems, 3940 Minutes)
4th Place: lattyware (2 Problems, 1281 Minutes)
5th Place: duplex (2 Problems, 2618 Minutes)
6th Place: hotsnoj (1 Problems, 83 Minutes)
6th Place: _piotrek (1 Problems, 83 Minutes)
7th Place: lanced (1 Problems, 242 Minutes)
8th Place: Acid Reign (1 Problems, 500 Minutes)
9th Place: Red|5 (1 Problems, 662 Minutes)
10th Place: dragonlady (1 Problems, 1031 Minutes)

Competition Rules:

Quote

At 10:00PM EDT (GMT-4) four problems will be posted in the "48 Hours of Code" thread. Solutions will be submitted via a file upload form, or alternate email address. The upload URL and Email address will be provided at the same time problems are announced. Below are the guidelines for submitting solutions:
  • Only 1 Submission Per Problem (No Corrections Accepted)

  • Submission should be in .zip or .tar.gz format and include the following:
    • A text (info.txt) file with your member name, compiler and language used (including version), and problem name
    • Original source (not compiled)
    • The following file naming convention MUST be followed so that we can test your program:
      Input: probX.dat
      Output: membername_probX.out (Where X is your problem number, 1 to 4.)
You may use any language that supports file input/output and line-by-line file parsing. Some possible languages include:  PHP, C++, C, C#, ASP, ASP.NET, VB, VB.NET, Java, and Perl.

The winner will be determined by the number of problems correctly solved. In the case of a tie, the total time spent on all submitted problems will break the tie.

Example:
Competitor 1 submits correct solutions to problems one, two, and four at 180, 540, and 1380 minutes after the start of submissions. His score is 3 problems correct with a time penalty of 2100 minutes.
Competitor 2 submits correct solutions to problems two, three, and four at 300, 540, and 1320 minutes after the start of submissions. His score is 3 problems correct with a time penalty of 2160 minutes.
Competitor 1 will thus place higher than competitor 2.


Problems:
Problems can be found further down in this thread, or click here for a quick jump:
http://forums.dreami...ndpost&p=121695

Prizes:

Quote

  • Klipsch GMX 2.1 Speakers

  • ASP.NET Book

  • $25 Gift Certificate of Your Choosing (Online)

  • Super Awesome Swag Bag From Klipsch

  • 1 Year of Web Hosting

  • Several other unannounced prizes


Discussion:
Feel free to ask questions and discuss the competition in this thread:
48 Hours of Code Discussion

Is This A Good Question/Topic? 0
  • +

Replies To: 48 Hours of Code - And The Winner Is...

#2 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1964
  • View blog
  • Posts: 20,423
  • Joined: 17-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 25 July 2005 - 07:14 PM

Grand Prize: Klipsch ProMedia GMX A 2.1 Speakers

Posted Image

Sponsored by Klipsch

This three-piece multimedia speaker system is designed for consumers who want true high-fidelity sound but do not require or have the space for a multi-speaker surround setup.

The GMX A-2.1 system is available in 120 and 230 volt versions and delivers dynamic sound from any audio source, including iPods, PCs, CD, DVD and MP3 players, game consoles, laptops, television sets and VCRs. By combining high-performance audio, visual appeal and functionality, the A-2.1 is an ideal audio solution for today's multimedia and gaming entertainment devices.

Features include:

* Two-identical magnetically shielded satellite speakers with two-way design: 3-inch woofers and Klipsch's exclusive MicroTractrix® horns; ball joint pedestal mounts that allow them to be aimed securely in almost any direction with just a twist of the hand.
* Subwoofer with 75-watt amplifier
* Control pod with two stereo inputs: one dual RCA, one 1/8" minijack, headphone output, power button, and master volume control
* superlative dynamic output of 108 dB for music, games, and movies
* wide response from 30-20,000Hz +- 5 dB


The Klipsch ProMedia GMX line is aimed to draw you into the experience. With the coolest industrial design and the killer performance Klipsch is known for, ProMedia GMX A 2.1 will change the way your life sounds. Surrender to the system.
Was This Post Helpful? 0
  • +
  • -

#3 supersloth   User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4678
  • View blog
  • Posts: 28,500
  • Joined: 21-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 12 August 2005 - 09:28 AM

48 hours of code discussion thread

The replies in this thread have been split off into their own topic so discussion of the competition can be had all weekend, this thread will contain all of the problem set and content info for submission beginning tonight at 10est. feel free to reply in the discussion thread or pm me if you have any questions. good luck to everyone!
Was This Post Helpful? 0
  • +
  • -

#4 supersloth   User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4678
  • View blog
  • Posts: 28,500
  • Joined: 21-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 12 August 2005 - 12:19 PM

PROBLEM 1: PALINDROMES


Quote

Too bad, I hid a boot

A palindrome is a word or phrase that reads the same backwards as forwards. A word example is 'anna', while an example of a palindromic phrase is 'Too bad, I hid a boot'. Palindromes take only the letters into account.Punctuation, case, and spaces are not considered.

Given a list of words and/or phrases, the submitted program or script should be able to analyze the list and identify any palindromes within it. For each palindrome identified, the program or script should also identify if the palindrome is a perfect palindrome, such as 'anna' (all letters have a corresponding repeat), or an odd palindrome, such as 'anana' (the word or phrase contains one letter that does not have a corresponding repeat). The identified palindromes and their respective types should be output to a text file.

Input

A text file of words and phrases. Each word or phrase will be on it's own line within the file.

Output

A text file of words and phrases that have been successfully identified as palindromes. Accompanying each identified palindrome should be an indicator of it's type, in the format of palindrome - type. There should be one palindrome - type combination per line.

Sample Input:

Programming is fun
Bar crab
industrial waste
anna
bacon, no Cab

Sample Output

Bar crab - odd
anna - perfect
bacon, no Cab - perfect

The submitted program or script will be tested using a file containing between 50 and 150 words and phrases. Execution will be timed, although execution time is not the sole factor in scoring.


File provided is a sample only...this is not the file that will be used for testing.

Attached File(s)

  • Attached File  prob1.dat (454bytes)
    Number of downloads: 159

Was This Post Helpful? 0
  • +
  • -

#5 supersloth   User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4678
  • View blog
  • Posts: 28,500
  • Joined: 21-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 12 August 2005 - 12:20 PM

PROBLEM 2: AUTOMATED LETTER HANDLER

Your company's flagship product is an automated letter handler. Among many other features, it can automatically address and weigh any size envelope. One feature that it is missing is efficient postage calculations. Part of this feature is determining the best set of stamp denominations to be provided. You've been given this task.

The size of the envelope limits how many stamps it can accomodate. For example, if 1 cent and 4 cent stamps are available, all postage from 1 to 10 cents can be affixed to an envelope that has space for 4 stamps:

Postage     1 cent stamps     4 cent stamps
-------     -------------     -------------
1           1                 0
2           2                 0
3           3                 0
4           0                 1
5           1                 1
6           2                 1
7           3                 1
8           0                 2
9           1                 2
10          2                 2

Although three 4 cent stamps yields and envelope with 12 cents postage, you cannot fit enough stamps on the envelope to provide 11 cents postage. Thus, for this set of stamp denominations, you will report that it has a maximum no-gap range from 1 to 10 cents postage. We will call the size of this range the "coverage" of this set. In this case, the coverage is 10 cents.


Input

Input is split into multiple sets of data to be tested against one size of envelope. 

* The first line of a test case specifies S, the maximum number of stamps that will fit on an envelope.
* The second line specifies N, the number of stamp denomination sets that are to be tested. For example, the above description of 1 cent and 4 cent stamps comprise one set of stamp denominations.
* The next N lines contain sets of stamp denominations, one per line. The first number in each line is the number of denominations in the set, followed by the denominations in order from smallest to largest, separated by spaces. There will be no more than S denominations in a single set.
* The maximum value of S is 10; the largest denomination is 100 cents; and the maximum value of N is 10.
* The input is terminated by a test case beginning with zero (in other words, S is zero).


Output

Output one line for each test case. This line should specify the size of the largest coverage among all sets of denominations in that test case, followed by the corresponding set of denominations. All values should be separated by spaces.

If more than one set of denominations in a test case results in the same size coverage, the set with the smallest number of denominations should be printed. If both the coverage and denomination set size are the same, then the set with the lower maximum denomination should be printed. For example, given an envelope of size 5, denomination sets of 1, 4, 12, 21 and 1, 5, 12, 28 both yield coverage of 71 cents. Thus, the first set should be printed because its largest denomination is 21, while the other set's larget denomination is 28.

If the coverage size, denomination set size, and largest denomination are the same, then any of the sets may be printed.


Sample Input

5
2
4 1 4 12 21
4 1 5 12 28
10
2
5 1 7 16 31 88
5 1 15 52 67 99
6
2
3 1 5 8
4 1 5 7 8
0


Sample Output

71 1 4 12 21
409 1 7 16 31 88
48 1 5 7 8

Was This Post Helpful? 0
  • +
  • -

#6 supersloth   User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4678
  • View blog
  • Posts: 28,500
  • Joined: 21-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 12 August 2005 - 12:21 PM

PROBLEM 3: CHAIN REACTORS

Chain Reactors

A prototype for an experimental power reactor is being constructed in orbit. The reactor runs off of energy power cells that need a good deal of power to activate, but give off tremendous power once they have been engergized.

Your job as a research technican is to write a program to simulate the reactor so that the optimum configuration can be found.

The reactor consists of a grid of firing stations. Each station has a number of energy power cells, an energy beam emitter, and collection dish.

Each station has a number of other stations in its firing arc that will receive a beam of energy when the station fires. When a station recieves an energy beam in its collection dish, 1 energy power cell is activated and consumed, and the beam emitter is fired at all stations in its view. When a station recieves a beam and has no energy power cells to activate, it does nothing. When a station recieves multiple beams at the same time it will only discharge one energy power cell. A station with no targets will fire and consume an energy power cell when it is activated by another station, but its beam will not activate other stations.

One station in the reactor will be the "control station" where the inital charge will be generated to start the chain reaction.

Your task is to find how many energy power cells are consumed in the chain reaction.


Input

The input consists of multiple reactor configurations, each with multiple stations. A reactor configuration follows this format:

* An integer showing the station number, followed by a space.
* An integer showing the number of energy power cells, followed by a colon.
* A space-separated list of the stations at which this station will fire. If a station has no targets, the list of target stations will contain no characters.
* A line reading "POWER" followed by another blank line indicates the end of the reactor configuration.

The first station in the list is the control station and is discharged first. 


Output

One integer per reactor configuration (one per line) showing the number of energy power cells consumed in the simulation.


Sample Input

1 1:2 3 4
2 0:
3 0:
4 0:
POWER

1 3:2 3
2 3:4
3 3:4
4 1:1
POWER


Sample Output

1
7

Was This Post Helpful? 0
  • +
  • -

#7 supersloth   User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4678
  • View blog
  • Posts: 28,500
  • Joined: 21-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 12 August 2005 - 12:22 PM

PROBLEM 4: INSIDE OUT

Inside Out

Bad news - the contractor you hired to build your new house was a little less than competent. He took a few...artistic liberties during construction. As it turns out, only part of the building is actually enclosed. "Cheap air conditioning," he called it.

Luckily, he did provide you with a revised blueprint. Using this blueprint, your task is to find the total area enclosed on all sides by walls in the finished house. 


Input

The input consists of multiple blueprints, each separated by a blank line. The first line of a blueprint specifies the height H and width W of the blueprint, separated by a space. The next H lines describe the blueprint. The character 'x' represents a unit of wall, and the character '.' represents unit of ground.

No height or width will exceed 100 units.


Output

One line per blueprint specifying the total enclosed area.


Sample input

5 5
.....
xxxx.
.x.x.
.x.x.
.xxxx

13 18
..................
..................
.xxxxxxxxxxxxxxx..
.x.............x..
.x.............x..
.x...xxxxxxxxx....
.x...x.......x....
.x...x.......x....
.x...x.......x....
.xxxxxxxxxxxxx....
.....x...x........
.....xxxxx........
.....x............


Sample output

2
24

Was This Post Helpful? 0
  • +
  • -

#8 supersloth   User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4678
  • View blog
  • Posts: 28,500
  • Joined: 21-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 12 August 2005 - 07:04 PM

The submission form is located at the following page:
http://home.dreamincode.net/?p=48hours

Rules in the first post.

GOOD LUCK!
Was This Post Helpful? 0
  • +
  • -

#9 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1964
  • View blog
  • Posts: 20,423
  • Joined: 17-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 16 August 2005 - 03:05 PM

1st Place Winner Posted, see first post in this thread for details.
Was This Post Helpful? 0
  • +
  • -

#10 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1964
  • View blog
  • Posts: 20,423
  • Joined: 17-March 01

Re: 48 Hours of Code - And The Winner Is...

Posted 17 August 2005 - 12:59 PM

Top 10 posted, we'll be contacting everyone who will be receiving a prize, thanks again to all who participated!!! Expect another contest soon!!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1