资格赛A-官方解释

First we store all the words in a 2 dimensional array.

首先我们在一个二维数组里面储存所有的词。


After that, we read each pattern, parse it, and count how many words match.

然后,我们读每一个样式,解析它,然后统计有多少单词匹配。

One possible way of storing a pattern is a 2 dimensional array P[15][26]. P[i][j] is True only if the i-th token contains the j-th letter of the alphabet, otherwise False. In other words, P[i] is a bitmap of the letters contained by the i-th token.

一个可行的方法,存储一个样式在一个二维数组P[15][26]。P[i][j]是真的,仅当i-th包含字母表中的j-th字符,否则为假。

换句话说,P[i]是一个象征i-th的,包含了字符的位图。

Parsing can be done like this:

解析可以像这样子完成:
- read one character c

读一个字符c
- if c is '(', read characters until we hit ')'. The characters read are the token.
else the token is the character c

如果c是(,读字符直到读到)。读取的字符是token的。
- populate P[i] for the characters in the token

用token中的字符填充P[i]。

To count how many words match, we make sure that each letter i from the word is contained in the bitmap P[i].
为了计算多少词匹配,我们确认每一个来自单词的i,都包含在位图P[i]中。


Total complexity is O(N * L * D).

----------------------------------------------------

好吧,我承认,我是没看懂……。

有看懂的说下~~,非常感谢。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值