有人可以编码吗 [英] Could someone code for thid

查看:89
本文介绍了有人可以编码吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:有效段2



考虑由句子组成的文字和由单词组成的句子。句子中的单词将以空格分隔。文本将包含两种类型的单词,即。 alpha字和beta字。字输入中表示阿尔法字。文本中非阿尔法单词的所有单词都是beta单词。任务是找出在给定范围[lb,ub]中具有β字数的有效段的数量。



如果

它包含所有K字符串

它应该开始并以任何一个K字符串结尾





输入格式:



第一行包含文本。下一行包含K,lb,ub。接下来的K行由文本中的字母词组成。



注意:



字符串比较应不区分大小写。

String比较应仅基于由字母组成的单词。诸如完全停止(。),感叹号(!)等非字母字符被称为停用词。在比较之前必须从句子中删除停用词。

如果多个段以相同的索引(即文本中单词的位置)开头,则考虑最短的段。换句话说,段应该从唯一索引开始。





输出格式:



打印给定范围内的β字数的有效段数[lb,ub]。



约束条件:

1< =文本中的单词总数< = 30,000



1< = alpha和beta单词的长度< = 500



1< = K< =阿尔法单词总数



1< = lb< = ub< = beta总数单词





样本输入和输出



SNo。输入输出

1

欧洲市场周一崩盘。欧洲市场的碰撞非常普遍。

2 3 4

欧洲

崩溃





1







说明:



有效的部分是:

欧洲市场崩溃

周一崩溃。欧洲的崩溃

欧洲的崩溃

Problem : Valid Segments 2

Consider text comprised of sentences and sentences comprised of words. Words in a sentence will be space delimited. Text will comprise of two types of words, viz. alpha words and beta words. Alpha words are denoted in the input. All words in the text which are non-alpha words are beta words. Task is to find out the number of valid segment with number of beta words in the given range [lb, ub].

A segment is said to be valid if
It contains all the K-strings
It should start and end with any one of the K-strings


Input Format:

First line contains the text. Next line contains K, lb, ub. Next K lines consist of alpha words in the text.

Note:

String comparison should be case insensitive.
String comparison should be based only on words comprised of alphabets. Non-alphabet characters such as Full Stop ("."), Exclamation Marks ("!") etc. are called as Stop words. Stop words must be removed from sentences before comparison.
If more than one segment starts with the same index (i.e. position of the word in the text), then consider the shortest segment. In other words, segments should begin from unique indexes.


Output Format:

Print the number of valid segments with number of beta words in the given range [lb, ub].

Constraints:
1<= total number of words in the text <= 30,000

1<= length of alpha and beta words <= 500

1<=K<=total number of alpha words

1<=lb<=ub<=total number of beta words


Sample Input and Output

SNo. Input Output
1
The European market crashes on Mondays. Crashes in the European market are quite common.
2 3 4
European
Crashes


1



Explanation:

Valid segments are:
European market crashes
crashes on Mondays. Crashes in the European
Crashes in the European

推荐答案

是的。是的,有人可以。也许,你的老师,以及你班上其他人只是为了初学者。



但是......你的意思是有人会为了节省我的代码而编码吗那就不要。不,我们不会。



我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!
Yes. Yes someone could. Probably, your teacher, and the rest of your class just for starters.

But...it you mean "Will someone code for thid to save me having to" then no. No, we won't.

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!


这篇关于有人可以编码吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆