Page 1 of 4

843 - Crypt Kicker

Posted: Sun Jun 16, 2002 6:47 am
by dh3014
In the problem description it said:
"If there is more than one solution, any will do. "
but the icon of the problem shows that it doesn't use special judge...
may any adms tell me what's going on?

Posted: Sun Jun 16, 2002 6:58 am
by 10153EN
Does it means that the judge data is well chosen so that there's only one solution?

Posted: Sun Jun 16, 2002 7:35 am
by dh3014
yes, probably the test data was chosen...
but after I got several WA and test my program several times...
I think I should check it out if there's any mistake judge made.

Posted: Sun Jun 16, 2002 2:29 pm
by Adrian Kuegel
I am quite sure that the test data is not chosen, because I found some test inputs on the Waterloo Homepage and my program gives different, but correct outputs for some of the test cases. I will write a special judge program for this problem.

Posted: Sun Jun 16, 2002 3:09 pm
by dh3014
quite thanks

Posted: Sun Jun 16, 2002 3:33 pm
by Adrian Kuegel
I have now written the special judge program and send it to the admins. If after rejudge you get Wrong answer, you can send me your program, so that I can look, if my judge program or your program is wrong.

843 - Crypt Kicker

Posted: Mon Aug 12, 2002 12:14 am
by rfcotta
What are the gotchas on problem #843? I am almost sure my program works, but I get WA.

Any idea of something I may be missing?

Posted: Mon Aug 12, 2002 12:36 am
by Adrian Kuegel
Each letter must be decoded uniquely, that means that if the coded word is ab, the decoded word can't be cc.

Posted: Mon Aug 12, 2002 12:43 am
by rfcotta
Adrian Kuegel wrote:Each letter must be decoded uniquely, that means that if the coded word is ab, the decoded word can't be cc.
And that's what I do! If input gives me "ac" and the dictionary "xy", "xy will appear on output only if a new "ac" appears. That's right, isn't it? a sample follows.

input

2
ac
ad
xy xz cv

output

ac ad **

Posted: Mon Aug 12, 2002 12:46 am
by rfcotta
Adrian Kuegel wrote:Each letter must be decoded uniquely, that means that if the coded word is ab, the decoded word can't be cc.
This sample is better:

input

2
ac
ad
xy kz cv

output

ac ad **

----
"a" appears as "x" and "k". Is it ok?

Posted: Mon Aug 12, 2002 12:51 am
by Adrian Kuegel
I see your mistake. In this case you must output ** ** ** (replace every letter of the alphabet by an asterisk). And your second example is not ok, I tried to explain it.

Judge program

Posted: Sat Sep 21, 2002 6:36 pm
by hlchan
I submit a program that output nothing, and got accepted with runtime = 0.00s.

: )
Adrian Kuegel wrote:I have now written the special judge program and send it to the admins. If after rejudge you get Wrong answer, you can send me your program, so that I can look, if my judge program or your program is wrong.

Posted: Thu Jun 19, 2003 4:30 am
by rjhadley
I'm having trouble coming up with a fast enough algorithm.

I tried a branch-and-bound method which iterates through each word in the input line and tried every word of the same length in the dictionary. If the current decoding is consistent it recurses to the next word in the input, otherwise it bounds the search.

Is there another methodology which is faster?

843 Crypt Kicker

Posted: Thu Jul 17, 2003 6:56 pm
by PJYelton
I am stumped on how to do this problem within the 10 second limit. The method I have is a recursive function that checks each word against all the words in the dictionary that are the same length and backs up everytime it hits a snag. It works beautifully but unfortunately it times WAY out at only 100 words and considering that the dictionary could be up to 1000 words there is obviously a different way to do this. Any hints or help?

Posted: Thu Jul 17, 2003 7:22 pm
by Julien Cornebise
Hi !

An advice given in "Programming Challenges" is to use equivalence classes, using the length of words has you do, but also using repeated letters.
Nevertheless, I haven't tried it.