|
|
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 There is one more case when N>2 and all languages are the same. "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. Hello. What about test 15? Can you give it? In this test: 3 russian russian french In test: 3 russian russian french we can use new language, for example, "qwerty". The result must be: 3 russian-qwerty french-qwerty french-russian I am right? You aren't right. When crews "russian-2" and "french" want to communicate each other, another crew "russian-1" can understand their talk, because Russian is used in it! So, if there are two crews with the identical name, the answer will be "Impossible"? If, it's true, the problem becomes trivial. We create new language and connected it with each crews. ? input: 4 russian german russian german answer: 5 russian-eng russian-fra german-eng german-fra eng-fra it's true? or result will be "Impossible"? Edited by author 07.10.2007 21:58 Edited by author 07.10.2007 21:59 Thanks for all. AC. The problem is really trivial! Impossible input: 4 russian german russian german answer: 5 russian-eng russian-fra german-eng german-fra eng-fra it's true? or result will be "Impossible"? Edited by author 07.10.2007 21:58 Edited by author 07.10.2007 21:59 what answer on the test input 5 eng ru ua ger ita output 5 eng-qwedfgjk ru-qwedfgjk ua-qwedfgjk ger-qwedfgjk ita-qwedfgjk is it correct???? input 2 a a output Impossible ???? For test 2 a a correct output is 0 of course. Edited by author 06.10.2007 23:07 In test 3 english english english My prog gave 0 and I got AC, but I should output "Impossible". Am I right? So... Shouldn't this test be added? You are right. We have added this test. Is the 1st test is a sample one? Can i use any laguage? Than why i got WA then using "MyLanguage"? Algo does the order of printed language is important? russian-english english-german english-french is the same as english-russian english-german english-french or no? It is a mistake in sample output must be russian-french russian-german french-german it can pass 1st test i use this but I got wa3 try 2 a a Good test, but now WA6... :( Really, i do not understand why we cant use some intermidiate language what is known only by translators in order to ahieve minimum? Problem's definition must be corrected. We can use any intermediate languages. More exactly - we must use it. Otherwise, you won't pass all the tests. 1. There is language "english" in 15-th test, so if you always will use "english" - you'll get WA 2. You can use your own languages, but they should correspond to restrictions on length and case Edited by author 06.10.2007 23:05 Good test, but now WA6... :( Really, i do not understand why we cant use some intermidiate language what is known only by translators in order to ahieve minimum? Problem's definition must be corrected. I also don't understand at all why solution, which out for test 4 a b c d 4 a-b b-c c-d a-d is incorrect In your situation, when crews "a" and "c" want to speak each other, they have to use two interpreters: "a-b" and "a-c" (or, may be, "a-d" and "c-d" - it does not matter). But in this case, crew "b" can understand their talk, because language "b" is used in it! You should always add a language, except special cases with n <= 2. Edited by author 07.10.2007 21:47 yes you're right!) There are at least 3 cases when N>2 Is it true, that if n=2 we need only one translator who know both languages from the input and it doesn't matter these languages are equal or not? And what is the answer for this test: 2 rus rus ? Edited by author 13.10.2007 17:56 please, give some tests input1 2 a a output1 0 input2 1 a output2 0 input3 2 a b output3 1 a-b all other cases is common. If there are 2 equal language - answer Impossible. Else create random Language and connect with all crews. take your array [105][15] Edited by author 02.06.2008 18:01 why WA on test 4? what answer on test: input.txt 2 a b ??? 2 russian enlish Answer 1 russian-enlish You are wrong! Answer is 0. He's right. Answer is 1, because team 1 have to be able to speak with team 2 Oh, sorry! Yes. Answer is 1. On this test my program answer 1. Please ans for 4 english german french russian Answer is 12 or 4 ? Edited by author 08.10.2007 14:52 What should we output ? A single line containing 0 ? How english appeared in sample? In such a way, I can use any combination of letters as a language? |
|
|