POJ 1035: Spell checker

这是一个关于编程竞赛POJ 1035的问题,要求编写一个程序,根据给定的词典检查单词的正确性。如果单词不在词典中,可以通过删除、替换或插入一个字母来找到可能的正确替代词。输入包含词典和要检查的单词列表,输出是每个单词的正确性或其可能的替代词。
摘要由CSDN通过智能技术生成

题目来源:http://poj.org/problem?id=1035

Spell checker

Time Limit: 2000MS

Memory Limit: 65536K

Total Submissions: 27099

Accepted: 9915

Description

You, as a member of a development team for a newspell checking program, are to write a module that will check the correctnessof given words using a known dictionary of all correct words in all theirforms. 
If the word is absent in the dictionary then it can be replaced by correctwords (from the dictionary) that can be obtained by one of the followingoperations: 
?deleting of one letter from the word; 
?replacing of one letter in the word with an arbitrary letter; 
?inserting of one arbitrary letter into the word. 
Your task is to write the program that will find all possible replacements fromthe dictionary for every given word. 

Input

The first part of the input file contains allwords from the dictionary. Each word occupies its own line. This part isfinished by the single character '#' on a separate line. All words aredifferent. There will be at most 10000 words in the dictionary. 
The next part of the file contains all words that are to be checked. Each wordoccupies its own line. This part is also finished by the single character '#'on a separate line. There will be at most 50 words that are to bech

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值