OFF páros gráfok párosítása

Kovács Gábor zonder at freemail.hu
Tue Dec 7 22:08:33 CET 2004


Üdv mindenkinek!
Nem csinált már valaki páros gráfok párosítását (magyar módszer) 
valamilyen programozási nyelven? Ha igen, akkor biztos tudna segíteni!

A feladat a következő:

"Problem D:

Wizards Introduction 30th February is the Annual Magician's Day, since 
it is the birthday of the Great Archmage Luxiputrius. The National 
Association of Wizards and Sorcerers has decided to organize several 
shows on this day throughout the country. There are several cities where 
these events can be held. However, in a given city only one wizard can 
perform: it would be too dangerous to allow two wizards to cast spells 
in the same city at the same time. The wizards live in ivory towers, 
usually far from the cities. They do not like travelling: a wizard 
refuses to go a distance of more than 50 km from their home (most 
probably because the popular Teleport Amulets only have a range of 50 
km). The National Association of Wizards and Sorcerers would like to 
organize as many shows as possible on the Annual Magician's Day. Your 
job is to determine how many shows can be held.

Input

Each input file begins with two numbers n (1 ? n ? 1000), the number of 
cities, and m (1 ? m ? 1000), the number of wizards. This is followed by 
n + m lines, each containing two coordinates (in km). The ?rst n of 
these lines describe the position of the cities, the next m lines 
describe the position of the towers of the wizards. The coordinates are 
not necessarily integer.

Output

Output is a single number, the maximum number of shows that can be held 
on one night. At most one show can be organized in every city, and a 
wizard can perform no more than one show a day. The number in the output 
should be terminated by a new line character 10.

Sample Input
4 4
10 0
70 0
150 0
220 0
60 0
110 0
190 0
0 0

Sample Output
4 6
"
Ha valakinek van valami használható ötlet, akkor kérem írjon magánba ( 
zonder@ freemail.hu) , hogy hogyan lehetne ezt a feladatot 
leprogramozni, esetleg valaki tudja, hogy hogyan lehet a páros gráfok 
párosítását átültetni c++ -ra, akkor az is szívesen fogadom.
Ezt a feladatot kéne megcsinálnom péntek 24:00-ig.
Ez a feladat volt a 4. Nemzetközi 24 órás programozói verseny egyik 
feladata, amit az első 3 csapaton kívűl nem tudtak megcsinálni, mi meg 
megkaptuk házinak, hogy csináljuk meg :-(
Aki szereti a kihívásokat és tud programozni, annak ajánlom ezt a 
feladatot, mert igen-igen nehéz a megvalósítása. Egyszerűnek néz ki, de 
ha az ember elmerül a benne, rájön, hogy nem is olyan egyszerű.

A segítségeket előre is köszönöm mindenkinek! (azoknak is, akik legalább 
elolvasták a levelet :-) )

-- 
  Zonder

Kovács Gábor
zonder at freemail.hu
ICQ# 195 344 765
LinuxCounter: #366861




More information about the Elektro mailing list