【发布时间】:2018-01-30 13:20:34
【问题描述】:
问题链接:https://www.codechef.com/problems/STR
问题是:
Little John just had his first class in school. He was taught first 20
letters of English alphabet and was asked to make words from these
alphabets.
Since he doesn't know many dictionary words, he quickly finished this work
by making random strings from these alphabets.
Now while other kids are busy creating their words, John gets curious and
puts all the strings he created in a list and named it X.
He picks two indices 'i' and 'j' ( not necessarily distinct). He assigns A
as X[i] and B as X[j]. He then concatenates both the strings to create a new
string C ( = A + B ). He calls a string "super string" if that string
contains all the 20 letters of English alphabet he has just learnt,atleast
once.
Given the strings of the list, can you tell him how many such unordered
pairs (i,j) he can choose such that string C is a super string.
社论:https://discuss.codechef.com/questions/79843/str-editorial
我在这里无法理解 dp 的逻辑。有人可以帮助我吗?
【问题讨论】:
-
欢迎来到 StackOverflow。请阅读并遵循帮助文档中的发布指南。 on topic 和 how to ask 在这里申请。 StackOverflow 不是设计、编码、研究或教程服务。
-
"Can Someone Help Me?" is not a valid SO question。这通常表明您需要的是与当地导师一起半小时或完成教程,而不是 Stack Overflow。
标签: algorithm dynamic-programming bitmask