Skip navigation.
Home
Freedom is contagious.

2nd Annual Codeslinger Shootout

Mar 21 2007 6:00 pm
Mar 21 2007 8:00 pm
Etc/GMT-4

Description:
The 2nd Annual Codeslinger Shootout is on! On March 21, 2007 you are invited to test your fast thinking and programming skills at the GatorLUG meeting. You could win the coveted title of "Fastest Codeslinger of 2007", and a cool mug proclaiming your victory.
Rules
1. Enter the contest by emailing your name and programming language of choice to contestgatorlug.org. You are not limited to using this language during the contest.
2. Bring your laptop (or borrow one from a friend) with a wireless connection to the meeting.
3. You may use any programming/scripting language/environment you want.
4. You may not use search engines to look for example code to copy and paste during the event.
5. You will start up your laptop and programming environment.
6. Your hands will come off the laptop and stay off until the start signal is given.
7. If you touch the computer before the start signal you will be disqualified.
8. A general problem with a single correct answer will be presented.
9. You may solve the problem with an algorithm or a simulation.
10. There will be a question and answer period.
11. After the question and answer period, the start signal will be given.
12. The first person to post their source code and correct answer output to an internal website set up for the contest wins.
13. A judge will look at the code and output to verify the winner.
14. The decision of the judge will be final, no whining allowed.
15. Hats, boots and leather are optional but good for style points.

Location:
Virtually Cuban

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swampcast's picture

Codeslinging and GatorJUG

Oh my gosh! I just noticed the contest is on the same night as our regularly scheduled Gainesville Java User Group meeting. I'm going to do some fast footwork here and see if it can be rescheduled for Thursday. If not, I will have to miss this contest and hear all about it afterwards. If I can reschedule, we'll all be there for the CodeSling. Either way, best of luck!

Best Regards,

Michael Levin
Founder, GatorJUG
http://www.gatorjug.org

danstoner's picture

Timezone is now actually GMT-4

Due to the Daylight Savings Time change...

about codeslinger

has this contest online version?

A solution

Yeah, yeah, it took me a while :)

My Answer

clintc's picture

Codeslinger 2007 Problem

It seems the actual problem that was presented for the Codeslinger 2007 contest was never posted to the site. Here is the problem.

Problem Description

A convoy of vehicles has lined up on a single lane and one-way street in front of a single lane
and one-way bridge over a river. Note that since the street is single lane, no vehicle can overtake
any other. The bridge can sustain a given maximum load. To control the traffic on the bridge,
operators are stationed on either end of the bridge. The convoy of vehicles is to be divided into
groups, such that all the vehicles in any group can cross the bridge together. When a group
reaches the other side, the operator on that side of the bridge uses a telephone to inform the
operator on this side that the next group can start its journey over the bridge. The weight of each
vehicle is known. The sum of the weights of the vehicles in any group cannot exceed the
maximum load sustainable by the bridge. Associated with each vehicle is the maximum speed
with which it can travel over the bridge. The time taken by a group of vehicles is calculated as
the time taken by the slowest vehicle in the group to cross the bridge. The problem is to find the
minimum amount of time in which the entire convoy can cross the bridge.

Input

The first line of input contains three positive integers (separated by blanks): the first one
represents the maximum load that the bridge can sustain (in tonnes); the second one represents
the length of the bridge (in kms); and the third one is the number of vehicles (n) in the convoy.
Each of the next n lines of input contains a pair of positive integers, w s (separated by blanks),
where w is the weight of the vehicle (in tonnes) and s is the maximum speed (in kmph) with
which this vehicle can travel over the bridge. The weights and speeds of the vehicles are
specified in the same order as the order in which the vehicles are queued up. You can assume
that n < 1000.

Output
The output of the program should be a single real number specifying the minimum time in
minutes in which the convoy can cross the bridge.

INPUT FILE
100 5 10
40 25
50 20
50 20
70 10
12 50
9 70
49 30
38 25
27 50
19 70

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.