ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1571. Переводчики

Solution
Послано MSDN 14 окт 2007 13:54
This problem is very easy!.
if N=1 output is  0;
if N=2 and first language=second language output is 0;
if N=2 and first language not = second language output "first"-"second" (fist and second - it's name of language)
If N>2 if there are two or many equal languages output "Impossible"
If N>2 if all languages different you print N and print all name languages this your language.
Your language it is thought up string of latin letters. But dangerous this it. your language will be string len<10 and latin letters in small case.

Tests:
input:
1
a
output:
0

input:
2
a
a
output:
0

input:
2
a
b
output:
a-b

input:
3
a
b
c
output:
a-qwerty
b-qwerty
c-qwerty

input:
3
a
a
b
output:
Impossible
Re: Solution
Послано Denis Koshman 14 июл 2008 19:41
There is one more case when N>2 and all languages are the same.
Re: Solution
Послано Anupam Ghosh, Wipro Technologies 4 июл 2013 19:43
"There is one more case when N>2 and all languages are the same".
As per problem " Developers also settled if two crews are communicating then other crews must not understand a word because in that case other crew will listen instead of work and towers will not be constructed by the time".
Hence the output should be "Impossible" for this case.