![]() |
Модераторы: bsa |
![]() ![]() ![]() |
|
viktor2014 |
|
|||
Новичок Профиль Группа: Участник Сообщений: 2 Регистрация: 19.1.2013 Репутация: нет Всего: нет |
Domino
Given a set of domino pieces where each side is marked with two digits from 0 to 6. Your task is to arrange pieces in a line such way, that they touch through equal marked sides. It is possible to rotate pieces changing left and right side. Input The first line of the input contains a single integer N (1 ≤ N ≤ 10) representing the total number of pieces in the domino set. The following N lines describe pieces. Each piece is represented on a separate line in a form of two digits from 0 to 6 separated by a space. Output Write “No solution” if it is impossible to arrange them described way. If it is possible, write any of way. Pieces must be written in left-to-right order. Every of N lines must contains number of current domino piece and sign “+” or “-“ (first means that you not rotate that piece, and second if you rotate it). Sample Input 5 1 2 2 4 2 4 6 4 2 1 Sample Output 2 - 5 + 1 + 3 + 4 - |
|||
|
||||
feodorv |
|
|||
![]() Эксперт ![]() ![]() ![]() ![]() Профиль Группа: Комодератор Сообщений: 2214 Регистрация: 30.7.2011 Репутация: 12 Всего: 45 |
И?
-------------------- Напильник, велосипед, грабли и костыли - основные инструменты программиста... |
|||
|
||||
borisbn |
|
|||
![]() Эксперт ![]() ![]() ![]() ![]() Профиль Группа: Завсегдатай Сообщений: 4875 Регистрация: 6.2.2010 Где: Ростов-на-Дону Репутация: 21 Всего: 135 |
You're breaking two rules of this forum:
1) The official language of this forum is russian 2) You should ask to make your task in special section of this forum But this task was interesting for me, so I implemented it - http://ideone.com/xB3ZjN You should only throw out initialization of a vector of pieces and read them from file. If you can't you should say to your teacher/employer that you can't be a programmer. Это сообщение отредактировал(а) borisbn - 3.10.2014, 13:49 -------------------- Женщины отличаются от программистов тем, что у них чары состоят из стрингов |
|||
|
||||
![]() ![]() ![]() |
Правила форума "C/C++: Для новичков" | |
|
Запрещается! 1. Публиковать ссылки на вскрытые компоненты 2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, JackYF, bsa. |
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | C/C++: Для новичков | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |