IPB
ЛогинПароль:

> Прочтите прежде чем задавать вопрос!

1. Заголовок темы должен быть информативным. В противном случае тема удаляется ...
2. Все тексты программ должны помещаться в теги [code=pas] ... [/code], либо быть опубликованы на нашем PasteBin в режиме вечного хранения.
3. Прежде чем задавать вопрос, см. "FAQ", если там не нашли ответа, воспользуйтесь ПОИСКОМ, возможно такую задачу уже решали!
4. Не предлагайте свои решения на других языках, кроме Паскаля (исключение - только с согласия модератора).
5. НЕ используйте форум для личного общения, все что не относится к обсуждению темы - на PM!
6. Одна тема - один вопрос (задача)
7. Проверяйте программы перед тем, как разместить их на форуме!!!
8. Спрашивайте и отвечайте четко и по существу!!!

> Пояснение к задаче на Английском
сообщение
Сообщение #1


Бывалый
***

Группа: Пользователи
Сообщений: 231
Пол: Женский

Репутация: -  6  +


Важно:

yes2.gif Это задача с онлайн: http://www.hsin.hr/coci yes2.gif
Люди,может кто-то мне объяснит эту задачу а то я пасс:
Цитата

BARD

Every evening villagers in a small village gather around a big fire and sing songs.
A prominent member of the community is the bard. Every evening, if the bard is present, he sings a
brand new song that no villager has heard before, and no other song is sung that night. In the event
that the bard is not present, other villagers sing without him and exchange all songs that they know.
Given the list of villagers present for E consecutive evenings, output all villagers that know all songs
sung during that period.
Input

The first line of input contains an integer N, 1 ≤ N ≤ 100, the number of villagers. The villagers are
numbered 1 to N. Villager number 1 is the bard.
The second line contains an integer E, 1 ≤ E ≤ 50, the number of evenings.
The next E lines contain the list of villagers present on each of the E evenings. Each line begins with a
positive integer K, 2 ≤ K ≤ N, the number of villagers present that evening, followed by K positive
integers separated by spaces representing the villagers.
No villager will appear twice in one night and the bard will appear at least once across all nights.
Output

Output all villagers that know all songs, including the bard, one integer per line in ascending order.
Sample test data

input
4
3
2 1 2
3 2 3 4
3 4 2 1
output
1
2
4

input
8
5
4 1 3 5 4
2 5 6
3 6 7 8
2 6 2
4 2 6 8 1
output
1
2
6
8

input
5
3
2 1 3
2 2 1
4 2 1 4 5
output
1


Сообщение отредактировано: Perfez -
 Оффлайн  Профиль  PM 
 К началу страницы 
+ Ответить 

Сообщений в этой теме


 Ответить  Открыть новую тему 
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 





- Текстовая версия 28.03.2024 16:54
500Gb HDD, 6Gb RAM, 2 Cores, 7 EUR в месяц — такие хостинги правда бывают
Связь с администрацией: bu_gen в домене octagram.name