SPELL scoring

I’m not getting how I can score 0.003 with 99 points, while on the 10 Mb test case I
built from the SPELL statement, it fixes everything correctly within less than 1/2 second, on my linux.
So I wondering if everything is ok with the judge regarding the SPELL.
I’m seeing already problem in the example given that is not correct, it say :
Input:
[dictionary declaration is omitted in this sample case]
thus is the sample text.

Output:
this is the sample text.

That is obviously wrong as “thus” is in the dictionary, so it should be kept as it is,
"is" is not in the dictionary, and can’t be found either by inserting or removing a char nor swapping so it is left as-is as an unknown word.

"the" is not in the dictionary either, so my code change it to “othe” which is in the dictionary.
"sample" & “text” are in the dict, so they are ok.

So in fact the correct output is :
thus is othe sample text.

Said the example is wrong, I’m wondering how judge is working and if it is working correctly.
There is also an ambiguity in the swap of leters has it is not said if these are
two consecutive letters only, or any letter, In such case depending on the order your
code swap, you can find several responses in the dictionary, then I’m wondering if
the judge accept all of them or only one.
I.E if he wrote “wsap” you can find “swap” or “paws” which are both in the Dict.

Regards.

You need to correct the spelling(Correct English statement) with or without help of dictionary. :wink:

Deriving “this” in that case is slightly difficult, but you can remove other spelling mistakes.

1 Like

the fact is the provided dictionary was really :

  • lacking some words (especially len <= 3, but a lot of others)
  • not enough to correct grammar mistakes (thus is -> this is)
  • misleading because all words had an equal weight in it (bag, ban, bar, bat)
  • and misleading again because it contained wrong replacements for not-obvious valid words

i’m pretty excited to see the editorial for this one.

and what would be great, is an explaination of the top corder’s code :slight_smile:

3 Likes

Secondly, the problem stated that the line contains english letters with correct “grammar”. So i dont see the point of the test case given… How m i supposed to make a program which converts thus to this, because it is “grammatically correct”. And given the fact that both are present in the dictionary.