473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Race problem

"race
N cars are lined up at the starting line of a Formula 1 race.
Task
Write a program that determines in how many ways the cars can pass the finish line, knowing that there may be more than one car arriving at the same time.
Input Data
Input file race.in contains a single line which has positive integer N on it.
Output Data
Output file race.out will contain a single line with the number of ways the cars can pass the finish line.
Restrictions
1 <= N <= 100
Examples
race.in race.out Explanation
2 3 1st way: the two cars pass the finish line in order 1, 2
2nd way: the two cars pass the finish line in order 2, 1
3rd way: the cars pass the finish line at the same time."
The algoritm i believe can be resolved mathematically, although the formula I haven't discovered yet. If you can help send the answer at: puscas_marinar@yahoo.com
Jan 2 '07 #1
2 1383
And btw I forgot to tell that the problem is in C++.
Jan 2 '07 #2
already sent you an e-mail..
hope it helps...
Jan 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: GIMME | last post by:
One of my coworkers insists that one should never use static methods because race conditions exist. Thinking along the lines that all variable assignments are assignments to static variables. ...
5
by: Rebecca Smith | last post by:
I'm building log book to keep track of a racers stats during a long ultra marathon race. Things such as time on the bike, time off, H20 intake, electrolytes and the like. When I say long I mean...
2
by: fran | last post by:
Server: IBM XSERIES 225 (Intel Xeon CPU 2.40GHz 1GB RAM) Operating System: Linux RedHat ES 2.1 kernel 2.4.9 Languaje: C++ Compiler: gcc 2.96 Libs: pthread We are in need of your help in...
1
by: Swami Tota Ram Shankar | last post by:
"Bob Weigel" <dontuwish@nothing.net> wrote in message > > While George Bush, is the epitome of evil, racism, and uncompassionate > > conservatism, Kerry is either deluded, very deluded, or...
18
by: Urs Vogel | last post by:
Hi I wrote an application server (a remoting sinlgeton), where processes must be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and only after a Thread.Abort(), this...
2
by: antonyliu2002 | last post by:
I do not quite understand the race condition. As I posted a couple of days ago, I create a PDF on the fly in my web application at regular intervals. Users will be able to download the PDF...
7
by: Berryl Hesh | last post by:
I wouldn't nomally post this here, as it has something to do with the ListView control usage I think, or maybe with a race condition or some windoes messaging. I'm just not sure. The test below...
0
by: moltendorf | last post by:
I've been trying to find a suitable method for preventing race conditions in my own code. Currently I'm using a file and the flock function to prevent code in other threads from executing at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.