Переправа через реку

Трём путешественникам нужно пересечь реку. У каждого из них определенное количество золотых монет в рюкзаке.
Путешественник А имеет 1000 монет
Путешественник B имеет 700 монет
Путешественник C имеет 300 монет

Для пересечения реки есть лодка, которая может вместить максимум 2 объекта - двух путешественников или путешественника с рюкзаком. Проблема заключается в том, что если оставить любого путешественника с количеством золота, превышающим его собственное - он сбежит, прихватив все деньги. То же касается и двух путешественников, если они останутся с золотом, превышающим их суммарные запасы - они убегут с золотом.
Какая стратегия позволит всем пересечь реку и остаться при деньгах?

Ответ:

0. (1000)(700)(300) A B C ---- 
1. (1000)(300) A C ---- (700) B
2. (1000)(300) A B C ---- (700)
3. (1000) B C ---- (700) (300) A
4. (1000) A B C ---- (700) (300)
5. (1000) A  ---- (700) (300) B C
6. (1000) (300) A C ---- (700) B
7. (300) C ---- (700) (1000) A B
8. (700) (300) B C ---- (1000) A
9. (700) (300) ---- (1000) A B C
10. (700) (300) A ---- (1000) B C
11. (700) ---- (300) (1000) A B C
12. (700) B ---- (300) (1000) A C
13. ---- (300) (1000) (700) A B C
Ваша оценка: Нет Средняя: 3.2 (1148 оценки)


Комментарии

Капец, я решил правильно до 8 пункта. была мысля отправить A назад одного, но чет я думал что лотка перевозит только 2 объекта , посмотрел ответ офигел...посмотрел в условие , понял что упустил слово максимум..капец , просто минус настроение

Не понимаю смысл в действиях 1-6, если в 6 шаге опять на другом берегу остается  С 700,  так же как и после первого шага...

Шаг 0: Лодка слева
Шаг 1: Лодка справа
Шаг 2: Лодка слева
Шаг 3: Лодка справа

Шаг 4: Лодка слева
Шаг 5: Лодка справа
Шаг 6: Лодка слева 

My spouse and I absolutely love your blog and find almost all of your post's to be just what I'm looking for.


Do you offer guest writers to write content for yourself?


I wouldn't mind publishing a post or elaborating on a few of the


subjects you write concerning here. Again, awesome web


site!





Feel free to visit my homepage: วิเคราะห์บอลวันนี้

My coder is trying to persuade me to move to .net from PHP.


I have always disliked the idea because of the expenses.


But he's tryiong none the less. I've been using Movable-type on various websites for about a year and am


concerned about switching to another platform. I have


heard very good things about blogengine.net.





Is there a way I can import all my wordpress posts


into it? Any kind of help would be really appreciated!








Have a look at my webpage - วิเคราะห์บอลวันนี้

Hey there! I could have sworn I've been to this site before but after browsing through


some of the post I realized it's new to me. Anyhow, I'm definitely


delighted I found it and I'll be bookmarking and checking back frequently!








My blog post - ______________________

Hey there just wanted to give you a quick heads up.





The words in your content seem to be running off the screen in Chrome.





I'm not sure if this is a format issue or something to do with browser compatibility but I thought I'd post to let you know.





The layout look great though! Hope you get the problem fixed soon. Kudos





Have a look at my homepage ______________________

I constantly spent my half an hour to read this webpage's content everyday along with a mug of coffee.








My webpage _________________

Magnificent beat ! I wish to apprentice whilst you amend


your website, how could i subscribe for a blog web site?





The account helped me a applicable deal.


I were a little bit familiar of this your broadcast offered vibrant transparent concept





Here is my web blog; __________________

Attractive component to content. I just stumbled upon your web site and in accession capital to claim that I acquire in fact loved account your blog posts.


Any way I'll be subscribing in your feeds and even I success you get right of entry to persistently fast.








Also visit my web blog; https://freefire.bet/slot008-01-08-64/

I don't even understand how I ended up right here, however


I thought this submit used to be great. I don't realize who


you're but certainly you're going to a famous blogger when you aren't already.


Cheers!





Take a look at my blog post วิเคราะห์บอลวันนี้

You actually make it seem so easy with your presentation but I find this matter to be really


something which I think I would never understand.


It seems too complex and very broad for me. I am looking


forward for your next post, I will try to get the hang of it!








My page - วิเคราะห์บอลวันนี้

Helpful information. Fortunate me I discovered your website


accidentally, and I am surprised why this twist of fate didn't happened in advance!





I bookmarked it.





Feel free to visit my web-site: ______________________

Have you ever considered about adding a little bit more than just your articles?





I mean, what you say is valuable and all. Nevertheless think about


if you added some great pictures or videos to give your posts more, "pop"!


Your content is excellent but with pics and videos, this blog could certainly be one of the greatest in its niche.


Very good blog!





Here is my web-site ... __________________

My programmer is trying to convince me to move to .net from


PHP. I have always disliked the idea because of the expenses.


But he's tryiong none the less. I've been using Movable-type on a


variety of websites for about a year and am worried


about switching to another platform. I have heard very good things about blogengine.net.


Is there a way I can import all my wordpress content into it?


Any help would be really appreciated!





Here is my web page ... วิเคราะห์บอลวันนี้

Wonderful article! This is the kind of information that are meant to


be shared around the internet. Shame on the search engines for


not positioning this post higher! Come on over and consult with


my site . Thank you =)





Here is my site วิเคราะห์บอลวันนี้

Greate pieces. Keep posting such kind of information on your site.


Im really impressed by your site.


Hi there, You've performed an incredible job. I will definitely digg it


and individually suggest to my friends. I'm sure they'll be benefited from this


site.





my site; เซ็กซี่บาคาร่า

Страницы