ssavi's blog

By ssavi, 8 years ago, In English

Hello People !!!

I am trying to solve the following problem . But every time I am getting Wrong Answer ( 100 % ).

Problem Link : https://www.urionlinejudge.com.br/judge/en/problems/view/2087

Code: http://ideone.com/JhgbXI

I have tried some random Input Output cases compared to the following Accepted Solution ( This is not my solution ). Those cases I have tried all are given the same output as the following code given .

AC Solution: http://ideone.com/RoiU3k

But don't know why I am getting Wrong Answer every time.

Algorithm: Trie

At first I am taking the strings into a Map and Check whether a string comes more then once. If it is then I print Conjunto Ruim . If it is not then,

I tried to find whether there is a prefix of the string I am currently checking is available in any other string except itself using Trie. If it is the I print Conjunto Ruim else I print Conjunto Bom .

Please someone help me why I am getting Wrong Answer? It would be a great favor . I stucked for hours.

Thanks in Advance .

  • Vote: I like it
  • 0
  • Vote: I do not like it