На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
! правила раздела Алгоритмы
1. Помните, что название темы должно хоть как-то отражать ее содержимое (не создавайте темы с заголовком ПОМОГИТЕ, HELP и т.д.). Злоупотребление заглавными буквами в заголовках тем ЗАПРЕЩЕНО.
2. При создании темы постарайтесь, как можно более точно описать проблему, а не ограничиваться общими понятиями и определениями.
3. Приводимые фрагменты исходного кода старайтесь выделять тегами code.../code
4. Помните, чем подробнее Вы опишете свою проблему, тем быстрее получите вразумительный совет
5. Запрещено поднимать неактуальные темы (ПРИМЕР: запрещено отвечать на вопрос из серии "срочно надо", заданный в 2003 году)
6. И не забывайте о кнопочках TRANSLIT и РУССКАЯ КЛАВИАТУРА, если не можете писать в русской раскладке :)
Модераторы: Akina, shadeofgray
  
> Problem C - Revenge of Faucet Flow
    Здравствуйте.

    Есть задание:
    http://acm.uva.es/p/v106/10675.html

    A faucet is pouring water into an MxN rectangular aquarium. The aquarium's floor is uneven, formed from a number of unit cubes piled on top of one another (and glued, to make them watertight). Thus, every square in the aquarium has a specific height, from 0 to 9. There are no other walls or obstructions in or surrounding the aquarium (it is open on all sides). Water pours from the faucet at a rate of 1 cubic unit per second. How long will it take before water begins spilling over one of the sides?

    You may assume that the water behaves ideally: it instantly spreads out across any flat surface, spilling over all adjacent edges at an equal rate of flow. It cannot flow between two cubes that touch, even at a corner.
    Input

    There are up to 20 test cases. Each test case begins with a line containing two integers M and N (1 <= M,N <= 10), specifying the number of rows and columns in the aquarium, respectively. The next line contains R and C (1 <= R <= M, 1 <= C <= N), giving the coordinates of the square the faucet is pouring on. (1,1) is the upper-left corner. Finally, M lines with N integers are given, specifying the height of each square in the aquarium.

    Input is terminated with a line containing two zeros.

    For each case, output one line containing the number of seconds it will take before water starts spilling over any of the four sides of the aquarium. Print your answer accurate to two decimal places.
    Sample Input

    4 4

    2 2

    5 3 5 5

    5 0 2 5

    5 2 2 5

    5 5 5 5

    0 0


    Output
    6.00

    Кто-нибудь может подсказать алгоритм решения этого задания. В итоге - нужно сделать все это на с++. Буду рад, если кто-то сможет посоветовать что и как и где.

    Вариантов решения данной проблемы в инете я не нашел :( А жаль.

    Спасибо.

    // nikita
      С такими вопросами - сюда (там есть один чудак - всё решает и выкладывает решения в отдельную ветку форума) :D
      Алгофорум
      Правда, он пишет на паскале
      0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
      0 пользователей:


      Рейтинг@Mail.ru
      [ Script execution time: 0.0657 ]   [ 15 queries used ]   [ Generated: 18.11.26, 02:33 GMT ]