argon bulletin board

Експертно търсене  

Новини:

Регистрирането на нови потребители е временно деактивирано.

Автор Тема: Reklama na Top Coder  (Прочетена 1104 пъти)

Stilgar

  • Неактивен Неактивен
  • Публикации: 843
Reklama na Top Coder
« -: 01.07.2006, 17:23:27 »

Mai tova e miastoto da pusna malko reklama za edna velikolepna ideia koiato mai ne e mnogo populiarna v BG (pone az s takova vpechatlenie ostavam). Tova e site-a Top Coder www.topcoder.com . Tam shte namerite neshto kato ejesedmichna, online olimpiada po informatika. Zadachi ima za vsichki. Pochvat s lesni i se svurshva s takiva na koito ne moga da razbera kakvo se iska. Ima si ladder i cvetni nicknames spored tochkite taka che usiliata vi dori na nisko nivo shte proizvedut efekt. Sledvat teniski ot Google a za nai-dobrite ima dori pari.

postvam primer za nai-trudna i nai-lesna zadacha za da imate predstava kakvo predstavliavat zadachite. Moje da se pishe na C#, Java, VB i C++ (kato koda se pishe v Java applet no ne prechi da si go paste-vate ot visual studio)

Sledva primer za nai-lesna zadacha (obshto sa 5 obiknoveno):

Problem Statement
In a set of distinct numbers, the median is an element M such that the number of elements greater than M is equal to the number of elements smaller than M. For example, in a set {1, 4, 2, 5, 7} the median is 4 because two elements (5 and 7) are greater than 4 and 2 elements (1 and 2) smaller than 4. The set {1, 5, 8, 3} has no median because no element from it satisfies the definition above.

You are given a int[] numbers. Return the median of numbers or -1 if numbers has no median.


Definition
Class: MedianOfNumbers
Method: findMedian
Parameters: int[]
Returns: int
Method signature: int findMedian(int[] numbers)
(be sure your methodis public)




Constraints
- numbers will contain between 1 and 50 elements, inclusive.
- Each element of numbers will be between 1 and 100, inclusive.
- All elements of numbers will be distinct.

Examples
0)
{1, 4, 2, 5, 7}


Returns: 4

The example from the statement.


1)
{1, 5, 8, 3}


Returns: -1



2)
{7}


Returns: 7

There are zero elements that are greater than 7 and zero elements that are smaller than 7.


3)
{7, 12}


Returns: -1



4)
{66, 53, 47, 86, 18, 21, 97, 92, 15}


Returns: 53



5)
{32, 54, 27, 4, 69, 96, 73, 1, 100, 15, 21}


Returns: 32



i primer za nai trudna:


Problem Statement
You are attempting to assemble a wardrobe, but you have misplaced the instructions. The wardrobe has several holes, each of which is designed to accommodate a bolt of a specific size. A hole with size D should be matched with a bolt of size D. However, bolts with sizes D-1 and D+1 will also fit. Since you don't have the instructions, you decide to do the following: For each bolt, you will randomly choose an available hole in which the bolt will fit, and screw the bolt into that hole. If the bolt cannot fit into any of the available holes, you will skip it and move on to the next one.

You are given a int[] bolts containing the sizes of the bolts. For each element in bolts, there is a corresponding hole with the same size. Return the maximum number of unused holes that can remain at the end of this process.


Definition
Class: Wardrobe
Method: countUnscrewedHoles
Parameters: int[]
Returns: int
Method signature: int countUnscrewedHoles(int[] bolts)
(be sure your methodis public)




Constraints
- bolts will contain between 1 and 50 elements, inclusive
- Each element of bolts will be between 1 and 100, inclusive.

Examples
0)
{1, 2, 3}


Returns: 1

You can screw the bolt with size 2 into the hole with size 1, and the bolt with size 3 into the hole with size 2. The bolt with size 1 cannot fit into the remaining hole with size 3, so one hole will remain unused in this case.


1)
{1, 2, 3, 2, 4}


Returns: 1



2)
{1, 2, 3, 3, 4, 2, 5, 4}


Returns: 2



3)
{12, 14, 12, 25, 15, 22, 19, 13, 26, 19, 24, 18, 14}


Returns: 2



4)
{26, 26, 26, 14, 13, 28, 27, 15, 27, 28, 28, 26}


Returns: 3





Tova e za sega ima mnogo drugi vuprosi kato naprimer kak stava samoto sustezanie, kak se trupat tochkite, kakvi sa iziskvaniata za reshenie i prochie. Ako ima interes (i vi murzi da rovite i chetete po site-a) s radost shte vi otgovoria.

P.S. ima sushto Software Design, Software Development i drugi podobni sustezania koito iskat ot vas gotov software no te ne sa tolkova populiarni a i opredeleno ne sa tolkova fun (za smetka na tova tam se davat po-seriozni parichni nagradi)
Активен
"Човек винаги трябва да си прави background" - Lia